Skip to content

refactor(ui): selected-session sends; delete exact-run steer machinery - #125862

Merged
steipete merged 1 commit into
mainfrom
steipete/ui-selected-session-send
Aug 18, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/ui-selected-session-send

Conversation

@steipete

@steipete steipete commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

With the Gateway owning atomic start-or-steer (#125808), the browser's exact-run machinery (run-target resolution, steered chips, target-bound retry, steering states, expectedRunId production) is obsolete duplicate policy that produced client-side failures like #125427.

Why This Change Was Made

The selected session key is the complete browser-side target; the Gateway decides steer-vs-start (#125808). The UI keeps one generic durable outbox path (offline/reconnect, attachments, idempotency, FIFO) with a queue-mode marker.

User Impact

Steer/busy sends can no longer fail client-side with "The active run could not be identified uniquely"; retry is idempotent and generic; queue-row Steer and modified Enter request steer mode only; Stop remains descendant-aware. Persisted queue rows from earlier builds normalize at load (steered→queueMode steer).

Evidence

Production +296/−921 (net −625), tests +209/−2265; 77→61 steer-grep accounting with per-file disposition (in the maintainer's review notes); focused suites 743+22+346 tests green; ui:build, check-changed, i18n baseline green; #125428 descendant-only regression byte-identical; codex autoreview clean; ratchet baseline shrink-only. Live Control-UI proof (isolated dev gateway + video) to be attached before ready-for-review.

Live proof (isolated dev gateway)

  • Rig: isolated OPENCLAW_STATE_DIR dev gateway on port 19873, this PR's dist + Control UI build (asset index-CR4ZlzsR.js), anthropic/claude-opus-5 live model, fresh dashboard session.
  • In-run steering: a run executing sleep 4 x8 as separate exec tool calls (>=32s if completed) was steered mid-run; gateway diagnostic reason=active_run_injected recorded for the steer messageId (session key agent:dev:dashboard:f5f37073...); the run stopped after ~11s and ended with the steered marker in the same turn ("Worked for 11s", screenshot 04).
  • Idle /steer: rendered a "Steered." notice, payload became a visible normal turn, answered in 3s (screenshot 05) — no dead end.
  • Wire: WebSocket frame capture asserted every chat.send carried queueMode: "steer" + idempotencyKey and no expectedRunId / steerTargetRunId; the retired client-side failure row ("The active run could not be identified uniquely") cannot render (locator assert).
steer-proof-125862.mp4

Tool loop running before steer

Steered reply landed in the same turn

Idle slash-steer fell back to a normal visible turn

…chinery

browser no longer chooses or persists run targets; steer sends ride the generic durable outbox with queueMode steer and no expectedRunId/expectedLeafEntryId; deletes steer-lifecycle.ts, steered-chip.ts, kind:"steered", steerTargetRunId, sendState:"steering", target-bound retry, uniqueness failure rows; persisted outbox rows normalize at load; net -625 production LOC.
@clawsweeper

clawsweeper Bot commented Aug 18, 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: XL maintainer Maintainer-authored PR labels Aug 18, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. 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 18, 2026
@clawsweeper

clawsweeper Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 11:24 AM ET / 15:24 UTC.

ClawSweeper review

What this changes

This PR removes browser-side exact-run steering and sends selected-session follow-ups through the durable outbox with an explicit queue mode.

Regression provenance

Possible regression — probable (reproduction; reviewed change; known regression link). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open for maintainer review: the UI now defers start-versus-steer to the Gateway’s atomic owner and no blocking patch defect was found, but the persisted browser-outbox migration still lacks the requested reload-and-retry proof.

Priority: P2
Reviewed head: 7e7312154b448f5d8cb701a82387f59250c80e09
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch has coherent owner-boundary deletion and credible real-flow evidence, with one material upgrade-proof gap remaining.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (recording): The PR body supplies an after-fix isolated Gateway recording and screenshots for active steering, idle fallback, and wire shape; DNS prevented reviewer download of the linked media but does not make the contributor proof insufficient.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (recording): The PR body supplies an after-fix isolated Gateway recording and screenshots for active steering, idle fallback, and wire shape; DNS prevented reviewer download of the linked media but does not make the contributor proof insufficient.
Evidence reviewed 6 items Gateway owner boundary on current main: Current main captures the active injection target under the session admission lock only for steer mode, and resolves a current target when no exact run is supplied; this supports moving target selection out of the browser.
UI request boundary: The PR’s durable delivery path forwards a row’s queue mode and deliberately omits the leaf precondition for steer mode, so the UI no longer provides browser-resolved run identity.
Persisted-row normalization: Legacy steered rows, target ids, and steering state normalize to a generic steer-mode row with an unconfirmed delivery state; the adjacent persistence test verifies old fields are not written back.
Findings None None.
Security None None.

Live Verification

Command: pnpm ui:build

Result: PASS (completed)

pnpm ui:build
runner@runnervmzvulz:/tmp/clawsweeper-live-proof-125862-P01o8D/target$ pnpm ui:build
$ node scripts/ui.js build
$ vite build
pnpm ui:build
vite v8.1.5 building client environment for production...
transforming...












































Assertions:

  • PASS expect_output: vite v

How this fits together

The Control UI turns a composer action into a durable browser outbox row and sends it to the Gateway. The Gateway then atomically injects into an active run or starts a new turn, returning the resulting chat state to the UI.

flowchart LR
  A[Operator message] --> B[Control UI composer]
  B --> C[Durable browser outbox]
  C --> D[Chat send request]
  D --> E[Gateway start-or-steer decision]
  E --> F[Active run injection]
  E --> G[New session turn]
  F --> H[Updated chat transcript]
  G --> H
Loading

Decision needed

Question Recommendation
Is the codec test plus current live steering recording sufficient for upgrading persisted legacy steer rows, or should merge wait for a sanitized reload-and-retry demonstration? Require reload-and-retry proof: Record a pre-change persisted steer row loading on this head, then show its safe retry or visible unconfirmed outcome.

Why: The normalizer changes durable browser rows, while the provided live recording demonstrates active and idle routing rather than the persisted upgrade path.

Before merge

  • Resolve merge risk (P1) - Existing browser sessionStorage rows use retired steer fields; source tests cover normalization, but the submitted live proof does not demonstrate reload and retry of such a row.
  • Resolve merge risk (P1) - Merging changes durable outbox ordering and retry behavior for steer-mode sends, so the current clean-but-behind branch needs an exact-head refresh after the migration proof.
  • Complete next step (P2) - A maintainer must decide whether source-level migration coverage is enough or a persisted reload-and-retry proof is required before merge.
Agent review details

Security

None.

PR surface

Source -625, Tests -2056, Other -1. Total -2682 across 38 files.

View PR surface stats
Area Files Added Removed Net
Source 25 296 921 -625
Tests 12 209 2265 -2056
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 38 505 3187 -2682

Review metrics

Metric Value Why it matters
Production versus test LOC production +296/-921 (net -625); tests +209/-2265 The refactor substantially deletes duplicate browser steering machinery while retaining focused coverage for the replacement durable-outbox path.

Stored data model

Persistent data-model change detected: persistent cache schema: ui/src/pages/chat/chat-send-support.ts, serialized state: ui/src/pages/chat/chat-gateway.test.ts, serialized state: ui/src/pages/chat/composer-persistence.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Add persisted-upgrade proof (recommended)
    Before merge, capture a sanitized reload of an old steer row and its retry or safe unconfirmed result against this head.
  2. Accept the remaining upgrade risk
    Merge with the unit-tested conversion as the compatibility proof, accepting that a real persisted-row replay was not recorded.

Technical review

Best possible solution:

Keep one Gateway-owned start-or-steer path and land the UI cleanup after a sanitized old-row reload-and-retry proof confirms the durable upgrade path.

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

No live reproduction was run in this read-only review; yes at source level, because current-main UI still carries exact-run steering while this head sends queue mode directly to the Gateway.

Is this the best way to solve the issue?

Yes for the runtime boundary: current main makes the Gateway the atomic start-or-steer owner. The remaining question is upgrade proof for persisted browser rows, not a better code layer.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add merge-risk: 🚨 message-delivery: The PR changes how steer sends are admitted, retried, and ordered through the durable outbox.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies an after-fix isolated Gateway recording and screenshots for active steering, idle fallback, and wire shape; DNS prevented reviewer download of the linked media but does not make the contributor proof insufficient.
  • add proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. The PR body supplies an after-fix isolated Gateway recording and screenshots for active steering, idle fallback, and wire shape; DNS prevented reviewer download of the linked media but does not make the contributor proof insufficient.

Label justifications:

  • P2: This is a bounded Control UI send-path refactor with compatibility-sensitive behavior but no demonstrated urgent outage.
  • merge-risk: 🚨 compatibility: Persisted browser outbox rows are normalized from retired steering fields to queue-mode rows during upgrade.
  • merge-risk: 🚨 message-delivery: The PR changes how steer sends are admitted, retried, and ordered through the durable outbox.
  • 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 (recording): The PR body supplies an after-fix isolated Gateway recording and screenshots for active steering, idle fallback, and wire shape; DNS prevented reviewer download of the linked media but does not make the contributor proof insufficient.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies an after-fix isolated Gateway recording and screenshots for active steering, idle fallback, and wire shape; DNS prevented reviewer download of the linked media but does not make the contributor proof insufficient.
  • proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. The PR body supplies an after-fix isolated Gateway recording and screenshots for active steering, idle fallback, and wire shape; DNS prevented reviewer download of the linked media but does not make the contributor proof insufficient.

Evidence

What I checked:

  • Gateway owner boundary on current main: Current main captures the active injection target under the session admission lock only for steer mode, and resolves a current target when no exact run is supplied; this supports moving target selection out of the browser. (src/gateway/server-methods/chat-send-admission.ts:195, 07a0b5170343)
  • UI request boundary: The PR’s durable delivery path forwards a row’s queue mode and deliberately omits the leaf precondition for steer mode, so the UI no longer provides browser-resolved run identity. (ui/src/pages/chat/chat-send-delivery.ts:303, 7e7312154b44)
  • Persisted-row normalization: Legacy steered rows, target ids, and steering state normalize to a generic steer-mode row with an unconfirmed delivery state; the adjacent persistence test verifies old fields are not written back. (ui/src/lib/chat/outbox-store-codec.ts:82, 7e7312154b44)
  • Merged contract provenance: The Gateway contract this PR consumes was introduced by the merged atomic start-or-steer refactor; current-main source retains that implementation. (src/gateway/server-methods/chat-send-admission.ts:195, 6515f6a2555d)
  • Live behavior evidence: The PR body provides an isolated Gateway recording and screenshots covering in-run steering, idle /steer fallback, and wire fields. Artifact download was unavailable because DNS could not resolve github.com, which does not negate the submitted proof. (7e7312154b44)
  • Feature-history owners: History associates Peter Steinberger with the Gateway start-or-steer refactor and Ayaan Zaidi with the pre-existing UI outbox delivery and codec lines; the local clone is shallow, so older history was sampled where available. (ui/src/pages/chat/chat-send-submit.ts:520, 6515f6a2555d)

Likely related people:

  • Peter Steinberger: Authored the merged Gateway start-or-steer refactor and the current UI refactor; history also shows prior steering and UI ownership. (role: gateway steering contract owner and recent UI contributor; confidence: high; commits: 6515f6a2555d, 48ea08918e3f, 7e7312154b44; files: src/gateway/server-methods/chat-send-admission.ts, ui/src/pages/chat/chat-send-submit.ts)
  • Ayaan Zaidi: Current-main blame attributes the surrounding send-delivery and submit code to this contributor, including the pre-refactor outbox behavior this PR changes. (role: recent outbox-path contributor; confidence: medium; commits: f1b8082d61c1; files: ui/src/pages/chat/chat-send-delivery.ts, ui/src/pages/chat/chat-send-submit.ts, ui/src/lib/chat/outbox-store-codec.ts)
  • jalehman: Authored the merged descendant-only parent-send regression repair that this refactor supersedes architecturally. (role: adjacent regression contributor; confidence: medium; commits: 5b8dcf9d28db; files: ui/src/pages/chat/chat-send.test.ts)

Rank-up moves

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

  • Add a sanitized persisted legacy-row reload-and-retry recording before merge.

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-18T14:56:33.389Z sha 7e73121 :: needs maintainer review before merge. :: none

@steipete
steipete marked this pull request as ready for review August 18, 2026 15:17
@clawsweeper clawsweeper Bot added merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. labels Aug 18, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Maintainer decision: accept the source-level persisted-row migration proof for merge and skip the optional legacy-row reload-and-retry recording.

The codec/persistence coverage loads retired steer fields, verifies normalization to the generic queueMode: "steer" / unconfirmed row, and verifies retired fields are not written back. The exact-head CI run is green, while the attached isolated-gateway recording covers active steering, idle /steer fallback, and the wire shape. ClawSweeper reported no actionable findings; this records the explicit skip for its optional rank-up move.

CI: https://github.com/openclaw/openclaw/actions/runs/32153546302
ClawSweeper review: #125862 (comment)

@steipete
steipete merged commit d84a910 into main Aug 18, 2026
208 of 209 checks passed
@steipete
steipete deleted the steipete/ui-selected-session-send branch August 18, 2026 15:38
@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 20, 2026
…chinery (openclaw#125862)

browser no longer chooses or persists run targets; steer sends ride the generic durable outbox with queueMode steer and no expectedRunId/expectedLeafEntryId; deletes steer-lifecycle.ts, steered-chip.ts, kind:"steered", steerTargetRunId, sendState:"steering", target-bound retry, uniqueness failure rows; persisted outbox rows normalize at load; net -625 production LOC.
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: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. 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: XL 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