Skip to content

fix(ui): keep selected-agent collaboration on the right session - #133134

Merged
vincentkoc merged 1 commit into
mainfrom
fix/ui-collaboration-session-ownership
Aug 30, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/ui-collaboration-session-ownership

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 30, 2026 •

Copy link
Copy Markdown
Member

Related: #133132

What Problem This Solves

Fixes an issue where suggestions and typing state for a selected global agent could silently stop working because collaboration paths re-resolved the raw global key instead of using the owner-validated selected session.

Why This Change Was Made

Suggestions, received typing state, and outgoing typing requests now use the canonical selected-session owner check. Existing wrong-agent guards remain intact.

User Impact

After switching a global chat to another agent, suggestions and typing indicators remain bound to the selected agent's actual session.

Evidence

  • Four intended regressions reproduced before the fix.
  • Focused collaboration tests: 36/36 passing.
  • Independent review verification: 93 tests passing.
  • pnpm tsgo:ui, full changed-file gate, format, lint, and diff checks pass.
  • Production LOC: +4/-10 (net -6).

Visual Proof

An isolated mock-Gateway browser run selected Work on a global route and verified:

  • Suggestion request: agent:work:main, agent work.
  • Outgoing typing: agent:work:main, session session-work-global, agent work.
  • Work-owned suggestion and received typing preview visible in the Control UI.

Command: pnpm exec tsx .artifacts/control-ui-e2e/selected-agent-collaboration/record-proof.ts

Capture: three 1280x900 screenshots and a 3.44s video. The artifacts contain only synthetic data. Browser attachment is unavailable in this session, so the sanitized captures are retained locally and identified by SHA-256:

  • Suggestion: 075e36fb25216b6c942949f12148011471176f8c30814a4b49d02003390a8c13
  • Typing + suggestion: 2fd51fcb022b6dbf62b01624e599bb722343c2f37fc0063ba096945e507ab452
  • Final state: dddcbbb15197394ac72bc6c82e464f2e9734bfe39279aae6705274bb4860a904
  • Video: ca46310f36c9e7b8151c7e7e038010834a18032ba2aef6b861a927ac4410d611

@vincentkoc vincentkoc self-assigned this Aug 30, 2026
@clawsweeper

clawsweeper Bot commented Aug 30, 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 30, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. 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. labels Aug 30, 2026
@clawsweeper

clawsweeper Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 3:31 AM ET / 07:31 UTC.

ClawSweeper review

What this changes

The PR makes suggestion loading and incoming/outgoing typing use the validated selected session row when a global chat is switched to another agent.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open for maintainer review: this is a focused, source-supported repair for a silent selected-global collaboration failure, and the protected maintainer label prevents automated cleanup.

Priority: P1
Reviewed head: cd4f47f219a64d5fac3cb525785fddcd044ede77
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative production repair with credible selected-global regressions; human UI validation remains useful because the referenced capture is unavailable here.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored PR is exempt from the ordinary external-contributor proof gate; its body reports a mock-Gateway browser run, but the stated local-only captures were unavailable for independent inspection in this review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR is exempt from the ordinary external-contributor proof gate; its body reports a mock-Gateway browser run, but the stated local-only captures were unavailable for independent inspection in this review.
Evidence reviewed 6 items Current-main failure path: Current main uses raw key-equivalence lookups before suggestions and typing; a selected agent:work:main route cannot match its returned raw global row, causing these paths to return without action.
Canonical owner boundary: The existing resolver recognizes a global row for a selected agent alias and rejects rows from a differently scoped session result, so reusing it preserves the established ownership check.
Gateway contract: Suggestion and typing handlers resolve the request through both session key and agent ID, then typing emits the canonical session key with that resolved agent ID.
Findings None None.
Security None None.

How this fits together

The Control UI resolves a route and selected agent to a validated session row, then uses that row for collaboration suggestions and typing state. The Gateway validates the requested agent/session before listing suggestions or broadcasting typing events.

flowchart LR
A[Global chat route] --> B[Selected agent]
B --> C[Validated selected session]
C --> D[Suggestion request]
C --> E[Typing state]
D --> F[Control UI collaboration]
E --> F
Loading

Decision needed

Question Recommendation
Should this protected maintainer PR proceed after a selected-global Control UI validation confirms Work-owned suggestions and typing stay separate from Main? Validate and proceed: Verify the selected Work global route receives and sends collaboration state against the Work session, then accept this focused repair.

Why: The patch is narrowly correct by source inspection, but the maintainer label requires explicit human handling and the supplied local-only UI captures cannot be inspected here.

Before merge

  • Resolve merge risk (P1) - The PR body describes a synthetic browser capture, but the screenshots and video are not available in the supplied scratch directory for independent inspection; maintainer validation should exercise a selected Work global route.
  • Resolve merge risk (P1) - Four hydrated PR comments were omitted from the supplied context and live GitHub reads were unavailable, so this review cannot assess any discussion beyond the supplied prior-review summary.
  • Complete next step (P2) - The member-authored PR carries the protected maintainer label, so it needs normal human validation rather than a ClawSweeper repair job.
Agent review details

Security

None.

PR surface

Source -6, Tests +57. Total +51 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 4 10 -6
Tests 2 61 4 +57
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 65 14 +51

Review metrics

Metric Value Why it matters
Production versus tests production +4/-10 (net -6); tests +61/-4 (net +57) The repair removes three duplicated raw session-row lookups while adding focused selected-global regressions.

Root-cause cluster

Relationship: partial_overlap
Canonical: #133132
Summary: This PR implements the suggestions-and-typing repair track of the wider selected-session ownership issue; other reported UI consumers remain outside this diff.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Mantis proof suggestion

A redacted Control UI chat proof would directly validate the selected-global collaboration behavior that cannot be confirmed from the unavailable local captures. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis verify the web UI chat shows a Work-selected global session's suggestion and incoming typing state without falling back to Main; return redacted evidence.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the single canonical selected-session resolver as the collaboration owner boundary, then confirm suggestions and both typing directions on the exact PR head before merge.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the single canonical selected-session resolver as the collaboration owner boundary, then confirm suggestions and both typing directions on the exact PR head before merge.

Do we have a high-confidence way to reproduce the issue?

Yes, by constructing global-scope state with sessionKey agent:work:main, selected agent Work, and a returned global row; current-main raw lookup lines then fail to find the row. This read-only review did not execute that scenario.

Is this the best way to solve the issue?

Yes. Reusing the existing selected-session resolver is the narrowest maintainable fix because it retains its agent-result and observer-digest ownership validation instead of creating another global-key exception.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against ef8fc680fe28.

Labels

Label justifications:

  • P1: Switching agents on a global chat can silently suppress collaboration suggestions and typing on an ordinary Control UI workflow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored PR is exempt from the ordinary external-contributor proof gate; its body reports a mock-Gateway browser run, but the stated local-only captures were unavailable for independent inspection in this review.

Evidence

What I checked:

Likely related people:

  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vyctor H. Brzezowski: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Validate the selected Work global route with a real Control UI session, covering suggestion loading plus incoming and outgoing typing.

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-30T07:06:21.186Z sha cd4f47f :: needs maintainer review before merge. :: none

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vincentkoc
vincentkoc marked this pull request as ready for review August 30, 2026 07:42
@vincentkoc
vincentkoc merged commit c04bee4 into main Aug 30, 2026
79 checks passed
@vincentkoc
vincentkoc deleted the fix/ui-collaboration-session-ownership branch August 30, 2026 07:42
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 31, 2026
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 P1 High-priority user-facing bug, regression, or broken workflow. 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.

1 participant