Repository navigation
fix: refresh Windows agent names after Gateway identity changes - #2277
Conversation
Co-authored-by: Copilot App <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesRefresh agent names and avatars after Gateway identity or configuration notifications. Example: The Gateway changes agent main's name from Assistant to Atlas and broadcasts agent.identity.changed.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR addresses a source-confirmed refresh gap on main, and no concrete implementation defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Shared Gateway client receives authenticated WebSocket events and publishes roster responses to GatewayService, which resolves identities into AppState for native presentation. flowchart LR
A[Gateway identity change] --> B[WebSocket notification]
B --> C[Shared client refresh scheduler]
C --> D[agents.list request]
D --> E[GatewayService identity loader]
E --> F[AppState and native views]
Technical reviewBest possible solution: Keep event invalidation in the existing Gateway client and retain GatewayService as the sole identity-hydration owner. Do we have a high-confidence way to reproduce the issue? Source establishes the path: Gateway identity notifications reach a main-branch event handler that does not refresh agents; no runtime reproduction was performed in this read-only review. Is this the best way to solve the issue? The change is appropriately scoped: it follows the existing fixed-window refresh pattern, preserves connection and read guards, and reaches the authoritative identity loader without adding a competing cache. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a0a2a24ec1dd. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 17, 2026, 5:06 PM ET / 22:06 UTC. |
What Problem This Solves
When the Gateway reports an agent identity or configuration change, Windows Companion could keep showing the old agent name until it reconnected. The web UI already refreshes after these events, but the Windows Gateway client ignored them.
User Impact
User impact: Companion refreshes agent names and avatars after supported Gateway identity/configuration notifications. A self-rename path that emits no Gateway event still requires a reconnect or an upstream event fix.
Why This Change Was Made
The client now treats
agent.identity.changedandconfig.changedas invalidation hints and coalesces them intoagents.list. The existing tray service continues to resolve authoritative per-agent identity, while the refresh remains tied to the current connection and respects read-scope and unsupported-method guards.Evidence
Loopback Gateway client tests verify event coalescing, a trailing refresh for an event received during an in-flight request, and suppression when read access or
agents.listsupport is unavailable. The real tray-to-Gateway rename path was not exercised; see Real Behavior Proof.Change Type
Scope
winnodeRequired proof pools
none: No capacity-dependent Windows proof pool is required for this shared-client event refresh. Live Gateway behavior remains not verified below.Validation
The full build and both required test suites passed on the candidate working tree. The focused roster-refresh selection also passed. The inherited PATH exceeded 9,000 characters and caused child cmd.exe processes to fail resolving tools; successful reruns used a shortened PATH including .NET and PowerShell.
./build.ps1- passed.dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj- passed, 5,906 passed, 29 skipped, 5,935 total.dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj- passed, 6,755 passed, 0 skipped.dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --filter "FullyQualifiedName~AgentRosterRefresh"- passed, 4 passed.git diff --check- passed.Real Behavior Proof
dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --filter "FullyQualifiedName~AgentRosterRefresh".agents.listrequests and verify the guard cases.Yes/No/N/A): N/A.agent.identity.changed; that upstream producer gap is outside this PR.Security Impact
Yes/No): No.Yes/No): No.Yes/No): Yes. The client sends the existing read-onlyagents.listrequest after Gateway invalidation events; it is connection-generation and read-scope guarded.Yes/No): No.Yes/No): No; it uses the existing operator read scope.Yes, explain the risk and mitigation: The added call only refreshes the existing agent roster and is coalesced, suppressed when unsupported or read scope is unavailable, and tied to the event connection generation.Compatibility and Migration
Yes/No): Yes. Existing unsupported-method handling remains in place.Yes/No): No.Yes/No): No.Review Conversations