fix(agents): finish sanitized config migration — GatewayClient also reads agents-sanitized.json
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:
@@ -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 agents = new List<DashboardAgentInfo>();
|
||||
@@ -227,7 +227,7 @@ public sealed class OpenClawGatewayClient(HttpClient httpClient, IConfiguration
|
||||
}
|
||||
|
||||
/// <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.
|
||||
/// </summary>
|
||||
private List<string> LoadAgentIdsFromConfig()
|
||||
@@ -235,7 +235,7 @@ public sealed class OpenClawGatewayClient(HttpClient httpClient, IConfiguration
|
||||
try
|
||||
{
|
||||
var configPath = configuration.GetValue<string>("AgentConfigPath")
|
||||
?? "/home/node/.openclaw/openclaw.json";
|
||||
?? "/etc/nexus/agents-sanitized.json";
|
||||
|
||||
if (!System.IO.File.Exists(configPath))
|
||||
return GetDefaultAgentIds();
|
||||
@@ -1085,7 +1085,7 @@ public sealed class OpenClawGatewayClient(HttpClient httpClient, IConfiguration
|
||||
try
|
||||
{
|
||||
var configPath = configuration.GetValue<string>("AgentConfigPath")
|
||||
?? "/home/node/.openclaw/openclaw.json";
|
||||
?? "/etc/nexus/agents-sanitized.json";
|
||||
|
||||
if (!System.IO.File.Exists(configPath))
|
||||
return GetDefaultModels();
|
||||
|
||||
Reference in New Issue
Block a user