Skip to content

fix: preserve completed reasoning and refill chat snapshots - #188203

Merged
shakkernerd merged 4 commits into
mainfrom
ci-completed-assistant-projection
Oct 30, 2026
Merged

shakkernerd merged 4 commits into
mainfrom
ci-completed-assistant-projection

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #188181

What Problem This Solves

Completed reasoning-only attempts disappear from refreshed history. Version 12 display snapshots can preserve those omissions behind a current cursor.

User Impact

Saved reasoning and requested commentary remain available after refresh and reload. Genuinely empty completed rows stay hidden, including while failure recovery is pending. Unsent drafts are preserved.

Why This Change Was Made

Omit empty completed rows after the existing display projection, separately from final-answer recovery. Preserve the commentary source-visibility handling from #188180. Refill affected snapshots through the existing scoped cache owner, treating obsolete-record deletion as cache eviction so it does not cancel the live refill.

Evidence

Focused lint and type checks passed, along with 1,284 tests across 47 files on the integrated tree. Coverage includes history, recovery, cursor resets, visibility, media, current test inventories, and warm startup.

The stable-format warm-boot owner also passed all 10 cases, including reload, older history, drafts, attachments and held sends. The real-Gateway reload scenario and three affected browser files passed all 10 tests. Against 5310270, the canonical UI comparison measured startup JavaScript at 90,736 → 90,732 bytes, with three requests in both builds and unchanged limits.

Visual evidence

Open preview

View Before After
Cold history Original history missing eligible saved material Saved reasoning and commentary appear in order without empty bubbles
Affected snapshot reload Original history missing eligible saved material Saved reasoning and commentary appear in order without empty bubbles

History reload with the unsent draft preserved

history-reload.webm

Anonymous access to these GitHub media assets currently returns 404; public-access verification remains pending.

Visual verification

  • Baseline: 851a5ea (original reproduction, before the commentary repair in fix(gateway): preserve keyed commentary in refreshed history #188180)
  • Captured head: 749b08a08ff70cab0ef63b3d8013204342fe8656; the later commit only updates the warm-boot test expectation.
  • Scenario: Open synthetic saved history, reload an affected version 12 snapshot, then reload the current snapshot with an unsent draft.
  • Runtime/build: Linux x64; Node v24.22.1 launcher; real Gateway build with served UI asset bytes checked against the build.
  • Displayed history: Five expected message IDs in order; zero empty bubbles.
  • Affected snapshot: One full history request without a cursor.
  • Current snapshot: One cursor delta; saved material and draft remain.
  • Cold, affected-snapshot reload and current-snapshot reload assertions passed.
  • The original before capture predates fix(gateway): preserve keyed commentary in refreshed history #188180; it is not relabeled as the current target baseline.
  • The original browser baseline used a full request; separate direct and prewarmed owner tests reproduced the current-cursor defect.
  • Screenshots and all 130 frames of the reload recording were inspected; only synthetic data is shown.

@shakkernerd shakkernerd self-assigned this Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime size: M labels Oct 30, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Preserves completed reasoning and eligible commentary, removes genuinely empty replies after projection, and refills obsolete browser snapshots without cancelling active history loads.

Example: Reload saved history containing “Check the first source.” and the draft “Keep this unsent follow-up.”

  • Before: The reasoning can disappear, and a version 12 snapshot can retain that omission.
  • After: The reasoning returns in order, empty replies stay hidden, and the draft survives.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, focused repair with inspected shipped-UI evidence and no blocking finding; duplicate visibility coverage keeps the patch below A.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected real-Gateway Control UI screenshots show completed reasoning and commentary restored after cold history and affected-snapshot reload, with the draft preserved; supplied runtime results cover full refill followed by a current-cursor delta, and the subsequent head change only updates a test expectation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Saved reasoning disappears after refresh, and a current cached cursor can preserve the incomplete transcript display.
Reason: Restores intended saved-history behavior through existing owners; the maintainer-authored direction requires no additional product decision.

Regression provenance

Regression provenance — suspected predecessor, not a causality claim: source commit b957f1a761d7 by RoboClaw; no PR verified.

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR repairs a current history-display regression, resolves both earlier findings, and introduces no identified blocking defect; its red CI failures also occur on main.

Priority: P2
Reviewed head: e67c4296ea285fb21dd8f9632564788d28ca06d9

Before merge

None.

Findings

None.

Tests

  • Low-value test src/gateway/chat-display-projection.media.test.ts: Remove or consolidate the added completed-commentary visibility table: it exercises no media and repeats the existing source-silence, display-override, and commentary-retention contracts in chat-display-projection.test.ts.
Agent review details

How this fits together

The Gateway projects stored transcript rows into display history; the Control UI caches that projection and reconciles it through full history reads or cursor deltas.

flowchart LR
  A[Stored transcript] --> B[Recovery projection]
  B --> C[Display sanitization]
  C --> D[Completed row filtering]
  D --> E[History response]
  E --> F[Control UI transcript]
  F --> G[Scoped browser snapshot]
  G --> F
Loading

Technical review

Best possible solution:

Keep recovery matching separate from display admission and rebuild obsolete snapshots through the existing scoped cache owner.

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

Current-main source excludes reasoning-only completed rows before display projection, and the linked issue records failing owner and cursor fixtures; this review ran no target code.

Is this the best way to solve the issue?

The repair uses the existing projection and cache owners, preserves commentary silence rules, and avoids treating reasoning as a final answer that settles recovery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 5ed4aa230f89.

Provenance checked

  • Completed assistant filtering changes intended behavior with a stated reason (02b978b: Remove invisible completed attempts exposed by terminal-delivery QA while preserving failure recovery.)
  • Commentary visibility keeps the original intent (68fbe4a: Preserve eligible progress commentary without leaking silent-source content or making commentary settle recovery.)
  • Snapshot projection version keeps the original intent (767c17e: Refill disposable browser projections whose retained cursors hide recovered reasoning.)
  • Obsolete snapshot deletion changes intended behavior with a stated reason (bd10ba2: Invalidate obsolete disposable display projections; this PR uses the existing eviction reason to preserve the replacing live request.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit bd10ba2 adds ui/src/pages/chat/session-snapshot-store.ts:79 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: bd10ba29d338; files: ui/src/pages/chat/session-snapshot-store.ts)

PR surface

Source +12, Tests +487, Other +2. Total +501 across 12 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 3 36 24 +12
Tests 8 498 11 +487
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 12 536 35 +501

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Repairs omitted saved display material and persistent warm-cache omissions without evidence of canonical transcript deletion or a blocked core workflow.
  • 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.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-30T09:13:37.627Z sha bab6075 :: blocked before merge. :: [P2] Update the routing contract for the added Gateway browser test | [P2] Update the warm-boot assertion when advancing the snapshot version

Reviewed October 30, 2026, 9:11 AM ET / 13:11 UTC (Revision 2).

@shakkernerd
shakkernerd force-pushed the ci-completed-assistant-projection branch from bab6075 to 749b08a Compare October 30, 2026 10:33
@shakkernerd shakkernerd changed the title fix: preserve saved reasoning and commentary in chat history fix: preserve completed reasoning and refill chat snapshots Oct 30, 2026
@shakkernerd

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 30, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 30, 2026
@shakkernerd
shakkernerd merged commit 90d82c2 into main Oct 30, 2026
151 of 156 checks passed
@shakkernerd
shakkernerd deleted the ci-completed-assistant-projection branch October 30, 2026 13:46
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: saved reasoning and requested commentary survive history reloads, while genuinely empty completed rows stay hidden and unsent drafts are preserved.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 31, 2026
…#188203)

Preserve saved reasoning and requested commentary in completed history, omit genuinely empty completed rows, and refill affected display snapshots without losing unsent drafts.

Fixes openclaw#188181.
tideclaw-bot added a commit that referenced this pull request Nov 5, 2026
Backport accepted fixes onto 2026.11.5-beta.2.

Base: bc061f9
Canonical source tree before commit: e6c0c39

These are adapted/squashed backports; do not claim each is an exact Git cherry-pick.
Source provenance (selected verified commits; other cohorts use their frozen patch/adoption manifests):

runtime-B:
b20a0cc fix(macos): connect with configured credentials despite stale app environment (#191468)
c4c0942 fix(update): failed updates from 10.7–10.9 crash in automatic migration recovery (#189713)
6aae408 fix(update): preserve recovery errors and async triage callbacks (#191495)
8910654 fix(macos): prevent first-launch Gateway failures after upgrades (#191436)
00b2ff4 fix: parent sessions miss child approvals with a custom session store (#189827)
c6142a8 fix: avoid copying managed plugin binaries during Gateway startup (#187865)
e72b356 fix(anthropic): avoid token profile collisions (#187875)
807075d fix(anthropic): set API workspace at login (#186976)
bafe92f fix(exec): preserve no-timeout results from macOS app nodes (#190729)
9b05a64 fix(imessage): use a PostgreSQL-safe recovery cursor key (#184919)
6ba197f fix: session search on PostgreSQL scans every transcript row instead of using the text index (#187909)
4f49aa5 fix(sessions): PostgreSQL session search scans every transcript row again after the 5th search on a connection (#188979)
de3936c fix(macos): Mac tab shows a blank or stale page when a load fails (#185432)
e977080 fix(macos): prevent duplicate voice sends and false sent feedback (#186271)

provider-compaction:
1b43c2e fix(compaction): preserve active request provenance (#180214)
7b0cfe3 fix(google): restore tool calls with Python keyword parameters (#191561)
9039ceb fix(ci): keep compaction attribution helpers internal
d6a1327 feat(google): use the Interactions API for Gemini Flash models (#189395)
fe0f8d1 fix(google): Gemini models ignore configured topP (#190695)

history:
c51d733 fix(sessions): stop expanding archive reads from exhausting memory (#190690)
3c8bd4d fix(sessions): page oversized earlier history instead of failing at 8 MiB (#188450)
b195f61 fix(sessions): page oversized transcript history in both directions (#188483)
b65482e fix(gateway): preserve older history across hidden message gaps (#188557)
3d4fc94 fix(sessions): avoid oversized listing and imported-history reads (#189284)
33e7baf fix(sessions): bound active accounting without blocking writers (#190182)
682ade7 fix: preserve chat history continuation metadata (#188612)

runtime-C:
7e005b0 fix(macos): keep secrets when a Gateway config save fails (#187734)
15cf738 fix(macos): keep Gateway auth when Tailscale exposure is turned off (#187664)
b53a06b perf(update): read candidate state inventory without copying the shared database (#187921)
970fc4e fix: restore CLI message sends with agent tool policies (#188058)
73ad731 fix: stop model fallback when session capability metadata changes (#179312)
32305db fix: subagent turns fail after session metadata changes (#183501)
d13bd0f fix(codex): include relay conversation instructions in trajectory (#189005)
e375530 fix: replies after a plugin reload from Control UI go to the session's last external chat (#190982)
9346376 fix: reasoning-only retry is refused by Anthropic as reasoning_extraction (#184434)

direct-auth-state:
1b15408 fix(models): keep the model list when one plugin-owned provider lacks a credential (#189014)
7d8dc60 fix: recover startup migration with retained worker index (#189023)

capacity:
41772e3 fix(worktrees): settle completed disk debt on refused postchecks (#188727)

command-once-189369:
8269137 fix(plugins): plugin commands that continue the agent run three times on native command turns (#189369)

pg-board-189564:
7232a8d fix(boards): publish widgets with PostgreSQL storage (#189564)

queued-edit-189869:
92b32ca fix: hold queued messages through inline edits (#189869)

Preserve source attribution from original commits. For a genuinely exact individual pick only, use the conventional (cherry picked from commit <sha>) line.
Full file-level provenance: coverage-manifest.json; reviewed patch hashes: artifact-registry.json.
No held136/native82 content adopted by this work. No release or full-candidate qualification claim.

Additional original-source identities (exact adapted hunk scope is in frozen artifacts):
release-guides-185258: 39c37e6 docs(release): define ledger-first hotfix routing (#185258)
UI-history: 10a6e4f fix(ui): scope provider-add discovery warning to its own provider (#188541), 3d7b4c4 fix(ui): never fail loading earlier chat history without a boundary (#188372)
obsolete-cache-188203: 90d82c2 fix: preserve completed reasoning and refill chat snapshots (#188203)
webhook-169778: b1f643f fix(startup): keep webhook decisions startup recorded for channels Doctor left pending (#169778)
schema-lease-188391: ba6cfcd fix(state): keep lease renewal independent of parent admission (#188391)
backfill-188976: c75a8a8 fix(gateway): stop session row backfill once the Gateway is closing (#188976)
canonical-disable-188846: 88b56ee fix(config): auto-enable reads and writes mixed-case plugin policy under the canonical id (#188846)
matrix-177272: 5a6d22c fix(matrix): stop seeding new thread sessions from the room transcript (#177272)
provider-hook-189059: 0588f51 fix(models): isolate every per-provider catalog failure (#189059)
unicode-189868: 87396e7 fix(oc-path): avoid reading and editing a different Unicode key (#189868)
replay-cohort: 2031044 fix(sessions): acknowledge committed input retries without duplicate turns (#188527), 9114431 fix: resume configured fallback after interrupted attempts (#188672)

Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to clawhaven/openclaw that referenced this pull request Nov 23, 2026
Source commits: cd963a2 (openclaw#188341), 90d82c2 (openclaw#188203), 65602ab (openclaw#188148).

Release adaptation: formatting and import ordering only after bounded conflict resolution; no behavior changes or additional source hunks.

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 217f1dc819fe353d5a4ee38f0c14ef84c97d6aab)
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 gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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]: Completed assistant filtering drops saved reasoning and commentary

1 participant