Bug Report
Summary
When Mission Control (or any client) calls agents.create followed immediately by agents.update on a separate WebSocket connection, the agents.update fails with agent not found despite the agent having been successfully created 8ms earlier.
Root Cause
In daemon-cli.js, the local writeConfigFile function calls clearConfigCache() but does not reset runtimeConfigSnapshot. This means the in-memory snapshot remains stale after a config write. Any subsequent loadConfig() call on a different connection returns the old snapshot, which doesn't include the newly created agent.
async function writeConfigFile(cfg, options = {}) {
clearConfigCache(); // ✅ clears disk cache
// ❌ runtimeConfigSnapshot is NOT reset here
// ...
}
Fix
Add runtimeConfigSnapshot = null; immediately after clearConfigCache() in the local writeConfigFile in daemon-cli.js:
async function writeConfigFile(cfg, options = {}) {
clearConfigCache();
runtimeConfigSnapshot = null; // ← add this line
// ...
}
Reproduction
- Configure a fresh OpenClaw gateway
- Pair it with Mission Control
- Observe:
agents.create succeeds, agents.update fails 8ms later with agent not found
- MC generates a new UUID on every retry — pairing never completes
Log Evidence
agents.create ✓ 51ms conn=eb477c21
agents.update ✗ 1ms conn=549eea83 — agent not found
[reload] config change applied ← 500ms too late
Impact
Every new OpenClaw instance paired with Mission Control fails on first setup. The workaround (manually patching daemon-cli.js) is not acceptable for production deployments.
Version
OpenClaw 2026.3.2 (85377a2)
Bug Report
Summary
When Mission Control (or any client) calls
agents.createfollowed immediately byagents.updateon a separate WebSocket connection, theagents.updatefails withagent not founddespite the agent having been successfully created 8ms earlier.Root Cause
In
daemon-cli.js, the localwriteConfigFilefunction callsclearConfigCache()but does not resetruntimeConfigSnapshot. This means the in-memory snapshot remains stale after a config write. Any subsequentloadConfig()call on a different connection returns the old snapshot, which doesn't include the newly created agent.Fix
Add
runtimeConfigSnapshot = null;immediately afterclearConfigCache()in the localwriteConfigFileindaemon-cli.js:Reproduction
agents.createsucceeds,agents.updatefails 8ms later withagent not foundLog Evidence
Impact
Every new OpenClaw instance paired with Mission Control fails on first setup. The workaround (manually patching daemon-cli.js) is not acceptable for production deployments.
Version
OpenClaw 2026.3.2 (85377a2)