Skip to content

fix(ui): stop inferring session sharing identity kind from ID strings - #124257

Merged
vyctorbrzezowski merged 2 commits into
mainfrom
brzezowski/sharing-identity-kind
Aug 15, 2026
Merged

vyctorbrzezowski merged 2 commits into
mainfrom
brzezowski/sharing-identity-kind

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Aug 15, 2026 •

Copy link
Copy Markdown
Member

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 like channel:chn_design or discord:channel:operations triggered 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 defines human, agent, and system identity 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 from identity.type directly: 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.type rather than ID spelling, including a human identity with a channel:-shaped ID) run via LC_ALL=en_US.UTF-8 node scripts/run-vitest.mjs ui/src/pages/chat/components/chat-session-sharing.test.ts:

 Test Files  1 passed (1)
      Tests  9 passed (9)

The rewritten regression case was verified to fail on pre-fix code (expected null not to be null on 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.css passed 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 — including channel:chn_design, a human ID that contains the channel: substring — while the agent and system identities (discord:channel:operations, channel:audit) render the non-human icon, all driven purely by identity.type.

Control UI: human identities with channel-shaped IDs get the owner chip; agent/system get the non-human icon

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.

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.
@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Aug 15, 2026
@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review August 15, 2026 19:31
@vyctorbrzezowski vyctorbrzezowski self-assigned this Aug 15, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 15, 2026
@clawsweeper

clawsweeper Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 5:09 PM ET / 21:09 UTC.

ClawSweeper review

What this changes

The 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 provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

No 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
Reviewed head: bb3b1f9c1e53b7935a068258098cd2e98fd5b11f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, deletion-oriented repair with direct UI proof and regression coverage; no remaining patch defect was found.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): The PR provides an after-fix built-Control-UI screenshot directly showing the corrected typed identity presentation, alongside focused pre-fix/post-fix regression evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The PR provides an after-fix built-Control-UI screenshot directly showing the corrected typed identity presentation, alongside focused pre-fix/post-fix regression evidence.
Evidence reviewed 7 items Current defect: Current main uses an ID-prefix/substring heuristic before considering the recorded type, so a human identity with a channel-shaped ID is rendered with the channel glyph.
Protocol contract: A selectable sharing identity is a created actor with a required opaque ID; created-actor type is closed to human, agent, and system, with no channel variant.
Gateway producer: The Gateway carries created-actor type into known selectable identities and stamps stored profiles as human, making identity.type the authoritative presentation fact.
Findings None None.
Security None None.

How this fits together

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

Before merge

  • Complete next step (P2) - This actively assigned maintainer PR already owns the repair and needs ordinary exact-head CI completion and merge review, not a separate repair job.
Agent review details

Security

None.

PR surface

Source -24, Tests +11. Total -13 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 4 28 -24
Tests 2 24 13 +11
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 28 41 -13

Review metrics

Metric Value Why it matters
Production versus test LOC production +4/-28 (net -24); tests +24/-13 (net +11) The bug fix deletes the heuristic and its channel-only styling while adding focused typed-identity regression coverage.

Stored data model

Persistent data-model change detected: serialized state: ui/src/e2e/session-ownership.e2e.test.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR provides an after-fix built-Control-UI screenshot directly showing the corrected typed identity presentation, alongside focused pre-fix/post-fix regression evidence.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR provides an after-fix built-Control-UI screenshot directly showing the corrected typed identity presentation, alongside focused pre-fix/post-fix regression evidence.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The PR provides an after-fix built-Control-UI screenshot directly showing the corrected typed identity presentation, alongside focused pre-fix/post-fix regression evidence.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: This corrects a low-blast-radius Control UI presentation error without changing sharing authorization or protocol behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The PR provides an after-fix built-Control-UI screenshot directly showing the corrected typed identity presentation, alongside focused pre-fix/post-fix regression evidence.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR provides an after-fix built-Control-UI screenshot directly showing the corrected typed identity presentation, alongside focused pre-fix/post-fix regression evidence.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR provides an after-fix built-Control-UI screenshot directly showing the corrected typed identity presentation, alongside focused pre-fix/post-fix regression evidence.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Blame attributes the current ID-string helper to the commit that added this UI path. (role: introduced the current heuristic; confidence: high; commits: 0134c781cd1f; files: ui/src/pages/chat/components/chat-session-sharing.ts)
  • vyctorbrzezowski: Earlier merged work on the compact sharing menu and related chat-header behavior precedes this PR. (role: recent session-sharing contributor; confidence: high; commits: bbb5164ec96d, 2a1eba771342; files: ui/src/pages/chat/components/chat-session-sharing.ts, ui/src/e2e/session-ownership.e2e.test.ts)
  • steipete: Recent main history includes the underlying visibility and membership feature work and subsequent chat-sharing maintenance. (role: recent session-sharing and Control UI contributor; confidence: high; commits: 62513433846f, 3eca723733d3; files: src/gateway/server-methods/sessions-sharing.ts, ui/src/pages/chat/components/chat-session-sharing.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-15T20:07:20.947Z sha 531d9da :: found issues before merge. :: [P2] Capture Control UI proof for the changed rendering | [P3] Describe the fixture as an opaque identity ID

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.
@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 15, 2026
@vyctorbrzezowski
vyctorbrzezowski merged commit 8a3fff2 into main Aug 15, 2026
327 of 330 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the brzezowski/sharing-identity-kind branch August 15, 2026 22:34
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 16, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

Stop inferring session-sharing identity kind from ID strings

1 participant