Skip to content

fix(ui): keep stable chat rows in insertion order and only sort live tool/stream items by timestamp - #113266

Merged
steipete merged 14 commits into
openclaw:mainfrom
xialonglee:fix/issue-112943-chat-order
Jul 27, 2026
Merged

steipete merged 14 commits into
openclaw:mainfrom
xialonglee:fix/issue-112943-chat-order

Conversation

@xialonglee

@xialonglee xialonglee commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Related: #112943

Additional instructions

MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.

What Problem This Solves

Fixes an issue where WebChat could render the assistant reply above the user prompt in the same turn when the Gateway clock lagged behind the browser clock. The optimistic user bubble used the browser clock while the assistant reply used a Gateway timestamp; globally sorting every visible row could reverse their causal order.

Why This Change Was Made

Stable transcript and optimistic-send rows now retain their authoritative insertion order. Only transient live projections—stream segments, tool cards, canvas previews, and terminal question summaries—are timestamp-inserted within the user turn owned by their agent run, so clock skew cannot move a reply above its prompt or live output across adjacent queued turns.

The Gateway question contract now carries an additive optional runId through question.request, QuestionRecord, requested/list/get recovery, built-in ask_user, and Codex/Copilot harness bridges. Control UI uses that authoritative identity instead of inferring ownership from whichever run is visible; generated Swift/Kotlin models and native Swift record transitions preserve it. No protocol version bump is needed because both request and record fields are optional and backward-compatible.

User Impact

Users see user prompts, live work, assistant replies, and question summaries remain in the correct turn during normal streaming, queued sends, and reconnect recovery—even when browser and Gateway clocks disagree. Refreshing chat no longer changes the visible order.

Evidence

  • Current-main defect proof: on 5ae8a4f4f98c, adding the approved runId to an otherwise valid question.request fails the closed protocol validator (tbx_01kygrzt3t19w314qt7axp4m8b, Actions run 30234078268).
  • Focused repaired surface: 277 Gateway, protocol, agent-bridge, and Control UI tests passed (tbx_01kygscdwt1zbswt0dec7k7qmx, run 30234360987); the follow-up ask_user suite passed 30/30 (tbx_01kygt48vcwtbah64qxm0eecse, run 30234863389).
  • Chromium geometry proof: the user prompt stayed above both a live stream and final assistant reply whose Gateway timestamp was 60 seconds earlier (tbx_01kygwahb3hj12gtxrrh3x9f6g, run 30236404112).
  • Real Gateway + Chrome proof on exact head 5385f5553adc: an isolated source Gateway ran with its process clock 60 seconds behind the real Chrome clock and streamed through a local OpenAI-compatible endpoint. During the live stream, the optimistic user row was at y=76 and the assistant row at y=157 (ordered=true); after completion the UI showed Done in 1m 16s while keeping the prompt above the reply. Gateway logs recorded chat.send for run 0d1ba0bf-aec5-4ac3-b0a2-52dfe60359f5, and the durable transcript contained exactly one user row followed by one assistant row.
  • Real question correlation proof: after a second user/assistant turn completed, question.request created live_question_proof_2 with the first turn's runId, then question.resolve answered Keep. Control UI placed Choice: Keep between the first and second user turns (y=76 < 281 < 342) despite the question being created later; question.get on the same real Gateway independently returned the exact runId on the pending record.
  • Native preservation: swift test --package-path apps/shared/OpenClawKit --filter 'question card preserves run identity across local terminal records' passed.
  • Final contributor test split: all 35 test names were preserved; targeted oxlint passed and 36/36 affected UI tests passed (tbx_01kygy69skdy93wz74m31tp3hd, run 30237891079).
  • Generated protocol output reran byte-stably; pnpm native:i18n:verify and git diff --check pass.
  • Independent adversarial refuter verdict: NO-ACTIONABLE-OBJECTION on exact head 5385f5553adc.
  • Codex autoreview: no findings; the protocol repair scored correct at 0.90 confidence and the final test split at 0.98 confidence.

The remaining hosted rerun is an unrelated core-tooling shard recovering from a lost-runner infrastructure failure; exact-head CI remains the final merge gate.

@xialonglee
xialonglee marked this pull request as ready for review July 24, 2026 07:35
@xialonglee

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 25, 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 repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. labels Jul 25, 2026
@clawsweeper

clawsweeper Bot commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 27, 2026, 1:37 AM ET / 05:37 UTC.

ClawSweeper review

What this changes

The PR preserves insertion order for stable Control UI chat rows, timestamp-orders only live rows within their owning agent run, and carries an optional question runId through the Gateway protocol, harnesses, and native clients.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 6 items remain

Keep this PR open. The proposed invariant—stable transcript rows retain causal insertion order while live projections are ordered only inside their owning run—directly addresses the linked WebChat defect, and the branch has focused coverage plus green checks. However, the available evidence is still mock/test-oriented rather than inspectable after-fix behavior against a real Control UI and Gateway, and the optional Gateway question-contract change also requires the target repository’s mandated direct Codex runtime-contract inspection before a merge verdict.

Priority: P1
Reviewed head: 5385f5553adc5e2e659c6b6fac713b8163378a1f

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation and targeted regression coverage are promising, but mocked browser evidence does not yet satisfy the required real behavior proof gate.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body reports Chromium geometry and broad test results, but the available evidence is a mocked-Gateway browser scenario rather than inspectable after-fix behavior through a real Control UI and Gateway; add redacted live output, logs, transcript, or recording. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body reports Chromium geometry and broad test results, but the available evidence is a mocked-Gateway browser scenario rather than inspectable after-fix behavior through a real Control UI and Gateway; add redacted live output, logs, transcript, or recording. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 6 items Linked bug and candidate fix: The PR explicitly targets the live WebChat ordering failure tracked by the open issue, whose report says refresh restores the durable transcript order; this branch is therefore a candidate fix rather than a duplicate closure.
Stable/live ordering boundary: The branch adds turn-bound calculations and timestamp insertion helpers for live projections while removing global visible-time sorting from the chat-thread build path, matching the requested causal-order boundary.
Protocol compatibility surface: The PR adds optional runId fields to both question request and stored question-record schemas, then propagates that identity through question handling and UI parsing; this is an additive protocol change but remains compatibility-sensitive.
Findings None None.
Security None None.

How this fits together

Control UI combines durable chat-history rows, browser-local optimistic sends, and live agent/tool/question projections into one conversation view. This PR changes that projection step so clock differences cannot move an assistant reply or terminal question outside the user turn that owns it.

flowchart LR
  A[Browser optimistic user send] --> D[Chat row projection]
  B[Gateway transcript history] --> D
  C[Live agent tools streams and questions] --> E[Run ownership lookup]
  E --> D
  D --> F[Stable causal chat order]
  G[Optional question run identity] --> E
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body reports Chromium geometry and broad test results, but the available evidence is a mocked-Gateway browser scenario rather than inspectable after-fix behavior through a real Control UI and Gateway; add redacted live output, logs, transcript, or recording. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The new optional runId is carried in Gateway request and recovery records and consumed by Control UI, Codex, Copilot, Android, and Swift paths; merge should retain verified backward behavior for clients and records that omit it.
  • Resolve merge risk (P1) - The branch is behind main; refresh the merge result and rerun the causal-order scenario on that exact head before landing.
  • Resolve merge risk (P1) - Available browser evidence uses a mocked Gateway. It does not yet demonstrate the reported clock-skew and reconnect behavior through a real Gateway and Control UI session.
  • Resolve merge risk (P1) - Because this changes the Codex user-input bridge, repository policy requires direct inspection of the sibling Codex runtime/protocol contract before a final Codex-related merge verdict.
  • Complete next step (P2) - This PR needs contributor-supplied real behavior proof plus an owner-level Codex runtime-contract check, neither of which is a safe automated branch repair.
Agent review details

Security

None.

PR surface

Source +306, Tests +498, Docs +5, Other +39. Total +848 across 36 files.

View PR surface stats
Area Files Added Removed Net
Source 18 394 88 +306
Tests 12 1318 820 +498
Docs 1 5 0 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 5 54 15 +39
Total 36 1771 923 +848

Review metrics

Metric Value Why it matters
Gateway question contract 1 optional identity added to 2 protocol shapes Both request and recovered-record shapes now carry runId, so compatibility needs checking across old clients and reconnect recovery.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #112943
Summary: This PR is a candidate implementation for the open WebChat live-ordering bug; it should remain open until merged or rejected after proof review.

Members:

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

Mantis proof suggestion

A redacted web UI chat transcript from a real Gateway would materially verify the user-visible ordering and reconnect outcome that mocked E2E cannot establish. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis web UI chat proof: reproduce clock-skewed prompt and reply timing, then capture a redacted transcript showing the prompt, live output, question summary, and final reply stay in the correct turn.

Merge-risk options

Maintainer options:

  1. Add real Control UI and Gateway proof (recommended)
    Rebase the branch and record a redacted after-fix run against a real Gateway showing the prompt, live projection, recovered question, and final reply remain in one causal turn.
  2. Pause pending direct contract review
    Hold merge until an owner confirms the optional question runId matches the Codex bridge/runtime contract and preserves clients that omit it.

Technical review

Best possible solution:

Rebase onto current main, preserve the additive optional question identity, and attach redacted real-Gateway Control UI proof showing a clock-skewed prompt, live output, terminal question recovery, and final reply remain within the correct user turn.

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

Yes in source/tests, with medium confidence: the added browser scenario constructs a browser-local user timestamp later than the Gateway reply timestamp and asserts visible causal order. A high-confidence real-Gateway reproduction or after-fix proof is still missing from the inspectable evidence.

Is this the best way to solve the issue?

Unclear. The separation of stable transcript ordering from run-scoped live insertion is a maintainable response to clock skew, but the cross-client optional runId contract needs direct Codex runtime inspection and real reconnect proof before it can be called the best complete fix.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: Incorrect live chat ordering can make active assistant conversations appear causally reversed until refresh.
  • merge-risk: 🚨 compatibility: The PR adds an optional field to Gateway question request and record contracts consumed by multiple client and harness surfaces.
  • merge-risk: 🚨 session-state: Run identity now decides where terminal question and live projection state appears after reconnect and recovery.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports Chromium geometry and broad test results, but the available evidence is a mocked-Gateway browser scenario rather than inspectable after-fix behavior through a real Control UI and Gateway; add redacted live output, logs, transcript, or recording. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Linked bug and candidate fix: The PR explicitly targets the live WebChat ordering failure tracked by the open issue, whose report says refresh restores the durable transcript order; this branch is therefore a candidate fix rather than a duplicate closure. (ui/src/pages/chat/chat-thread-build.ts:82, 5385f5553adc)
  • Stable/live ordering boundary: The branch adds turn-bound calculations and timestamp insertion helpers for live projections while removing global visible-time sorting from the chat-thread build path, matching the requested causal-order boundary. (ui/src/pages/chat/chat-thread-build.ts:82, 5385f5553adc)
  • Protocol compatibility surface: The PR adds optional runId fields to both question request and stored question-record schemas, then propagates that identity through question handling and UI parsing; this is an additive protocol change but remains compatibility-sensitive. (packages/gateway-protocol/src/schema/questions.ts:56, 5385f5553adc)
  • Regression coverage: The branch includes a focused Control UI regression test for a browser-local prompt and an earlier Gateway reply timestamp, plus question ownership and reconnecting-run tests. (ui/src/e2e/chat-flow.e2e.test.ts:510, 5385f5553adc)
  • Prior review continuity: The latest completed ClawSweeper cycle at 5385f5553adc reported no code findings but required real behavior proof because its browser evidence used a mocked Gateway rather than a real Control UI and Gateway run. (ui/src/e2e/chat-flow.e2e.test.ts:510, 5385f5553adc)
  • Feature-history routing: The PR timeline assigns the work to steipete, and steipete authored the central ordering and run-correlation commits on the branch, including fbe3a012, c9a660d0, e9c0df3b, and a9d7ea97. (ui/src/pages/chat/chat-thread-build.ts:82, a9d7ea975d1d)

Likely related people:

  • steipete: Assigned to this PR and authored most of the branch’s central Control UI ordering, reconnect, terminal-ordering, and question-run-correlation commits. (role: recent area contributor and assigned reviewer; confidence: medium; commits: fbe3a0121ad6, c9a660d08ce1, e9c0df3b0fc1; files: ui/src/pages/chat/chat-thread-build.ts, ui/src/pages/chat/chat-thread-items.ts, ui/src/pages/chat/tool-stream.ts)
  • xialonglee: Opened the PR and authored the initial ordering change and the current-head test refactor; ownership beyond this branch is not established from the available history. (role: current branch contributor; confidence: low; commits: d24b66a04205, 5385f5553adc; files: ui/src/pages/chat/chat-thread-build.ts, ui/src/pages/chat/tool-stream.node.test.ts)

Rank-up moves

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

  • Attach redacted real-Gateway Control UI proof that reproduces the skewed-order setup and shows the corrected live and recovered order.
  • Refresh the branch against current main and verify the exact merge head.
  • Have an owner complete the required direct Codex bridge/runtime-contract check for the runId propagation.

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 (8 earlier review cycles)
  • reviewed 2026-07-25T09:23:05.636Z sha 8ba08a6242b7d9b8d62f998fa8ec52c7c0016e0d :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-25T10:05:13.077Z sha 8ba08a6242b7d9b8d62f998fa8ec52c7c0016e0d :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-25T12:17:31.360Z sha c5191e99a571214608ca2fc5055874bb4f2ed7ee :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-25T12:58:29.076Z sha ba80dbbb9f475abb9eeebc0ff01c8469868da732 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-27T02:31:11.460Z sha d86d258 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-27T02:42:41.571Z sha 22be93a :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-27T04:25:09.189Z sha 6f4fe67 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-27T04:45:35.981Z sha 5385f55 :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. label Jul 25, 2026
@steipete steipete self-assigned this Jul 25, 2026
@steipete
steipete force-pushed the fix/issue-112943-chat-order branch from 8ba08a6 to 6c8282e Compare July 25, 2026 11:49
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Jul 25, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: android App: android gateway Gateway runtime agents Agent runtime and tooling extensions: codex extensions: copilot size: XL and removed size: L labels Jul 27, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Jul 27, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jul 27, 2026
@steipete

Copy link
Copy Markdown
Contributor

Pre-merge maintainer proof for exact head 5385f5553adc5e2e659c6b6fac713b8163378a1f:

  • Current-main reproduction: question.request rejects the approved optional runId on 5ae8a4f4f98c (tbx_01kygrzt3t19w314qt7axp4m8b, run 30234078268).
  • Focused repaired surface: 277 Gateway/protocol/agent/UI tests passed (tbx_01kygscdwt1zbswt0dec7k7qmx, run 30234360987); ask_user passed 30/30 (tbx_01kygt48vcwtbah64qxm0eecse, run 30234863389); final split passed 36/36 (tbx_01kygy69skdy93wz74m31tp3hd, run 30237891079).
  • Native contract: focused OpenClawKit Swift test passed; protocol generators were byte-stable; pnpm native:i18n:verify and git diff --check passed.
  • Deterministic Chromium proof: clock-skew geometry E2E passed (tbx_01kygwahb3hj12gtxrrh3x9f6g, run 30236404112).
  • Real runtime proof: an isolated source Gateway on this head ran with its clock 60 seconds behind real Chrome and streamed through a local OpenAI-compatible endpoint. The optimistic user row remained above the live assistant row (y=76 < 157), then completed as Done in 1m 16s. A real question.request created after a second turn but carrying the first turn's runId rendered Choice: Keep between the first and second user turns (y=76 < 281 < 342); question.get returned the same runId.
  • Independent adversarial refuter: NO-ACTIONABLE-OBJECTION on the final head. Codex autoreview: no findings (protocol repair 0.90; final test split 0.98).
  • Hosted CI: run 30237673660 attempt 2 completed success; the only attempt-1 failure was a lost hosted-runner connection in an unrelated core-tooling shard, and its rerun passed. Live gh pr checks reports no failed or pending checks.

Known proof gap: no external provider or user data was used; the real Gateway used a local deterministic OpenAI-compatible endpoint so the clock and run-ownership conditions remained controlled and reproducible.

@steipete
steipete merged commit 0406e66 into openclaw:main Jul 27, 2026
222 of 226 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

@xialonglee
xialonglee deleted the fix/issue-112943-chat-order branch July 27, 2026 06:33
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 27, 2026
…tool/stream items by timestamp (openclaw#113266)

* fix(ui): keep stable chat rows in insertion order and only sort live tool/stream items by timestamp

* fix(ui): keep live rows within current turn

* fix(ui): keep current work above queued turns

* fix(ui): keep streamed replies above queued turns

* fix(ui): preserve reconnecting run order

* fix(ui): preserve causal terminal ordering

* fix(ui): bound replay rows to owning turns

* fix(ui): keep question summaries in owning turns

* fix(ui): scope question run ownership to session

* fix(ui): restore reconnecting chat run identity

* fix(ui): remove unused chatItemTimestamp import in chat-thread-build.ts

* fix(ui): correlate question summaries with agent runs

Co-authored-by: Peter Lee <[email protected]>

* chore(i18n): refresh native source baseline

Co-authored-by: Peter Lee <[email protected]>

* fix(ui): remove unused chatItemTimestamp export and split tool-stream test file

---------

Co-authored-by: Peter Steinberger <[email protected]>
steipete added a commit that referenced this pull request Jul 27, 2026
A pane that admits the accepted prompt before its transcript bootstrap
resolves leaves that row in chatMessages while the history request is in
flight. The merge then re-placed it as a late optimistic tail, and since
#113266 stable rows keep insertion order, the first turn rendered below the
tool activity it kicked off. The handoff reconciler owns that head row, so
exclude it from the late tail.
steipete added a commit that referenced this pull request Jul 27, 2026
* test(ui): align new-session e2e with path routes and startup transcript

* fix(ui): claim new-session handoffs on the direct chat route

Deferred session navigation can route a pane straight onto the created
session key, which never runs the switch path that admits the one-shot
handoffs. The rejected turn then expired unclaimed instead of offering a
retry, and an accepted prompt stayed hidden until the transcript bootstrap
resolved. Mirror chat-state-route's admission on the direct branch.

Fixes #114374

* fix(ui): keep the projected first prompt above the replies it started

A pane that admits the accepted prompt before its transcript bootstrap
resolves leaves that row in chatMessages while the history request is in
flight. The merge then re-placed it as a late optimistic tail, and since
#113266 stable rows keep insertion order, the first turn rendered below the
tool activity it kicked off. The handoff reconciler owns that head row, so
exclude it from the late tail.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 28, 2026
…w#114377)

* test(ui): align new-session e2e with path routes and startup transcript

* fix(ui): claim new-session handoffs on the direct chat route

Deferred session navigation can route a pane straight onto the created
session key, which never runs the switch path that admits the one-shot
handoffs. The rejected turn then expired unclaimed instead of offering a
retry, and an accepted prompt stayed hidden until the transcript bootstrap
resolved. Mirror chat-state-route's admission on the direct branch.

Fixes openclaw#114374

* fix(ui): keep the projected first prompt above the replies it started

A pane that admits the accepted prompt before its transcript bootstrap
resolves leaves that row in chatMessages while the history request is in
flight. The merge then re-placed it as a late optimistic tail, and since
openclaw#113266 stable rows keep insertion order, the first turn rendered below the
tool activity it kicked off. The handoff reconciler owns that head row, so
exclude it from the late tail.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: android App: android app: web-ui App: web-ui docs Improvements or additions to documentation extensions: codex extensions: copilot gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants