Skip to content

fix(chat): page conversation history and reuse saved reading windows - #5069

Merged
reachjalil merged 2 commits into
devfrom
fix/paged-conversation-history
Sep 16, 2026
Merged

reachjalil merged 2 commits into
devfrom
fix/paged-conversation-history

Conversation

@reachjalil

@reachjalil reachjalil commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

Summary

Opening a long conversation should not download and prepare its entire transcript before the person needs it.

  • Open with a bounded native history page and request adjacent pages when the person scrolls toward them. Preserve the current visible message and offset when older rows arrive.
  • Save the engine-issued page cursor and cursor lineage with the reading anchor and geometry. Cold reopening reuses that page instead of issuing individual reads for each saved message; legacy saved positions retain their fallback.
  • Support the pinned OpenCode v1 and v2 pagination contracts, including cursor exposure through the workspace proxy, v2 chronological ordering, exhaustion, cancellation, and non-advancing cursor rejection.
  • Keep full-history reads on demand for Find, complete transcript copy, branching, revert/restore, and explicit navigation to the first message. Preserve live updates, sends from a middle page, and owner/credential isolation.
  • Extend the existing history journey for bounded opening, scroll pagination, saved-page cold restoration, and explicit full-history demand.

UI/UX impact

No label, layout, styling, or list-framework changes. History loads as it is needed, and saved reading positions reopen from their native page. Existing scroll anchoring and full-history actions are retained. This follows DESIGN.md P3 (progressive disclosure), P5 (reuse), and S5 (no unsolicited navigation). Real-size evidence below addresses P10.

Testing

Focused checks on head 4ef2d0743 using Node 24.11.1, pnpm 11.4.0, and Bun 1.3.4:

  • App history, native operations, scroll, snapshot owner-change, and render-state tests: 215 passed, 0 failed. These use component/DOM stand-ins and deterministic transport fixtures.
  • V2 message-pagination selection: 10 passed, 0 failed; 91 unrelated adapter tests were not selected.
  • Workspace proxy pagination and disconnect selection: 5 passed, 0 failed; 17 unrelated tests were not selected. Uses real local HTTP proxy boundaries with a mock engine (--conditions=development).
  • App and server typechecks passed. Evals typecheck passed: 466 source files.
  • git diff --check passed.
  • Required CI build/core checks and security review passed on this head.

Commands:

pnpm --filter @openwork/app exec bun test --isolate ./tests/opencode-session-native.test.ts ./tests/session-history.test.tsx ./tests/session-scroll.test.tsx ./tests/session-snapshot-owner-flip.test.tsx ./tests/session-render-state.test.ts
pnpm --filter @openwork/app exec bun test --isolate ./tests/opencode-v2-adapter.test.ts -t "OpenCode v2 message pagination"
pnpm --filter openwork-server exec bun test --conditions=development ./src/opencode-proxy.e2e.test.ts -t "native history pagination|history disconnect|revalidates"
pnpm --filter @openwork/app typecheck
pnpm --filter openwork-server typecheck
pnpm --dir evals typecheck

Visual evidence

Captured the real app renderer at commit 4ef2d0743543be8ff141960fd32f731b93d5467c, at 1440 × 900 in isolated local app-web with the native v1 engine. The existing long-history fixture creates 150 synthetic user-only messages through the engine no-reply API and holds ancillary status/todo reads. No personal conversation data or model execution is involved. Owned processes and temporary profiles were stopped and removed after capture.

Bounded initial page

The latest messages are visible. The capture observation recorded one initial request with limit=24 and no uncapped history read.

Latest bounded page of the synthetic long conversation

Reading older history

Scrolling into an adjacent page loaded 48 messages in total; the observed boundary anchor stayed at the same 16px offset when the older page arrived. This screenshot shows the subsequent reading position, with message 120 at a 24px offset in the scroll viewport.

Older conversation page with message 120 at the saved reading position

Saved reading position after reopening

After leaving the conversation, reloading the renderer, and reopening, the saved older-page cursor was reused. Message 120 is again at the observed 24px offset rather than jumping to the latest message.

Reopened conversation restored to message 120

Explicit navigation to the first message

Invoking the existing session.scroll_top action loaded all 150 messages and made the first message visible. No uncapped read was observed before this explicit action.

First conversation message after explicit full-history navigation

Remaining validation and known limits

  • These are supplementary real-app screenshot observations, not an execution of the updated automated history journey or a latency benchmark. Desktop/Daytona scrolling and Electron/v2 visual parity remain outstanding; no measured speedup is claimed.
  • The screenshot fixture is user-only and holds ancillary reads, so it does not establish live model execution, streaming mixed-content behavior, or production-scale performance.
  • An earlier broader adapter run failed the unrelated provider-catalog test because of an additional null Default option. The exact failure reproduced on clean dev at c4356f0a2; it is not changed here. Two non-failing React act warnings remain in the history harness.
  • Legacy saved anchors may still require the existing fallback. The progressive renderer is unchanged and can mount all history that the person explicitly loads.
  • This PR is not a merge or release confirmation.

@vercel

vercel Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Sep 16, 2026 10:16pm UTC
openwork-den Ready Ready Preview Sep 16, 2026 10:16pm UTC
openwork-diagnostics Ready Ready Preview Sep 16, 2026 10:16pm UTC
openwork-landing Ready Ready Preview, v0 Sep 16, 2026 10:16pm UTC

@github-actions

Copy link
Copy Markdown
Contributor

Passed · 12/12 tests · 18/18 assertions · 8 images

Commit 4ef2d0743543be8ff141960fd32f731b93d5467c · selected evidence

Open review report

@github-actions

Copy link
Copy Markdown
Contributor

Warden review summary — Clear

Native findings: 2. Blocking policy matches before consolidation: 0. Full finding text remains in Warden's native checks and review threads. This comment retains only native IDs, severity, skill attribution, and safe locations. Analysis run

Reported trigger coverage (not proof of complete repository or context coverage): diff-security-review (303890 ms), confidentiality-review (423272 ms), spec-provenance-review (464552 ms), desktop-den-sync-review (536655 ms), design-spec-review (709613 ms).

Blockers

  • None.

Advisories

  • 4G4-Z45 · low · design-spec-review
  • FB9-MWK · low · design-spec-review · apps/app/src/react-app/domains/session/surface/scroll-controller.ts:186

Needs recheck

  • None.

Observed review-thread metrics

  • Unique observed run attempts in retained window: 1
  • Distinct heads in retained window: 1
  • Current unresolved Warden threads: 1 of 1 observed
  • Observed resolved/unresolved transitions in retained snapshots: 0 / 0
  • First observed resolved/unresolved (state at first collection, not event time): 0 / 1
  • Precision: unavailable (no adjudications; no TP/FP values are inferred)
  • Observation window: 1/20 run attempts retained; truncated: false
  • Transition snapshot: 1/1 current attributed threads retained (limit 500); truncated: false

Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority.

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (4ef2d0743543be8ff141960fd32f731b93d5467c). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

This branch was successfully deployed

4 active deployments
Preview – openwork-landing — 4ef2d074 Deployed Sep 16, 2026 by vercel[bot]
Preview – openwork-app — 4ef2d074 Deployed Sep 16, 2026 by vercel[bot]
Preview – openwork-den — 4ef2d074 Deployed Sep 16, 2026 by vercel[bot]
Preview – openwork-diagnostics — 4ef2d074 Deployed Sep 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant