Repository navigation
feat: show the Gateway profile name and photo in Companion - #2013
Conversation
Read-only Gateway identity display: bounded GatewayRequestErrors codes, WorkspaceIdentitySource loading/unnamed/unavailable states, authenticated avatar transport with an end-to-end deadline (OPENCLAW_USER_AVATAR_TIMEOUT_MS) and supersession by profile invalidation, ordinary refreshes that coalesce and keep an unchanged avatar, native PersonPicture decode fence, localized copy, and an external Dashboard profile action. No profile writes or OS account reads. Co-authored-by: Copilot App <[email protected]>
Follow-up to the Gateway profile display, from the dual-model review of that commit. - Remember every settled avatar outcome per profile id and revision, so an absent, unauthorized or failed avatar is neither refetched nor re-reported on each presence refresh. A cancelled attempt is never remembered. - Treat any unexpected avatar exception as an optional-picture failure that keeps the profile, instead of clearing the name or faulting the refresh. - Settle a failed users.self read instead of retrying on a queued ordinary refresh, so the failure is classified, reported and ends loading. - Let an explicit invalidation abandon a stalled users.self read, fence its result and observe its late fault. - Name the users.self deadline and allow OPENCLAW_USER_SELF_TIMEOUT_MS to override it. - Refuse the "." and ".." profile ids and ids or revisions over 512 characters before any avatar request. - Use the Traditional Chinese term for a personal profile in zh-tw. - Document the unnamed state, the Dashboard action and the refresh semantics, and record the generic Owner label as a closed responsibility with a guard test. Co-authored-by: Copilot App <[email protected]>
An explicit profile invalidation owes one avatar refetch even when the profile id and revision are unchanged. That debt was cleared before the avatar attempt ran, so a cancelled attempt kept the old image but lost the refetch, and the next ordinary refresh did not retry. The debt now stays owed until an attempt resolves, matching the documented rule that an unresolved attempt is retried. Tests: - Add a regression for an unresolved explicit refetch: the image is kept, the next ordinary refresh retries once, and the debt is then consumed. - Make the superseded-read GC test prove the abandoned request task was actually collected (weak reference) and drop its sleep-based polling in favor of a bounded number of collection passes. Docs and comments: - ARCHITECTURE: the avatar request has one end-to-end deadline, while the users.self read waits for its response only after the request is sent; document that a failed users.self read forgets the remembered avatar outcome and that an unresolved attempt is retried by the next refresh. - Reword the avatar identifier guard comment so it no longer claims Uri.EscapeDataString throws for oversized input. Co-authored-by: Copilot App <[email protected]>
…mment Round-3 review of a7e514d0 found two low-severity gaps. The superseded-read GC test stopped as soon as a collection cleared the weak reference to the abandoned task. A collection that another test triggers can clear that reference and run only some finalizers, so the abandoned task's holder could still be queued when the assertion ran and a regression could pass. Drain the finalizer queue unconditionally after the loop, before asserting that no late SupersededReadFault was reported. The ReadSelfAsync summary said the client's own deadline still frees an abandoned read. That deadline starts only after the request is sent, so the comment contradicted the corrected architecture ledger. State only what the code guarantees: the read is abandoned, not cancelled, and its eventual fault is observed. No behavior change. Co-authored-by: Copilot App <[email protected]>
The Companion window now fetches the signed-in owner's photo with an authenticated HTTP GET to /api/users/<id>/avatar. The Gateway fixture only accepted WebSocket upgrades, so it rejected that request as INVALID_UPGRADE, closed the socket without a response and recorded an unexpected request. Every fixture-driven UI test asserts that no unexpected request happened at teardown, so each of them would fail as soon as the Workspace window opened against a profile that has an email address. Teach FixtureGatewayServer the one avatar route: - GET /api/users/<id>/avatar over HTTP/1.1 only. The query is ignored and never recorded, ids containing a slash are rejected, and anything else still falls through to the upgrade check and is still recorded as INVALID_UPGRADE. - The bearer is judged before the profile and must match the shared token or the issued device token (SHA-256, fixed-time compare), mirroring the product's shared-token-first interactive credential order. - The owner profile id gets an 8x8 PNG. A wrong credential (401) or an unknown profile (404) returns an empty body and is recorded as an unexpected request, so a regression still fails the teardown assertion. - Only the label http:users.avatar and the outcome are retained, never headers, tokens or profile ids. Add 16 protocol tests (nine mutations of the route were each killed by the predicted tests), extend the owner footer UI test to wait for the served photo and, in screenshot runs, to count photo-coloured pixels inside the footer button, and document the route. Co-authored-by: Copilot App <[email protected]>
Wait for the server journal to settle before asserting the outcome, since the HTTP client may finish reading first. 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 changesThis PR displays the authenticated Gateway profile name and photo in Companion’s shared Chat and Settings footer. Example: The Gateway returns profile fixture-owner, named Fixture Owner, without email or upload metadata.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored feature remains absent from main, and the current candidate resolves the earlier profile eligibility defect with no blocking correctness finding. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe connection-scoped identity source reads users.self and authenticated avatar bytes; WorkspaceWindow decodes the image and applies it to the shared native footer controls. flowchart LR
A[Authenticated Gateway] --> B[Operator client]
B --> C[Workspace identity source]
C --> D[Window bitmap cache]
D --> E[Chat footer]
D --> F[Settings footer]
Technical reviewBest possible solution: Retain the existing identity source, authenticated media transport, and shared footer ownership, with the Gateway resolving every valid profile’s photo. Do we have a high-confidence way to reproduce the issue? This is a feature addition; main’s missing avatar path is source-verifiable, and current-head native captures demonstrate the resulting display. Is this the best way to solve the issue? The implementation uses the existing connection and presentation owners, preserves initials when photos fail, and leaves photo-source selection with the Gateway. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 47961738c9a9. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
LabelsLabel changes: No label 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 HistoryReviewed November 4, 2026, 7:42 PM ET / November 5, 2026, 00:42 UTC (Revision 3). |
Use Shared owner for the shared Gateway profile and Owner when no profile is known. Resolve every valid profile avatar through the Gateway and remove profile-status and setup-menu states. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Integrate the shared Chat and Settings footer without restoring inline controls or losing the decoded profile photo. Remove two helper-shape tests called out in review; retain lifecycle, diagnostics-category and native image proof. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
|
Production avatar authorization proof for this PR, executed independently of the synthetic Windows rendering fixture. Source: Command: Executed result: exit 0, 1 test file passed, 20/20 tests passed, 234.93 seconds including compilation. Process-only isolated state/config roots; no installed Gateway, real account, production credentials, or shared runtime was used.
Selected executed test names and runner result (checkmarks normalized to PASS): The PASS prefix above normalizes the runner's checkmark glyph; test wording is otherwise retained apart from a typographic apostrophe. Full retained local transcript SHA256: Limits: This is the upstream production handler/authorization/pairing-store integration harness, not a live installed Gateway or real GitHub account. Image preparation and remote fetch are controlled to deterministically pause disclosure; authorization and revocation are not mocked. The Windows fixture separately proves client transport and native rendering, not grants. |
|
Current-head native proof at Passed: all three The attached complete owned-window captures show:
The green disk is the fixture's deterministic PNG, deliberately distinguishable from initials. Native pixel assertions require its known RGB inside the owner's button, not elsewhere in the window. These are synthetic data captures from the real WinUI app, not real user accounts or production Gateway authorization proof. Production authorization proof is separate. Commands after current-head build: dotnet test tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj -c Debug -r win-x64 --no-build --no-restore --filter "FullyQualifiedName~GatewayFixtureUiTests.OwnerFooter"
dotnet test tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj -c Debug -r win-x64 --no-build --no-restore --filter "FullyQualifiedName~WorkspaceWindowProofTests.AgentSelector_UsesConfiguredIdentityPictureNameAndId"Both used the task-owned isolation/desktop-idle wrapper with screenshot opt-ins. The wrapper pins clean HEAD/tree, records loaded-binary hashes, and hashes all artifacts. |
|
@clawsweeper re-review Current head: 62be3e8. Merged main 4796173 and resolved the shared-footer integration. The GitHub-only eligibility defect is fixed: every valid profile ID requests the Gateway avatar route. Current-head build, Shared/Tray/Connection/CLI suites and five native cases passed. The PR body now includes inspectable Chat/Settings/Shared-owner captures and executed upstream production allowed-reader, denied-scope and revoked-pending-read traces (20/20 passed). No live account or installed Gateway proof is claimed. |
|
🦞👀 Re-review progress:
|



What Problem This Solves
Companion needs to show the authenticated Gateway profile photo alongside its name in Chat and Settings.
User Impact
User impact: users see their Gateway profile name and photo in the shared Chat and Settings footer. A missing photo retains initials; a missing profile retains Owner. Shared Gateway owners show Shared owner.
No Windows-account lookup, profile write, completion dialog, migration, profile-setup action, or new node/MCP capability is included. The existing external Dashboard action and its authentication launcher are unchanged.
Why This Change Was Made
The existing identity source owns read-only profile state and invalidation. Ordinary presence events coalesce and reuse settled avatar outcomes; explicit profile changes supersede pending work and fence stale results. Optional avatar errors do not erase a valid name.
Avatar requests use the current authenticated media lease, fixed Gateway host, header authentication, no redirects, a 1 MB limit, a raster-only MIME allowlist, and one configurable headers/body deadline. The synthetic Gateway fixture now serves that same route rather than rejecting it as a WebSocket upgrade.
Every valid profile ID is eligible for the Gateway avatar route, including GitHub-only profiles without email or upload metadata. The Gateway owns photo-source resolution. The latest-main merge keeps the shared footer introduced by main; the window owns decode/cache and applies the same bitmap when Settings is created later.
Evidence
Draft PR. Current-head build and managed suites passed, plus 3/3 owner-footer native cases and 2/2 Light/Dark workspace cases. Inspectable current-head native captures show the Gateway-served photo in Chat and later-created Settings, including a profile without email or upload metadata, plus Shared owner.
Executed production authorization traces: 20/20 passed cover allowed readers, denied scopes, and revocation during pending uploaded/GitHub image preparation. This is the unchanged upstream production handler/authorization/pairing-store integration harness, not a live installed Gateway or real account.
The solid green photo is the fixture's deterministic PNG, not a real person's image. The test asserts its known RGB inside the native owner button.
The original ClawSweeper review covered
0fb8b3f3, not the current candidate. Its supported-profile defect was fixed inde4f13ee: all valid profile IDs now request the bounded Gateway route. The no-email/no-upload fixture case exercises that input through the real client and native rendering. Low-value helper-shape tests identified by the review were removed; behavioral logging and lifecycle coverage remain.Change Type
Scope
winnodeRequired proof pools
windows-winui-interactive: native footer name/photo, shared-owner label, Settings footer bitmap reuse, and identity selection. Focused synthetic-fixture proof is reported below; complete pool acceptance and live installed Gateway profile proof are not claimed.Validation
Candidate:
62be3e88ac5403b84738c2ee1790ca860ca77a35, tree16c88e8733e9801a3fbfadb4d919f35cf8423225, including main47961738c9a93d6e13e443baa5b01811e6612441.Final-tree closeout passed. Logs and fresh TRX:
rating-validation-final. The process-only wrapper clears inheritedOPENCLAW_*, sets three isolated roots and the worktree repository root, and leaves the legacy local-data alias unset. HEAD/tree and clean status were unchanged before and after; normal AppData and LocalAppData metadata manifests were unchanged.pwsh -NoProfile -ExecutionPolicy Bypass -File .\build.ps1dotnet test tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --blame-hang --blame-hang-timeout 300s --blame-hang-dump-type none --results-directory <logdir>\results-shared --logger "trx;LogFileName=shared.trx" --verbosity minimalOPENCLAW_RUN_INTEGRATION=1for this step onlydotnet test tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --blame-hang --blame-hang-timeout 300s --blame-hang-dump-type none --results-directory <logdir>\results-tray --logger "trx;LogFileName=tray.trx" --verbosity minimaldotnet test tests\OpenClaw.Connection.Tests\OpenClaw.Connection.Tests.csproj --blame-hang --blame-hang-timeout 300s --blame-hang-dump-type none --results-directory <logdir>\results-connection --logger "trx;LogFileName=connection.trx" --verbosity minimaldotnet test tests\OpenClaw.WinNode.Cli.Tests\OpenClaw.WinNode.Cli.Tests.csproj --blame-hang --blame-hang-timeout 300s --blame-hang-dump-type none --results-directory <logdir>\results-winnode --logger "trx;LogFileName=winnode.trx" --verbosity minimalpwsh -NoProfile -ExecutionPolicy Bypass -File .\scripts\validate-docs.ps1git diff --check origin/main..HEADnode scripts\run-vitest.mjs run --config test\vitest\vitest.gateway.config.ts src\gateway\user-profiles-http.auth.test.ts --reporter=verbose064b2915checkout: 20/20 passed, 234.93sdotnet test tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj -c Debug -r win-x64 --no-build --no-restore --filter "FullyQualifiedName~GatewayFixtureUiTests.OwnerFooter"dotnet test tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj -c Debug -r win-x64 --no-build --no-restore --filter "FullyQualifiedName~WorkspaceWindowProofTests.AgentSelector_UsesConfiguredIdentityPictureNameAndId"<logdir>is the absolute sessionfiles\rating-validation-finaldirectory. Tests ran with restoration enabled rather than--no-restore; fresh TRX reports confirm nonzero execution. Gated cases are not claimed as native acceptance.The merge candidate
7db93ca6also passed the full closeout. The final candidate adds only a native fixture regression for a Settings footer created after the photo is loaded; the full closeout above was rerun rather than inheriting those counts.Real Behavior Proof
62be3e88ac5403b84738c2ee1790ca860ca77a35, tree16c88e8733e9801a3fbfadb4d919f35cf8423225.dotnet restore tests\OpenClaw.Tray.UITests -r win-x64anddotnet build tests\OpenClaw.Tray.UITests -c Debug -r win-x64 --no-restore -nologo -v:minimal; isolated wrapper with screenshot opt-ins, clean HEAD/tree pins and a 20-second desktop-idle gate.E6792BC67F95F0C3C86DD6042A3C4DD9F855341073C3247AA57897A8720404D0; Settings PNG SHA256F3C930ECBD5AF49CB9B37C3C4C80818CFEE3DCE4827DA10CD4B9C8806735E5F5. Loaded app DLL SHA2565F1AF321BC3B857DD155BCF80785BDFB3E35D98A0BC89950D9E5DC624D145744.Yes/No/N/A): Yes. Exact published evidence comment contains all three canonical asset URLs; Chat and Settings are embedded above.Security Impact
Yes/No): No.Yes/No): Yes, existing media authentication is reused for the new avatar read; no token is placed in its URL.Yes/No): Yes, authenticatedusers.selfand same-Gateway avatar HTTP reads.Yes/No): No.Yes/No): Yes, read-only authenticated Gateway profile display.Yes, explain the risk and mitigation: fixed lease host, no redirects, bounded raster payload and deadline, generation fences, and category/type-only diagnostics. The existing external Dashboard launcher remains unchanged.Compatibility and Migration
Yes/No): Yes. Unsupported/missing profiles retain Owner and missing avatars retain initials; the default avatar interface implementation returns Unsupported.Yes/No): Yes. Optional positive millisecond overrides:OPENCLAW_USER_AVATAR_TIMEOUT_MS(15000 default) andOPENCLAW_USER_SELF_TIMEOUT_MS(12000 response wait after send).Yes/No): No.Review Conversations
ClawSweeper's P2 supported-profile finding is fixed in
de4f13ee, with a no-email/no-upload client regression and native fixture coverage. Its proof request is addressed above, without treating fixture token matching as production authorization.An independent
rubber-duckreview inspected merge7db93ca6against both parents and found no production bugs in the shared-footer integration, stale-decode fence, image clearing, or later-created Settings footer initialization. Its native-proof suggestion is covered by the final Settings-footer regression. Its suggestion to restore the removed helper-shape tests was declined: those tests pin helper wording/predicates, while behavioral logging and lifecycle tests remain.Historical local Hanselman review used
claude-opus-5.5andgpt-6-astraon0fb8b3f3; both final delta reviews accepted the bounded journal wait with no new findings. That earlier verdict is not a new dual-model review of the merge. The merge review and all source reviews are static evidence, not native runtime or authorization proof.