Repository navigation
fix(ui): keep selected-agent collaboration on the right session - #133134
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 3:31 AM ET / 07:31 UTC. ClawSweeper reviewWhat this changesThe PR makes suggestion loading and incoming/outgoing typing use the validated selected session row when a global chat is switched to another agent. Merge readinessKeep 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 Review scores
Verification
How this fits togetherThe 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
Decision needed
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
Agent review detailsSecurityNone. PR surfaceSource -6, Tests +57. Total +51 across 3 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Mantis proof suggestionA 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: Merge-risk optionsMaintainer options:
Technical reviewBest 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 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
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
globalkey 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
pnpm tsgo:ui, full changed-file gate, format, lint, and diff checks pass.Visual Proof
An isolated mock-Gateway browser run selected Work on a global route and verified:
agent:work:main, agentwork.agent:work:main, sessionsession-work-global, agentwork.Command:
pnpm exec tsx .artifacts/control-ui-e2e/selected-agent-collaboration/record-proof.tsCapture: 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:
075e36fb25216b6c942949f12148011471176f8c30814a4b49d02003390a8c132fd51fcb022b6dbf62b01624e599bb722343c2f37fc0063ba096945e507ab452dddcbbb15197394ac72bc6c82e464f2e9734bfe39279aae6705274bb4860a904ca46310f36c9e7b8151c7e7e038010834a18032ba2aef6b861a927ac4410d611