Repository navigation
fix(ui): surface companion clear failures - #123724
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 2:03 PM ET / 18:03 UTC. ClawSweeper reviewWhat this changesThe PR reports failed Control UI companion clears in the chat header while preserving the thread until the Gateway reset succeeds and suppressing delayed errors after navigation. Merge readinessThis PR is still necessary: current main silently catches a failed companion reset. The patch is a coherent owner-boundary repair with no blocking code finding; keep it open for the protected maintainer path and exact-head CI completion. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI companion rail sends reset requests through the Gateway for the selected chat session. The chat pane retains the local companion thread on failure and publishes visible feedback only for the still-current pane. flowchart LR
A[Companion clear action] --> B[Capture active pane scope]
B --> C[Gateway reset request]
C --> D{Reset outcome}
D -->|Success| E[Clear local companion thread]
D -->|Failure on current pane| F[Chat header error]
D -->|Failure after navigation| G[Suppress stale error]
Before merge
Agent review detailsSecurityNone. PR surfaceSource 0, Tests +166. Total +166 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. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the companion-thread controller as the sole state owner and land the scoped header-error repair after exact-head CI is green. Do we have a high-confidence way to reproduce the issue? Yes—current main visibly swallows the reset rejection at the clear-action boundary, and the PR supplies a focused Chromium scenario for the rejected RPC and navigation race. Is this the best way to solve the issue? Yes—the error belongs in the existing chat-header publisher while thread clearing remains in the companion-thread controller after successful reset; this avoids a parallel error store or a stale-pane update. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against bf40269cb792. 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 (3 earlier review cycles)
|
e233edb to
11f8a95
Compare
|
The accepted ClawSweeper session-state finding and all rank-up moves remain addressed on rebased head
Focused proof is green on the rebased head: 69 unit assertions, 2 Chromium flows, targeted type-aware lint, the full changed gate, and fresh Codex autoreview. Fresh exact-head screenshots and recordings are in the PR body. The previous current-main blocker was resolved by test-only PR #123765 at |
f933488 to
39d1bc0
Compare
|
Merged via squash.
|
* fix(ui): surface companion clear failures * fix(ui): scope companion reset errors * fix(ui): preserve companion clear async contract
Closes #123711
What Problem This Solves
Control UI operators clearing a Session companion received no feedback when
sessions.companion.resetrejected. The companion thread correctly remained visible, but the rejection was swallowed, so the action appeared to do nothing.Why This Change Was Made
Rejected resets now use the chat pane's existing header-error publisher. The companion thread controller remains the state owner and still clears local exchanges only after reset success.
The accepted ClawSweeper session-state finding is addressed: the clear action captures the initiating session and connection scope before awaiting the RPC, and publishes a rejection only while that same pane, session, client, and connection generation remain current. Navigating away during a delayed rejection cannot attach the old failure to another session or retain it on the hidden initiating pane.
The connection-scope capture now delegates validation to its existing canonical current-scope predicate instead of duplicating the same policy. Production remains neutral at
+28/-28across the final three-file diff. No protocol, config, persistence, public API, or product-policy surface changes.User Impact
When a companion clear fails in the current session, operators keep the existing thread and see the Gateway error in the normal chat header. Retrying after recovery clears the thread. If they navigate away while the reset is pending, the delayed failure is suppressed instead of appearing in either session.
Exact-head Chromium evidence
Failure feedback preserves the companion thread:
Successful retry clears it:
Delayed rejection after navigating to
Nextproduces no stale alert:Returning to
Originalshows the initiating thread still intact and no recorded stale error:Failure/retry recording:
[email protected]
Delayed rejection/navigation recording:
[email protected]
Verification
expected alert count 0, received 1).0cd18e1fb9ff0c83fe10e0cf613b2031184afb8d; the companion patch rebased without overlap.node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-session-companion-clear.e2e.test.ts— 2 tests passed on rebased head39d1bc015e626b5e76b53a768de7aa0404880279.node scripts/run-vitest.mjs ui/src/pages/chat/chat-session-rail.test.ts ui/src/pages/chat/chat-pane-sharing.test.ts— 69 tests passed.git diff --check— passed.node scripts/check-changed.mjs— passed all plannedcoreTests, uilanes; Testbox was unavailable and the repository wrapper explicitly completed the fallback locally.service-worker-update.e2e.test.tsretry; the same failure reproduced on detached current main.OPENCLAW_TESTBOX=1 scripts/pr prepare-run 123724— passed withGATES_MODE=hosted_exact_or_recent_parent, reusing exact-head hosted CI; no separate Testbox lease was allocated.