Skip to content

fix(ui): surface companion clear failures - #123724

Merged
steipete merged 3 commits into
mainfrom
fix/autoqa25-ui-companion-clear-error
Aug 14, 2026
Merged

steipete merged 3 commits into
mainfrom
fix/autoqa25-ui-companion-clear-error

Conversation

@steipete

@steipete steipete commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Closes #123711

What Problem This Solves

Control UI operators clearing a Session companion received no feedback when sessions.companion.reset rejected. 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/-28 across 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:

Rejected clear preserves the companion and shows the error

Successful retry clears it:

Successful retry clears the companion

Delayed rejection after navigating to Next produces no stale alert:

The newly selected session has no stale reset error

Returning to Original shows the initiating thread still intact and no recorded stale error:

The initiating thread remains intact without a stale error

Failure/retry recording:

[email protected]

Delayed rejection/navigation recording:

[email protected]

Verification

  • Authentic pre-fix browser failure: the delayed rejection was recorded on the hidden initiating pane and resurfaced after navigating back (expected alert count 0, received 1).
  • Current-main blocker resolved by test-only PR refactor(tests): split compact command lifecycle coverage #123765 at 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 head 39d1bc015e626b5e76b53a768de7aa0404880279.
  • 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.
  • Targeted oxfmt, type-aware Oxlint, and git diff --check — passed.
  • node scripts/check-changed.mjs — passed all planned coreTests, ui lanes; Testbox was unavailable and the repository wrapper explicitly completed the fallback locally.
  • Fresh post-rebase Codex autoreview — clean, no accepted/actionable findings (0.96 confidence).
  • Exact-head CI: https://github.com/openclaw/openclaw/actions/runs/31826329003 — green on attempt 2 after one unrelated service-worker-update.e2e.test.ts retry; the same failure reproduced on detached current main.
  • OPENCLAW_TESTBOX=1 scripts/pr prepare-run 123724 — passed with GATES_MODE=hosted_exact_or_recent_parent, reusing exact-head hosted CI; no separate Testbox lease was allocated.

@clawsweeper

clawsweeper Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 14, 2026 16:04
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Aug 14, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 14, 2026
@clawsweeper

clawsweeper Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 2:03 PM ET / 18:03 UTC.

ClawSweeper review

What this changes

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

⚠️ Ready for maintainer review - 2 items remain

This 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
Reviewed head: 39d1bc015e626b5e76b53a768de7aa0404880279

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary fix with strong browser evidence; exact-head CI completion remains the merge gate.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (recording): The PR body provides after-fix Chromium screenshots and recordings for rejected reset, retry success, and delayed rejection after navigation, backed by a mocked-Gateway browser regression flow.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (recording): The PR body provides after-fix Chromium screenshots and recordings for rejected reset, retry success, and delayed rejection after navigation, backed by a mocked-Gateway browser regression flow.
Evidence reviewed 7 items Current-main defect: Current main awaits the companion reset and then discards every rejection, so a failed clear has no visible outcome.
Repair preserves the owner boundary: The proposed handler captures the initiating scope and sends the error to the header only while that pane, session, client, and generation remain current.
Thread state remains success-owned: The companion-thread controller clears local exchanges only after the reset promise resolves; a rejection leaves the existing thread intact.
Findings None None.
Security None None.

How this fits together

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

Before merge

  • Resolve merge risk (P1) - The change crosses an asynchronous session-state boundary; do not merge until the queued exact-head CI validates the current merge result.
  • Complete next step (P2) - This protected maintainer-scoped PR has no mechanical repair remaining; wait for exact-head CI and normal maintainer merge judgment.
Agent review details

Security

None.

PR surface

Source 0, Tests +166. Total +166 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 28 28 0
Tests 1 166 0 +166
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 194 28 +166

Review metrics

Metric Value Why it matters
Production versus test delta production +28/-28 (net 0); tests +166/-0 The repair absorbs the behavior into the sharing-pane owner without net production growth while adding two browser-level regression flows.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #123711
Summary: This PR is the concrete candidate fix for the open report about companion reset failures disappearing without feedback.

Members:

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

Merge-risk options

Maintainer options:

  1. Complete exact-head session-scope validation (recommended)
    Wait for the queued exact-head checks to pass before merging the repair that gates delayed reset failures by pane and connection scope.

Technical review

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

Labels

Label justifications:

  • P2: This repairs a visible but recoverable Control UI failure when a companion reset is rejected.
  • merge-risk: 🚨 session-state: The patch changes which pane and session may receive an asynchronous reset failure after navigation or reconnect.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (recording): The PR body provides after-fix Chromium screenshots and recordings for rejected reset, retry success, and delayed rejection after navigation, backed by a mocked-Gateway browser regression flow.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides after-fix Chromium screenshots and recordings for rejected reset, retry success, and delayed rejection after navigation, backed by a mocked-Gateway browser regression flow.
  • proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. The PR body provides after-fix Chromium screenshots and recordings for rejected reset, retry success, and delayed rejection after navigation, backed by a mocked-Gateway browser regression flow.

Evidence

What I checked:

Likely related people:

  • steipete: Historical companion/session-sharing work and all three commits on this repair are attributed to Peter Steinberger, matching the known repository handle. (role: feature owner and recent area contributor; confidence: high; commits: 3eca723733d3, e55b2ce05175, 39d1bc015e62; files: ui/src/pages/chat/chat-pane-sharing.ts, ui/src/pages/chat/chat-session-companion.ts)
  • Shakker: Recent history shows focused work on exact session-mutation scoping and stale sharing callbacks in the same sharing pane. (role: recent adjacent contributor; confidence: medium; commits: a45feb391519, efaf46c677c0; files: ui/src/pages/chat/chat-pane-sharing.ts, ui/src/pages/chat/chat-pane-sharing.test.ts)

Rank-up moves

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

  • Wait for the queued exact-head checks to complete green before merging.

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 (3 earlier review cycles)
  • reviewed 2026-08-14T16:11:30.011Z sha e233edb19ff045323ae26f46c7a2115c7ad28893 :: needs changes before merge. :: [P2] Scope the reset failure to the initiating session
  • reviewed 2026-08-14T16:46:32.709Z sha 11f8a95 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-14T17:31:59.902Z sha f933488 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the fix/autoqa25-ui-companion-clear-error branch from e233edb to 11f8a95 Compare August 14, 2026 16:40
@clawsweeper clawsweeper Bot added 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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 14, 2026
@steipete

steipete commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor Author

The accepted ClawSweeper session-state finding and all rank-up moves remain addressed on rebased head 39d1bc015e626b5e76b53a768de7aa0404880279:

  • the reset captures its initiating session/client/connection generation and publishes failure only while that scope is still selected and current;
  • the Chromium regression delays the rejection, navigates to another session, proves no stale alert appears there or after returning, and proves the initiating companion exchange remains intact;
  • production remains +28/-28 (net 0), with no controller error store or public API change.

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 0cd18e1fb9ff0c83fe10e0cf613b2031184afb8d. This branch rebased without overlap; exact-head CI https://github.com/openclaw/openclaw/actions/runs/31826329003 is green on attempt 2 after one unrelated service-worker E2E retry. Native OPENCLAW_TESTBOX=1 scripts/pr prepare-run 123724 passed by reusing that hosted exact-head proof (GATES_MODE=hosted_exact_or_recent_parent), so no separate Testbox lease was allocated.

@clawsweeper clawsweeper Bot added proof: 🎥 video Contributor real behavior proof includes video or recording evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. labels Aug 14, 2026
@steipete
steipete force-pushed the fix/autoqa25-ui-companion-clear-error branch from f933488 to 39d1bc0 Compare August 14, 2026 17:56
@steipete
steipete merged commit 0bdf11c into main Aug 14, 2026
295 of 299 checks passed
@steipete
steipete deleted the fix/autoqa25-ui-companion-clear-error branch August 14, 2026 18:30
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 15, 2026
* fix(ui): surface companion clear failures

* fix(ui): scope companion reset errors

* fix(ui): preserve companion clear async contract
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 merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. 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.

[Bug]: Clear companion failures disappear without feedback

1 participant