Skip to content

fix: refresh Windows agent names after Gateway identity changes - #2277

Merged
bkudiess merged 1 commit into
openclaw:mainfrom
bkudiess:bkudiess-agent-identity-refresh
Nov 17, 2026
Merged

bkudiess merged 1 commit into
openclaw:mainfrom
bkudiess:bkudiess-agent-identity-refresh

Conversation

@bkudiess

Copy link
Copy Markdown
Collaborator

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.changed and config.changed as invalidation hints and coalesces them into agents.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.list support is unavailable. The real tray-to-Gateway rename path was not exercised; see Real Behavior Proof.

Change Type

  • Bug fix
  • Feature
  • Refactor
  • Docs or instructions
  • Tests or validation
  • Security hardening
  • Chore or infrastructure

Scope

  • Tray or WinUI UX
  • Windows node capability
  • Local MCP or winnode
  • Gateway, connection, or pairing
  • Setup or onboarding
  • Permissions, privacy, or security
  • Tests, CI, or docs

Required 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

  • Environment tested: Windows ARM64 development host; managed loopback WebSocket Gateway client tests.
  • PR head or commit tested: cf95d02; tests ran on this exact source tree immediately before commit.
  • Exact steps or command run: dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --filter "FullyQualifiedName~AgentRosterRefresh".
  • Evidence after fix: 4 focused tests passed. They observe outgoing agents.list requests and verify the guard cases.
  • Observed result: Gateway event refresh scheduling is verified at the Shared client boundary. Tray rendering and live Gateway delivery are not verified.
  • Screenshot or artifact links verified? (Yes/No/N/A): N/A.
  • Not verified or blocked: No live Gateway rename or current-head UI proof was run. The assistant self-rename path may not emit agent.identity.changed; that upstream producer gap is outside this PR.

Security Impact

  • New permissions or capabilities? (Yes/No): No.
  • Secrets or tokens handling changed? (Yes/No): No.
  • New or changed network calls? (Yes/No): Yes. The client sends the existing read-only agents.list request after Gateway invalidation events; it is connection-generation and read-scope guarded.
  • Command or tool execution surface changed? (Yes/No): No.
  • Data access scope changed? (Yes/No): No; it uses the existing operator read scope.
  • If any answer is 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

  • Backward compatible? (Yes/No): Yes. Existing unsupported-method handling remains in place.
  • Config or environment changes? (Yes/No): No.
  • Migration needed? (Yes/No): No.
  • If yes, list the exact upgrade steps: N/A.

Review Conversations

  • No GitHub review conversations exist yet. A two-model Hanselman review found no implementation correctness issue; identified event-coalescing and guard test gaps were addressed. Stale-generation and disposal coverage remain unverified.
  • I replied to or resolved every bot review conversation addressed by this PR.
  • I left unresolved only conversations that still need maintainer judgment.

@clawsweeper

clawsweeper Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@bkudiess
bkudiess marked this pull request as ready for review November 17, 2026 21:52
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 17, 2026
@clawsweeper

clawsweeper Bot commented Nov 17, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge.

What this changes

Refresh 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.

  • Before: Companion can retain Assistant until reconnecting.
  • After: Companion requests the roster again and resolves Atlas through its existing identity loader.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused implementation has no identified correctness defect, but test-only evidence does not satisfy the required real-behavior gate.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Companion can display an outdated agent name or avatar after the Gateway announces a change.
Reason: The maintainer-authored direction repairs existing identity presentation using supported events; rename paths emitting no event are explicitly outside its stated scope.

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
Reviewed head: cf95d02b3947d0af556571b5d865270bbb159e27

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Show a current-head Companion name/avatar update after a real Gateway identity notification without reconnecting, using screenshots or redacted runtime output; intended base-failure/head-pass execution was not supplied.
Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Event refresh scheduling keeps the original intent (f388c01: Coalesce session-event bursts while bounding freshness and retaining a trailing refresh during sending.)
  • Agent identity hydration keeps the original intent (feat: show Gateway agent names and avatars across the Windows app #2044: Show Gateway-resolved agent names and avatars across native views through roster-first presentation and per-agent identity resolution.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Dallin Romney: Raw commit f388c01 adds src/OpenClaw.Shared/OpenClawGatewayClient.cs:4545 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: f388c013390a; files: src/OpenClaw.Shared/OpenClawGatewayClient.cs)

Preflight source

Source 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

Metric Value Why it matters
Patch size Production +80/-0; tests +133/-0 Growth stays within the existing client and test suite, covering notification coalescing, disconnect cancellation, trailing refresh, and dispatch guards.

Labels

Label changes:

  • add P2: Stale agent presentation has limited impact and currently recovers through reconnecting.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Stale agent presentation has limited impact and currently recovers through reconnecting.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 17, 2026, 5:06 PM ET / 22:06 UTC.

@bkudiess
bkudiess merged commit 1af2586 into openclaw:main Nov 17, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant