Skip to content

Session History: desktop lists large transcripts from their ends; those rows hide their message count - #28927

Closed
brennanb2025 wants to merge 3 commits into
brennanb2025/scan-bounded-readfrom
brennanb2025/scan-partial-rows-desktop
Closed

brennanb2025 wants to merge 3 commits into
brennanb2025/scan-bounded-readfrom
brennanb2025/scan-partial-rows-desktop

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2
Prod 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​26 $\color{#cf222e}{\Huge{\mathbf{−}}}$​12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​14

ELI5

Session History used to read every long agent transcript from start to finish to draw one row. It now reads only the start and the end of a big transcript, which is all a row needs. The one thing it can't know that way is how many messages the session has, so those rows simply don't show a message count.

Stacked on #28925, which adds the mechanism and changes nothing visible on its own.

What Changed

Problem. The list reads whole transcripts whenever it has to rebuild a row: on a first scan, after a restart for any file that changed while Orca was closed, and when a file's append position is lost. On a heavy user's machine the newest 500 transcripts are about 1.6 GB, and that read is most of a cold scan.

Before / after for the user. For a transcript larger than 320 KB being read fresh:

  • Title, folder, branch, model, start time, last-active time and row order are unchanged.
  • The "N msgs" label is no longer shown on that row. Smaller files, files already cached whole, and files the search index re-reads still show it.
  • The hover preview only shows messages from the end of the file. For long Codex sessions that is often one or two messages, and the "latest prompt" hint is usually absent. Both show as unknown rather than wrong.
  • Subagent counts, the "Not saved" badge and the resume buttons are unchanged. Empty sessions are always read whole.

Mechanism.

  • The desktop and browser clients advertise aiVault.list.partial-rows.v1, both to their own host (the local list path) and to remote runtime hosts.
  • The Session History row hides the message count when contentCoverage is set.
  • Tab-title lookups also accept partial reads, so naming a tab never reads a huge transcript whole.
  • The persisted parse-cache version moves to 5, so an older build after a downgrade discards the file instead of showing partial counts as exact. Upgrading costs one rebuild, and that rebuild is now the cheap kind.

Why

The common pattern for a list of agent sessions is to read only the start and end of each file. A count that read can't know is left out rather than guessed. The alternatives considered in #28925 (paging, worker threads, reading Codex's own database) complement this rather than replace it.

The phone app keeps exact rows until it opts in (follow-up PR). Until then, a paired phone's scans still read whole files.

Linked Issue

N/A (internal performance lane).

Visual Proof

Before: both rows show a message count, including the 640 KB transcript.
Before

After: the 640 KB transcript's row has no message count; the small session still shows "6 msgs". Title, time and agent are unchanged.
After

Testing

  • Bench on a Linux machine: a synthetic history of 500 Codex and 700 Claude transcripts (1.4 GB, Codex first prompt 60–125 KB in), forked scanner child with production flags, n=3:
    • cold scan 735 → 265 ms (745/729/735 vs 265/262/273);
    • bytes read 294.6 → 80.1 MB; CPU 1,228 → 429 ms; peak RSS 122 → 104 MB;
    • warm rescan and rescan-after-append unchanged (18–20 ms);
    • all 250 rows match the base in order, title, folder, model, start and last-active time; 149 rows were read partially.
  • Typecheck node/web/cli, oxlint, the changed-code quality gate and oxfmt pass. These ran on a Linux machine.
  • Rendered UI check on a macOS test build (see Visual Proof).

…s and hides those rows' counts

The desktop and browser clients advertise aiVault.list.partial-rows.v1, the
local list path accepts partial rows, the Session History row shows no message
count for a partial row, title lookups read partially, and the persisted parse
cache version is bumped so an older build never reads partial rows as exact.
@brennanb2025
brennanb2025 marked this pull request as ready for review October 15, 2026 03:18
@OrcaWin

OrcaWin commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

Closing after reviewing the complete final-head diff, changed tests, description and current-main implementation against the performance tradeoff standard in #27143.

The description's 735→265 ms / 294.6→80.1 MB benchmark describes the former head/tail design. Final head 5c77b9ccf79a8891e83ef707bd2d3edba929a7d7 instead reads every record: readPartialTranscript delegates to the full-span reader. It adds a 199-line selective JSON tokenizer, asynchronous per-line decoding, partial-row capability/cache rules and count hiding. The new equality tests explicitly require the full row, including the complete message count, to match the ordinary parser except for the partial marker. Current main already computes those complete rows, including metadata changed in the middle of a transcript.

I compared exact production consumeCompleteJsonlLines and parser-state callbacks from main 875d89af50f7c5aa84bc75b3910d713124f1c3ef and this head on Linux, Node 26.8.1 / SQLite 3.53.4. Four synthetic JSONL files each contain 500 approximately 32 KiB records: Claude/Codex crossed with a large ignored field or retained message text. Three samples after warmup, page-cache-warmed reads, and main's byte-prefix callback enabled where provided:

Workload Main median elapsed PR median elapsed
Claude, ignored field 17.0 ms 53.3 ms
Claude, message text 18.9 ms 56.8 ms
Codex, ignored field 16.7 ms 50.5 ms
Codex, message text 23.5 ms 56.4 ms

Each pair read exactly the same approximately 16.4 MB and returned deeply equivalent rows apart from contentCoverage. CPU also increased on these workloads. An independent parser-only probe agreed. This measures the production reader/parser seam on synthetic files; it excludes scanner discovery, cache persistence, workers and rendered UI, and is not a whole-application performance claim.

The final mechanism therefore gives up neither file I/O nor required row construction, introduces substantial parser/protocol/cache complexity, and increases measured work on the tested paths. Cooperative cancellation during one large tokenized record is a real incidental benefit, but does not justify this list-only decoding design and count-hiding policy. The obsolete head/tail numbers cannot justify the final implementation. No independent still-missing correctness or user feature remains against main's complete parser. The branch is preserved; the Session History performance objective remains worthwhile with a different design.

@OrcaWin OrcaWin closed this Oct 27, 2026
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.

2 participants