fix(agents): finish sanitized config migration — GatewayClient also reads agents-sanitized.json
CI - Build & Test / Backend (.NET) (push) Successful in 35s
CI - Build & Test / Frontend (Vue/TS) (push) Successful in 15s
CI - Build & Test / Security Check (push) Successful in 2s
CI - Build & Test / Deploy Nexus (push) Has been skipped

The previous commit f4bee44 updated AgentService.cs but missed
OpenClawGatewayClient.cs which also reads agent IDs and model config
from the raw openclaw.json. Both LoadAgentIdsFromConfig() and
GetAvailableModels() now default to /etc/nexus/agents-sanitized.json.

This completes the P4 migration: Nexus no longer needs read access to
openclaw.json for any code path.
This commit is contained in:
2026-07-12 14:09:31 +02:00
parent f4bee442db
commit 4633e570e8
+4 -4
View File
@@ -123,7 +123,7 @@ public sealed class OpenClawGatewayClient(HttpClient httpClient, IConfiguration
) )
}; };
// Load agent IDs from openclaw.json config // Load agent IDs from sanitized agents config (no secrets)
var agentIds = LoadAgentIdsFromConfig(); var agentIds = LoadAgentIdsFromConfig();
var agents = new List<DashboardAgentInfo>(); var agents = new List<DashboardAgentInfo>();
@@ -227,7 +227,7 @@ public sealed class OpenClawGatewayClient(HttpClient httpClient, IConfiguration
} }
/// <summary> /// <summary>
/// Loads agent IDs from the OpenClaw config file (openclaw.json). /// Loads agent IDs from the sanitized agents config (no secrets).
/// Falls back to the known list if the config file is unavailable. /// Falls back to the known list if the config file is unavailable.
/// </summary> /// </summary>
private List<string> LoadAgentIdsFromConfig() private List<string> LoadAgentIdsFromConfig()
@@ -235,7 +235,7 @@ public sealed class OpenClawGatewayClient(HttpClient httpClient, IConfiguration
try try
{ {
var configPath = configuration.GetValue<string>("AgentConfigPath") var configPath = configuration.GetValue<string>("AgentConfigPath")
?? "/home/node/.openclaw/openclaw.json"; ?? "/etc/nexus/agents-sanitized.json";
if (!System.IO.File.Exists(configPath)) if (!System.IO.File.Exists(configPath))
return GetDefaultAgentIds(); return GetDefaultAgentIds();
@@ -1085,7 +1085,7 @@ public sealed class OpenClawGatewayClient(HttpClient httpClient, IConfiguration
try try
{ {
var configPath = configuration.GetValue<string>("AgentConfigPath") var configPath = configuration.GetValue<string>("AgentConfigPath")
?? "/home/node/.openclaw/openclaw.json"; ?? "/etc/nexus/agents-sanitized.json";
if (!System.IO.File.Exists(configPath)) if (!System.IO.File.Exists(configPath))
return GetDefaultModels(); return GetDefaultModels();