Skip to content

fix: omit numeric continuation metadata from centered history - #188612

Merged
shakkernerd merged 1 commit into
mainfrom
ci-history-pagination-response-contract
Oct 30, 2026
Merged

shakkernerd merged 1 commit into
mainfrom
ci-history-pagination-response-contract

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

chat.history adds numeric hasMore metadata to centered and retained cursor reads when an older source-bound cursor exists. These responses intentionally omit numeric paging metadata; clients continue with their source-bound cursors.

User Impact

Centered and retained reads keep their valid cursors and omit numeric continuation metadata. Default-tail and explicit-offset reads retain numeric continuation, including real exhaustion and response-budget trimming. The Control UI keeps its existing cursor-based history loading.

Why This Change Was Made

The response owner now selects numeric metadata from the page's numeric pagination capability. Cursor availability is independent of that capability. The reader's exhausted-prefix result and response-byte trimming still determine whether a numeric page has older rows.

This preserves the landed numeric continuation and hidden-gap repairs in #188488 and #188557. It restores the original centered omission assertion and strengthens the existing retained-reset scenario without adding test lines. Cursor generation, admission, storage and asynchronous ownership are unchanged. The existing client documentation already describes this contract.

Evidence

  • Current-target production fails the protected centered Gateway assertion and retained-cursor omission assertion; its byte-trimmed numeric preservation control passes.
  • All 307 affected Gateway, worker, import, embedded and TUI cases pass, including the complete older-walk/no-loss tails, cursor/byte/fragment bounds, hidden/tool-only exhaustion and malformed/stale/wrong-session refusal.
  • All 12 selected UI unit/browser cases pass, including the full normal history-loading suite.
  • All 8 existing serialized RPC request-budget cases pass.
  • All 38 selected type graphs, changed-file formatting/lint and the unchanged zero-growth test-line guard pass. This is focused proof; hosted CI supplies broad coverage.

UI fixtures demonstrate preservation of the normal history-loading path; real Gateway/RPC tests establish the response contract.

Visual evidence

Open preview

Before After
Historical baseline: both older messages loaded using source-bound cursors Exact candidate: both older messages remain visible after cursor back-scroll

Exact-head upward wheel and older-message loading

[email protected]

Visual verification

  • Baseline: 4591070 (historical pre-repair UI, tree e112d34487864cb5d2882aec43d6e3ef75a78f80)
  • Exact head: 17b81a1922a58df20e4beae21d1c6208048967ba
  • Scenario: From a hidden-activity tail, wheel upward100px to load two older messages. Historical before and exact-head after demonstrate preservation of the settled UI flow; real Gateway/RPC tests establish the invisible response-metadata repair.
  • Runtime/build: Fresh Control UI build from candidate tree e8bee624e15a6d16886aee0fd2eaff18e33324f6; 2641 served assets hashed.
  • Input: Wheel upward100px over the thread
  • History requests: older-80, older-160, older-180; zero numeric offsets
  • Result: Both older messages visible; no welcome panel
  • Same1280×480 viewport, scale1, light theme, en-US, typed fixture and wheel input
  • Qualitative preservation comparison only; upstream boot/skeleton changes prevent pixel or startup-timing claims
  • Source-bound cursor requests and visible messages asserted by the existing normal history-loading owners
  • Fresh build/capture tree equals the exact candidate tree

@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 gateway Gateway runtime size: XS labels Oct 30, 2026
@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. P2 Normal backlog priority with limited blast radius. 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-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 preserves numeric history continuation without message IDs and omits numeric pagination metadata from cursor-only responses.

Example: A 1024-byte history response retains sequence 2 but trims sequence 1, and neither row has a message ID.

  • Before: The response reports hasMore=false and provides no nextOffset.
  • After: The response reports hasMore=true and nextOffset=1, allowing the older row to be requested.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The introduced repair is focused and has no definite correctness finding; validation is principally reported harness evidence, and the branch conflicts with overlapping merged repairs.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its evidence reports Gateway regression runs, while the available screenshots demonstrate only the linked UI repair.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Clients can stop fetching older legacy history despite valid numeric positions and remaining rows.
Reason: The original failure is concrete and the maintainer-authored direction is established, although merged follow-ups now cover its central repair.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open for author reconciliation: current main already repairs numeric continuation, while this PR retains a distinct metadata-omission change and regression coverage; GitHub reports a conflict, and no definite introduced correctness defect was found.

Priority: P2
Reviewed head: f9054942cb764c7e0d48821412c46af177b1e475

Before merge

  • Complete next step - Resolve the reported merge conflict while preserving main's legacy and hidden-gap repairs, and align centered-page assertions with the final response contract.

Findings

None.

Tests

  • Missing end-to-end proof: The body reports red/green Gateway suites, but supplies no shipped-entry-point trace of ID-less numeric traversal or cursor-only metadata omission; the inspected screenshots cover the earlier UI repair.
Agent review details

How this fits together

The Gateway response owner converts projected transcript pages into byte-bounded messages, source cursors, and numeric continuation metadata consumed by history clients.

flowchart LR
  A[Transcript readers] --> B[History page kernel]
  B --> C[Projected messages and reader boundaries]
  C --> D[Response budgeting]
  D --> E[Source cursors and numeric metadata]
  E --> F[Gateway history clients]
Loading

Technical review

Best possible solution:

Preserve main's merged continuation repairs and reduce this PR to its remaining metadata contract and distinct regression coverage.

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

The pinned base predicate demonstrably suppresses numeric continuation when an anchor has no encodable message ID; current main already repairs that path, and no target code was executed during this review.

Is this the best way to solve the issue?

The introduced patch is a small repair in the existing response owner, but its remaining centered-page omission differs from the subsequently merged contract and must be reconciled during conflict resolution.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against cd718f0f32a4; fix evidence: commit b65482ef56e9, main fix timestamp 2026-10-30T18:29:31Z.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +1, Tests +27, Other +2. Total +30 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 6 5 +1
Tests 2 27 0 +27
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 4 35 5 +30

Labels

Label changes:

  • add P2: This is a limited history-pagination contract repair whose central user-visible failure is already addressed on main.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This is a limited history-pagination contract repair whose central user-visible failure is already addressed on main.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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, 2:53 PM ET / 18:53 UTC.

@shakkernerd shakkernerd self-assigned this Oct 30, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Oct 30, 2026
@shakkernerd
shakkernerd force-pushed the ci-history-pagination-response-contract branch from f905494 to 17b81a1 Compare October 30, 2026 19:35
@shakkernerd shakkernerd changed the title fix: older history stops paging when source IDs are missing fix: omit numeric continuation metadata from centered history Oct 30, 2026
@shakkernerd
shakkernerd merged commit 682ade7 into main Oct 30, 2026
139 of 141 checks passed
@shakkernerd
shakkernerd deleted the ci-history-pagination-response-contract branch October 30, 2026 20:06
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: centered and retained chat history now omit numeric continuation metadata while preserving source-bound cursors.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 31, 2026
Centered and retained chat history responses now omit numeric continuation metadata while preserving numeric paging and source-bound cursors.
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

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS 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