Skip to content

fix(ui): never fail loading earlier chat history without a boundary - #188372

Merged
steipete merged 1 commit into
mainfrom
codex/history-never-fails-boundary
Oct 30, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/history-never-fails-boundary

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes the Team-reported “History has no usable older boundary” toast and inline “Couldn't load earlier messages” failure. The first loaded row was an activity summary without a native source ID, while the Gateway could report hasMore=true after its raw reader had consumed an older hidden prefix.

User Impact

Tool-only chats keep their loaded activity without an error or an earlier-history control when nothing can anchor a request. Valid older history remains loadable through the server cursor or the oldest loaded native source, even when synthetic activity comes first.

A cached window with no cursor or native source waits for an authoritative refresh; it remains partial internally. No config option, persisted shape, retention policy, dependency, protocol version, or migration changes.

Why This Change Was Made

The Gateway's existing source cursor now owns continuation availability for anchored pages; visible message counts cannot manufacture more history. The UI uses one nullable selector for rendering and request admission, with shared native-source selection in the history identity owner. Cache-boundary reopening checks that same oldest source.

Evidence

Pre-rebase regression proof on the original implementation:

  • UI owner: 4 failures covering synthetic-prefix reopening and silent handling of an unanchored page.
  • Native Control UI runner with a mocked Gateway: 1 failure, reproducing the inline earlier-history error on a tool-only page.
  • Gateway owner: 1 failure / 1 pass with a two-message limit, proving the hidden prefix was consumed while the tool-only survivor still produced hasMore=true. The earlier one-message-limit fixture was discarded because it legitimately retained a continuation.

Focused green proof before the rebase and shared identity-owner extraction:

  • 63 UI owner/autofill/native-history tests passed, wrapper wall 166.15s.
  • 4 native Control UI e2e tests passed, including actual read-error retry, keyboard focus, and bounded hidden-page traversal; 8.110s test time / 54.95s Vitest wall.
  • 25 Gateway cursor/byte-budget tests passed, 498.59s Vitest / 569.15s wrapper wall. The existing worker-backed integration suite took 121.506s summed test time; the new tool-only case took 5.597s.

After rebase: touched-file formatting and git diff --check pass, as does the bounded UI production typecheck (tsconfig.ui.json). The commit hook's line-cap check passes after sharing the boundary selection owner. Net test LOC remains zero; no baseline or budget increases.

Earlier local lint/typecheck attempts were blocked by host saturation (load around 107), including a declaration-build prerequisite timing out at 300,000 ms. Full lint/typecheck were not retried locally. PR CI is the broad proof for lint, remaining typecheck lanes, and the final rebased head. The bounded post-rebase UI production check completed successfully.

One committed-branch Codex autoreview was attempted with --mode branch --base origin/main --engine codex (default P0 scope). It was unavailable at the isolated temporary-directory preflight despite unsetting temporary-directory overrides; the reviewer did not start and there is no clean-review verdict. No review retry was made, per coordinator direction.

Before — synthetic tool-only page reports an earlier-history error

Before: invalid earlier-history retry above synthetic tool activity

After — loaded tool activity remains, with no invalid earlier-history control

After: synthetic tool activity without the invalid paging control

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T13:37:13.990030Z 330ff21 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime size: S 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. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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. 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 changes before merge.

What this changes

This PR derives history continuation from source cursors and hides earlier-history controls when no loaded source can anchor a request.

Example: A tool-only conversation displays a read of synthetic.txt without a cursor or native source ID.

  • Before: The UI offers earlier history and then displays “Couldn't load earlier messages.”
  • After: The loaded tool activity remains visible without the invalid paging control or error.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The visible repair has credible proof and green exact-head CI, but an introduced empty-state regression needs correction.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after screenshots exercise the real Control UI with a mocked Gateway: synthetic tool activity remains visible and the invalid retry boundary disappears; Gateway continuation and synthetic-prefix reopening are supported by the reported owner regressions rather than live Gateway media.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Tool-only history can offer an earlier-history action that immediately fails despite the loaded activity remaining usable.
Reason: The reported failure is concrete, and the maintainer-authored direction repairs it without new configuration or persistent formats.

Merge readiness

⛔ Needs changes before merge - 2 items remain

This PR addresses a concrete history-loading failure, but introduces an empty-state regression by treating an unavailable paging boundary as a complete conversation.

Priority: P2
Reviewed head: 330ff2112eb8bdfeb1fb7b55e86d11357a2b6439

Before merge

  • Preserve incomplete-history state when hiding the paging control (P2) - For an unanchored partial window, such as tool-only cached history with tool activity hidden, the selector returns null even though state.chatHistoryPagination.hasMore remains true. This change then omits historyPagination from the transcript props. chat-transcript-projection.ts:204–208 interprets that omission as no remaining history, and chat-thread-view.tsx:191–192 renders ChatWelcome when there are no displayable rows. An existing conversation is therefore presented as empty while its authoritative history is still unresolved. Keep boundary availability separate from the completeness fact used by the empty-state owner, and cover this partial-window case without restoring the invalid paging control.
  • Explain or restore the original intent of Incomplete-window presentation - fix(control-ui): stop paging older history during reload #171009: Avoid presenting an incomplete or preference-hidden history window as a new conversation.

Findings

  • [P2] Preserve incomplete-history state when hiding the paging control — ui/src/pages/chat/chat-pane-render.ts:204-206

Provenance

Tests

  • Missing end-to-end proof: The supplied browser scenario does not cover an unanchored partial window with no displayable rows and verify that the new-chat welcome screen stays absent.
Agent review details

How this fits together

Gateway history projection converts stored transcript rows into bounded messages and continuation cursors; the Control UI combines those results with cached history to render conversations and request earlier pages.

flowchart LR
  A[Stored transcript] --> B[Gateway history projection]
  B --> C[Response messages and cursors]
  C --> D[UI history state]
  D --> E[Older boundary selector]
  E --> F[History controls and requests]
  D --> G[Transcript empty state]
Loading

Technical review

Best possible solution:

Keep the shared nullable boundary selector while passing history completeness independently to the transcript’s empty-state owner.

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

Source inspection establishes both the original boundary failure and the introduced empty-state path; supplied screenshots reproduce the original visible error, but no fresh execution was performed during this review.

Is this the best way to solve the issue?

The Gateway correction and shared UI selector fit existing owners, but selector availability must not replace the separate fact that the loaded history remains incomplete.

Full review comments:

  • [P2] Preserve incomplete-history state when hiding the paging control — ui/src/pages/chat/chat-pane-render.ts:204-206
    For an unanchored partial window, such as tool-only cached history with tool activity hidden, the selector returns null even though state.chatHistoryPagination.hasMore remains true. This change then omits historyPagination from the transcript props. chat-transcript-projection.ts:204–208 interprets that omission as no remaining history, and chat-thread-view.tsx:191–192 renders ChatWelcome when there are no displayable rows. An existing conversation is therefore presented as empty while its authoritative history is still unresolved. Keep boundary availability separate from the completeness fact used by the empty-state owner, and cover this partial-window case without restoring the invalid paging control.
    Confidence: 0.94

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 90d82c2c9bf2.

Provenance checked

  • UI source-bound selectors and cache reopening keeps the original intent (fix(ui): older history skips messages after new replies #187219: Use admitted source boundaries instead of moving offsets, preserve held rows, and reopen trimmed caches without skipping history.)
  • Gateway continuation calculation changes intended behavior with a stated reason (df12738: Budget large history replies while retaining pagination; subsequent source cursors account for rows consumed before display filtering.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm exec vitest run --config ui/vitest.config.ts ui/src/pages/chat/chat-pane-history.test.ts ui/src/pages/chat/components/chat-transcript-controller.test.tsx
  • pnpm exec vitest run --config ui/vitest.e2e.config.ts ui/src/e2e/chat-history-loading.e2e.test.ts
  • git diff --check

What I checked:

PR surface

Source +16, Tests 0, Docs +2. Total +18 across 10 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 6 36 20 +16
Tests 3 60 60 0
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 10 98 80 +18

Labels

Label changes:

  • add P2: The original paging error and introduced empty-conversation presentation affect a limited chat-history flow without demonstrated data loss.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: The original paging error and introduced empty-conversation presentation affect a limited chat-history flow without demonstrated data loss.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • 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.

Reviewed October 30, 2026, 9:51 AM ET / 13:51 UTC.

@steipete
steipete merged commit 3d7b4c4 into main Oct 30, 2026
142 of 145 checks passed
@steipete
steipete deleted the codex/history-never-fails-boundary branch October 30, 2026 13:55
steipete added a commit that referenced this pull request Oct 30, 2026
Keep consumed raw source boundaries for cursors without skipping visible rows omitted by page limits. Preserve the numeric-offset contract for ID-less transcripts while terminating fully consumed hidden prefixes. Follow-up to #188372, compatible with #188483.
steipete added a commit that referenced this pull request Oct 30, 2026
)

Keep consumed raw source boundaries for cursors without skipping visible rows omitted by page limits. Preserve the numeric-offset contract for ID-less transcripts while terminating fully consumed hidden prefixes. Follow-up to #188372, compatible with #188483.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 31, 2026
…penclaw#188372)

Loading earlier history no longer throws "History has no usable older boundary" when the first loaded row is a tool activity summary. The Control UI prefers the Gateway cursor, otherwise anchors on the oldest loaded entry with a native source (including entries grouped into activity summaries), and otherwise hides the earlier-history control without an error.

The Gateway no longer reports hasMore after its raw reader has consumed a hidden prefix and returned no older cursor; anchored pages now use the usable cursor as the continuation authority.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 31, 2026
…claw#188557)

Keep consumed raw source boundaries for cursors without skipping visible rows omitted by page limits. Preserve the numeric-offset contract for ID-less transcripts while terminating fully consumed hidden prefixes. Follow-up to openclaw#188372, compatible with openclaw#188483.
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]>
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 docs Improvements or additions to documentation 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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant