Repository navigation
fix(ui): stop inferring session sharing identity kind from ID strings - #124257
Conversation
Remove the ID-string channel heuristic in the chat sharing menu. Sharing identities are typed human/agent/system by the Gateway protocol; there is no channel identity kind, so a human profile whose ID happened to contain "channel:" was misrendered with the channel glyph instead of the owner chip. Presentation now branches on identity.type only.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 5:09 PM ET / 21:09 UTC. ClawSweeper reviewWhat this changesThe PR makes the chat session-sharing menu choose its human owner chip or non-human icon from the Gateway identity type instead of substrings in an identity ID. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessNo blocking findings. The patch removes a source-proven presentation heuristic in favor of the Gateway’s typed identity contract, and it addresses both prior review rank-up moves; keep this maintainer-associated PR open only for normal exact-head CI completion and merge review. Priority: P3 Review scores
Verification
How this fits togetherThe Control UI loads selectable session identities from the Gateway when an operator opens the chat sharing menu. The menu turns each typed identity into a visible member row while preserving existing membership and authorization behavior. flowchart LR
A[Gateway identity records] --> B[Session members request]
B --> C[Chat sharing menu]
C --> D{Recorded identity type}
D -->|Human| E[Owner chip]
D -->|Agent or system| F[Non-human icon]
E --> G[Visible member row]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource -24, Tests +11. Total -13 across 4 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep member presentation derived exclusively from the typed Gateway identity record and land this small deletion-based repair after the remaining exact-head checks complete. Do we have a high-confidence way to reproduce the issue? Yes—current main’s helper classifies IDs containing channel: before identity.type, and the updated focused test fixture exercises that exact path; this read-only review did not execute the test locally. Is this the best way to solve the issue? Yes—the Gateway already supplies a closed identity type, so deleting the UI-only spelling heuristic is the narrow canonical repair; adding a channel field or retaining a fallback would create a competing source of truth. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against db0d133ec952. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
ClawSweeper flagged the comment on the channel-shaped human ID case: it implied channel-shaped IDs are canonical for human profiles, but durable profile IDs are generated UUIDs. The real supported path is an opaque human identity ID (e.g. an inbound SenderId) that can happen to contain "channel:" as a substring.
|
Merged via squash.
|
…openclaw#124257) * fix(ui): drive session sharing icon from identity type Remove the ID-string channel heuristic in the chat sharing menu. Sharing identities are typed human/agent/system by the Gateway protocol; there is no channel identity kind, so a human profile whose ID happened to contain "channel:" was misrendered with the channel glyph instead of the owner chip. Presentation now branches on identity.type only. * test(ui): describe the sharing fixture ID as opaque, not canonical ClawSweeper flagged the comment on the channel-shaped human ID case: it implied channel-shaped IDs are canonical for human profiles, but durable profile IDs are generated UUIDs. The real supported path is an opaque human identity ID (e.g. an inbound SenderId) that can happen to contain "channel:" as a substring.
Fixes #124234
What Problem This Solves
Resolves a problem where the chat sharing menu misrendered a human member as a channel whenever their identity ID happened to contain the substring
channel:. A profile ID likechannel:chn_designordiscord:channel:operationstriggered the channel glyph instead of the person's owner chip, even though the Gateway recorded the member as a human.Why This Change Was Made
The sharing menu classified members with an ID-string heuristic (
isChannelIdentity) before ever looking at the identity's actual type. The Gateway sharing protocol only defineshuman,agent, andsystemidentity types — there is no channel identity kind for the UI to infer, so any ID-shaped guess was necessarily wrong for some inputs. The fix removes the heuristic entirely and renders presentation fromidentity.typedirectly: human identities get the owner chip, agent and system identities get the existing non-human icon. No protocol or authorization behavior changes.User Impact
Members with channel-like profile IDs are now shown correctly as people in the sharing menu, using their real owner chip. There is no other behavior change; the sharing menu's compact layout and scrolling are unaffected.
Evidence
Focused component test (rewritten to assert on
identity.typerather than ID spelling, including a human identity with achannel:-shaped ID) run viaLC_ALL=en_US.UTF-8 node scripts/run-vitest.mjs ui/src/pages/chat/components/chat-session-sharing.test.ts:The rewritten regression case was verified to fail on pre-fix code (
expected null not to be nullon the human-with-channel-shaped-ID assertion) before the fix was applied, then confirmed passing after.node scripts/check-changed.mjs -- ui/src/pages/chat/components/chat-session-sharing.ts ui/src/pages/chat/components/chat-session-sharing.test.ts ui/src/e2e/session-ownership.e2e.test.ts ui/src/styles/chat/split-view.csspassed end to end (formatting, lint, dead-export scan, i18n catalog, and UI/core typecheck), exit code 0.Pre-commit review reported no accepted or actionable findings.
Control UI proof (built mock, real
renderChatSessionSharing): the sharing menu's Members list renders two human identities with the owner chip — includingchannel:chn_design, a human ID that contains thechannel:substring — while the agent and system identities (discord:channel:operations,channel:audit) render the non-human icon, all driven purely byidentity.type.LC_ALL=en_US.UTF-8 node scripts/run-vitest.mjs ui/src/pages/chat/components/chat-session-sharing.test.ts— 9 passed after correcting the test comment (per review) to describe the fixture ID as opaque rather than a canonical human-profile shape.node scripts/check-changed.mjs -- ui/src/pages/chat/components/chat-session-sharing.test.ts— delegated Testbox run (tbx_01m03k7563z55v99k7yw7z10zd) passed formatting, lint, dead-export scan, i18n catalog, and core-test typecheck, exit code 0.Autoreview (
--mode uncommitted, Codex/gpt-5.6-sol): clean, no accepted/actionable findings.