Skip to content

fix: webChat scrollback history is too limited — older assistant replies and tool outputs disappear when scrolling…#104250

Merged
steipete merged 4 commits into
openclaw:mainfrom
mikasa0818:feat/issue-92317
Jul 21, 2026
Merged

fix: webChat scrollback history is too limited — older assistant replies and tool outputs disappear when scrolling…#104250
steipete merged 4 commits into
openclaw:mainfrom
mikasa0818:feat/issue-92317

Conversation

@mikasa0818

@mikasa0818 mikasa0818 commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Related to #92317.

What Problem This Solves

Full filesystem history retained the nearest compaction marker before the selected active transcript branch, but the byte-offset pagination index selected branch nodes only. On affected branched transcripts, full history exposed three visible rows while pagination omitted the compaction row, reported a lower totalMessages, shifted sequence IDs, and could never retrieve the boundary at any offset.

Why This Change Was Made

One canonical transcript-history selector now owns the invariant: when explicit branch selection is active, return the selected path plus the nearest preceding compaction marker. Both bounded/full readers and the byte-offset index use that selector before projecting messages or assigning sequence numbers.

The selector accepts one entries array plus a recordOf projection, so wrapper entries and parsed records cannot drift out of alignment. The index's old duplicate parentId normalization map and traversal were removed.

This is intentionally narrower than #87111: it changes no WebChat UI, public protocol, cursor, config, persistence format, or page-size policy. The broader pagination PR must retain this shared selector when integrated.

User Impact

Paginated history can reach the same compaction boundary as full history, and totalMessages/sequence metadata now describe the same visible active transcript.

Evidence

  • node scripts/run-vitest.mjs src/gateway/session-utils.fs.test.ts — 70 passed.
  • node scripts/run-vitest.mjs src/config/sessions/transcript-tree.test.ts — 18 passed.
  • The real JSONL regression excludes abandoned/side branches, returns the compaction row at the oldest offset, and asserts consistent totals and sequence values.
  • node scripts/check-changed.mjs -- src/config/sessions/transcript-tree.ts src/gateway/session-transcript-index.fs.ts src/gateway/session-utils.fs.ts src/gateway/session-utils.fs.test.ts — passed on Blacksmith Testbox tbx_01ky1ny21d3x4y9jdvwbhgw0a7, run 29807268988.
  • Full-branch AutoReview — clean, no accepted/actionable findings (0.94 confidence).
  • git diff --check — passed.

Contributor credit is preserved in mikasa's original commits.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S labels Jul 11, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Jul 11, 2026
@clawsweeper

clawsweeper Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 11, 2026, 1:52 PM ET / 17:52 UTC.

Summary
The PR adds a shared active-transcript selector, adopts it in bounded and indexed filesystem history readers, and tests that pagination can retrieve the preceding compaction marker with consistent sequence metadata.

PR surface: Source -4, Tests +65. Total +61 across 4 files.

Reproducibility: yes. at source level. Current main's index selects only active branch nodes while the full reader also retains the nearest preceding compaction row, deterministically producing count and sequence divergence for the supplied branched JSONL scenario.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: serialized state: src/config/sessions/transcript-tree.ts, serialized state: src/gateway/session-transcript-index.fs.ts, serialized state: src/gateway/session-utils.fs.test.ts, serialized state: src/gateway/session-utils.fs.ts, unknown-data-model-change: src/gateway/session-utils.fs.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #92317
Summary: This PR is a narrow candidate fix for one indexed-history inconsistency within the broader WebChat history report.

Members:

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

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • [P1] Merging intentionally adds a previously omitted compaction row to indexed history, increasing totalMessages and shifting visible sequence metadata for affected branched transcripts.

Maintainer options:

  1. Accept the corrected history identity (recommended)
    Merge with awareness that affected branched transcripts gain one visible compaction row and their indexed counts and sequence values become consistent with the full reader.

Next step before merge

  • No automated repair is needed; the PR is ready for ordinary maintainer merge review of the intentional session-history identity correction.

Security
Cleared: The focused patch changes transcript selection and tests only, with no dependency, workflow, permission, secret, network, package-resolution, or artifact-execution concern.

Review details

Best possible solution:

Use the shared selector so full, bounded, count, and paginated filesystem readers derive visible rows and sequence metadata from one active-branch-plus-compaction invariant.

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

Yes at source level. Current main's index selects only active branch nodes while the full reader also retains the nearest preceding compaction row, deterministically producing count and sequence divergence for the supplied branched JSONL scenario.

Is this the best way to solve the issue?

Yes. Centralizing the established full-reader invariant removes competing traversal logic and fixes pagination at the shared source without changing protocol, persistence, configuration, or fallback behavior.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: The PR fixes a limited but real history-pagination inconsistency without evidence of data loss or runtime unavailability.
  • merge-risk: 🚨 session-state: The patch intentionally changes visible transcript membership, total counts, and sequence identities for affected branched sessions.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR supplies after-fix production-reader output from a real on-disk branched JSONL transcript, including before-and-after totals, sequence values, offsets, and focused suite results.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR supplies after-fix production-reader output from a real on-disk branched JSONL transcript, including before-and-after totals, sequence values, offsets, and focused suite results.
Evidence reviewed

PR surface:

Source -4, Tests +65. Total +61 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 3 46 50 -4
Tests 1 65 0 +65
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 111 50 +61

What I checked:

  • Current-main inconsistency: The current index constructs its active view from branch nodes only, while the bounded reader separately searches backward for the nearest preceding compaction row. (src/gateway/session-transcript-index.fs.ts:199, 04037e35c03e)
  • Canonical selector: The new helper delegates ancestry selection to the existing normalized, cycle-safe path selector and adds the same preceding-compaction rule already used by the bounded reader. (src/config/sessions/transcript-tree.ts:257, 6d0dafa4dffd)
  • Index integration: The index supplies position-aligned raw entries and record projections to the shared selector before assigning visible sequence values. (src/gateway/session-transcript-index.fs.ts:264, 6d0dafa4dffd)
  • Regression guardrail: The added real-JSONL fixture verifies active and side-branch filtering, a reachable compaction row, totalMessages, sequence values, and pagination offsets through the production reader. (src/gateway/session-utils.fs.test.ts:1829, 6d0dafa4dffd)
  • Focused patch and merge result: The contributor's three commits modify only four transcript-reader/test files, pass diff checking, and produce a conflict-free merge tree against current main. (6d0dafa4dffd)
  • Feature-history provenance: Adjacent Gateway history pagination and sequence work traces to Eva, while long-term contribution history across the central session files is led by Peter Steinberger; the latest broad snapshot containing the current tree implementation was integrated by Vincent Koc. (src/gateway/session-utils.fs.ts:419, aaf530763839)

Likely related people:

  • 100yenadmin: Eva authored several merged Gateway session-history changes concerning sequence-based cursors, transcript snapshots, and pagination semantics. (role: adjacent cursor-pagination contributor; confidence: high; commits: aaf530763839, dea515e833f2, d519f39c6e4a; files: src/gateway/sessions-history-http.ts, src/gateway/sessions-history-http.test.ts)
  • steipete: Git shortlog shows the largest historical contribution count across the transcript tree, index, and session utility files. (role: long-term gateway area contributor; confidence: medium; files: src/config/sessions/transcript-tree.ts, src/gateway/session-transcript-index.fs.ts, src/gateway/session-utils.fs.ts)
  • vincentkoc: The current and latest shipped snapshots containing the central transcript-tree implementation are attributed to Vincent Koc, although both commits are broad repository integrations. (role: recent integration contributor; confidence: low; commits: fc1a793ea0e4, e085fa1a3ffd; files: src/config/sessions/transcript-tree.ts, src/gateway/session-transcript-index.fs.ts, src/gateway/session-utils.fs.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (5 earlier review cycles)
  • reviewed 2026-07-11T07:36:34.323Z sha 803ba9b :: needs maintainer review before merge. :: none
  • reviewed 2026-07-11T16:42:00.916Z sha 5f8e58f :: needs changes before merge. :: [P2] Reuse one canonical active-transcript selector
  • reviewed 2026-07-11T16:50:01.622Z sha 5f8e58f :: needs changes before merge. :: [P2] Reuse one canonical active-transcript selector
  • reviewed 2026-07-11T17:22:39.380Z sha ddde33b :: needs changes before merge. :: [P2] Remove the obsolete transcript-path selector import
  • reviewed 2026-07-11T17:44:03.415Z sha 6d0dafa :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added 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. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. and removed 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. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Jul 11, 2026
@mikasa0818

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 11, 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: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor 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 Jul 11, 2026
@steipete steipete self-assigned this Jul 21, 2026
@clawsweeper

clawsweeper Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix: webChat scrollback history is too limited — older assistant replies and tool outputs disappear when scrolling… This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete
steipete merged commit 29a69e6 into openclaw:main Jul 21, 2026
122 of 123 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

vincentkoc added a commit that referenced this pull request Jul 21, 2026
* origin/main: (24 commits)
  fix(agents): keep compaction on live session model (#95713)
  fix(plugin-sdk): guard provider catalog live URL parsing against malformed responses (#109986)
  chore(cli): drop dead classifiers and single-use wrappers left by fallback removal (#112191)
  feat(ui): expand the lobster pet's random universe (#112073)
  chore(ci): audit dependency fingerprint exports (#112190)
  fix(ui): preserve graphemes in provider icons (#109509)
  fix(ui): align settings search with navigation rows (#112172)
  fix(agents): allow configless gateway rebind to activate standalone owner (#111841)
  fix(secrets): register secret targets for installed-origin plugins (#104347)
  improve(ui): show real machine identity in the place picker (#112162)
  fix: webChat scrollback history is too limited — older assistant replies and tool outputs disappear when scrolling… (#104250)
  test(ui): run DOM-free suites in Node (#112031)
  feat(nodes): make computer.act eligibility capability-based for desktop nodes (#112107)
  fix(apps): harden mobile gateway and watch state
  fix(ci): restore Z.AI API Platform validation (#112171)
  fix(ui): prevent Logs controls from overlapping (#112170)
  fix #95291: message tool fails to deliver files/images on Feishu (400 volc-dcdn / write ECONNRESET) while same Lark SDK upload succeeds standalone (#95514)
  refactor(cli)!: remove automatic gateway→embedded fallback from openclaw agent (#112074)
  refactor: move provider transports into packages/ai behind a typed host port (#111669)
  fix(anthropic): complete transcript reverse-scan windows across short reads (#109431)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 22, 2026
…ies and tool outputs disappear when scrolling… (openclaw#104250)

* fix(gateway): keep compaction marker in paginated history

* refactor(gateway): share active transcript selection

* fix(gateway): remove stale selector import

* refactor(gateway): remove duplicate transcript ancestry state

---------

Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime 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. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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.

2 participants