[Bug]: Share committed agent-rename recovery across CLI and gateway
Affected component
config/onboarding
Severity
S2 - degraded behavior
Current behavior
Agent rename commits the configuration change before all durable follower migrations have necessarily completed. Gateway/RPC recovery can detect old-alias residue through surface-local logic, but the CLI cannot re-enter that recovery after the old alias is absent from live configuration.
A post-commit failure can therefore strand old workspace, memory, knowledge, cron, ACP, or session attribution. Retrying the CLI rename reports that the old alias is not configured instead of resuming convergence.
This is distinct from #10149, which tracks durable recovery of a failed custom-workspace archive.
Expected behavior
Provide one runtime-owned committed-rename recovery contract shared by gateway/RPC and CLI:
- Resolve recovery from live configuration and the canonical durable stores.
- Fail toward retry when recovery context or a configured store is unreadable.
- Converge the default workspace and owned memory, knowledge, cron, ACP, and session state idempotently.
- Clear recovery state only after all followers converge.
- Ensure alias reuse cannot inherit stranded ownership.
Steps to reproduce
- On PR #9745 exact head
79ccf4cc714961ac6a818aa1e79363d99e13f6fc, configureagent_awith a default workspace and owned durable rows. - Inject a failure in a post-commit rename follower.
- Run
zeroclaw agents rename agent_a agent_b. - Observe that configuration commits
agent_bwhile old-alias residue remains. - Restore the failed dependency and rerun the CLI rename.
- Observe that the CLI reports
agent_ais not configured, while gateway/RPC has separate residue-recovery logic.
Impact
Affected users must repair durable ownership manually after a post-commit rename failure. Stranded attribution also creates risk if the retired alias is later reused.
Logs / stack traces
No secrets or personal data. The failure is reproduced with deterministic test fixtures.
ZeroClaw version
PR #9745 exact head 79ccf4cc714961ac6a818aa1e79363d99e13f6fc
Rust version
rustc 1.97.1
Operating system
macOS 26.5.1
Regression?
No, first-time setup
Pre-flight checks
- I reproduced this on the latest master branch or latest release. Not applicable: agent-rename ownership migration is introduced by PR #9745 and is not yet on
master. - I redacted secrets, tokens, and personal data from all submitted content.
Related: #10149
Source: zeroclaw-labs/zeroclaw