Skip to content

Long sessions open at their end: a tail-first window, the full read behind it - #877

Merged
SSFSKIM merged 5 commits into
masterfrom
ux-wave/tail-first-load
Nov 24, 2026
Merged

SSFSKIM merged 5 commits into
masterfrom
ux-wave/tail-first-load

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Nov 24, 2026

Copy link
Copy Markdown
Owner

A long session on this machine now opens at its end. Before, the engine host listed every subagent and then read the whole transcript from its first byte before it answered the newest window. On a 636 MiB transcript, the first window came back in about 3 s. It now comes back in 0.13 to 0.35 s, and it is identical as JSON to the window the full read gives.

  • Engine host, src/engine-host/fs/tail-first.ts: a session.events read that carries provisional: true is answered from the transcript's tail. The tail grows 8, then 32, then 128 MiB. Offsets and ids stay the file's own.
    • The tail's window is used only if it starts at a whole turn after one whole warm-up turn, and only if everything in it is rooted in the tail: branches, rewinds, tool results, notified tasks and the exit decision. Otherwise the next rung is read, and past the last rung, the whole file.
    • The subagent listing and the full read run behind the tail's answer.
  • Wire: WIRE_MINOR 63, and a new engine-host capability, engine.provisionalWindow. Main drops provisional for an older host that doesn't list it.
  • Renderer: only local sessions ask for a provisional window. When the full read is ready, the staged pager.refresh() swaps it in, so the rows on screen stay until the full window is whole. A jump or an older page that's in flight finishes first. Scheduled rows are keyed by store and id, so they aren't remounted when older crons arrive.
  • Not included: the seam of a running lane B session still waits for the full read. A tail can't place that seam reliably, and nothing would replace a wrong one later. A lane B session read from disk does take the fast path. The reasons are in the Decision Log of docs/doperpowers/plans/2026-10-30-long-transcript-window.md, dated 2026-11-24.

Gates at 06a5b22 (master 6304d31 merged in):

  • class 1a 45385499394, green; desk-web 45385493423, green.
  • The Mac lines below ran at 137a14e, which differs from this head only by master's one tracker row.
  • Mac: e2e:lane-a 26, e2e:transcript 52 (1 skipped) and e2e:agents 28 passed. No e2e fixture reaches the 8 MiB rung, so these are regression runs.
  • The measured bound, src/engine-host/fs/tail-first-bench.test.ts (unit:darwin), on a generated 300 MB transcript: before 710 ms, after 63 ms, the same 561 events (load 4.8). On the 636 MiB transcript that prompted this change, a local probe measured before 2.9–3.1 s and after 0.13–0.35 s, with the same window, compared as JSON.

High review: 4 P1 and 8 P2. All P1s and most P2s are fixed. Four are logged in docs/tech-debt-tracker.md, and the existing long-transcript row is updated.

Sminos-Session: ux-wave#10d85d03 (MAWS on macbook)

…pt's end

Opening a session read from disk waited for the engine host to list every
subagent and read the whole transcript from its first byte (about 3 s for a
636 MiB file) before answering a window that needs its last 1%.

- A `session.events` read with the new `provisional: true` (minor 62) is
  answered by a tail-first read (src/engine-host/fs/tail-first.ts): a quiet
  follow from the first line past size - rung, on rungs of 8, 32 and 128 MiB,
  its offsets and ids the file's own (the follower's new `startAt`).
  Follow.tailWindow takes the window only when the tail holds a turn before it,
  each rewind's target, each notified task's start and the chain's root;
  otherwise the next rung, and past the last the read from the start.
- Agent metas come from the agents written since the tail's first Agent tool
  use (SubagentReader.recent); the session's listing and the read from the
  start follow the tail (or 250 ms).
- The renderer asks for a provisional window for this machine's sessions, holds
  the follow's batches back while it is drawn, and at the follow's `following`
  rebuilds the key, staged, from the host's window. Scheduled rows are keyed by
  store and id, so rows already drawn keep their items when older ones arrive.
- Main sends `provisional` only to an engine host that lists
  engine.provisionalWindow.
- Lane B: historySeam places a live launch's seam from the same tail when it
  can.
- The follower now skips every record type it drops by its first key.
- A measured bound (unit:darwin): src/engine-host/fs/tail-first-bench.test.ts.

Sminos-Session: ux-wave#10d85d03 (MAWS on macbook)
- Follow.tailWindow: no record from the window on that the tail could not root
  (a branch walk or a rewind anchor reaching before the tail), even when a later
  compaction restarted the chain; a whole warm-up turn before the window; every
  tool result's call in the tail; a chain that says whether the end gets the
  synthesised exit.
- No tail for a session a follow already reads (its cut of the file) or that
  MAWS and a foreign process contest; a tail is dropped at its next rung once
  its read is answered without it or its app session is rebound.
- A follow that fails to start after the tail answered emits fs.followState
  error, and the renderer reads again.
- The renderer lets an older page or a jump in flight finish before the swap,
  and keeps what it took in.
- Lane B's seam goes back to the read from the start: a tail cannot place it
  reliably (Decision Log).
- Tracker: four shipped residues of the review.

Sminos-Session: ux-wave#10d85d03 (MAWS on macbook)
The transcript slot's and the shell's IPC-source tests pinned the open's
request; a session on this machine now asks for a provisional window.

Sminos-Session: ux-wave#10d85d03 (MAWS on macbook)
…omes minor 63

The subagent tell (#876) took WIRE_MINOR 62; session.events' provisional and
engine.provisionalWindow move to 63, the manifest and fingerprint written by
the generator with both.

Sminos-Session: ux-wave#10d85d03 (MAWS on macbook)
Sminos-Session: ux-wave#10d85d03 (MAWS on macbook)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T11:52:03.027871Z 06a5b22 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.

@SSFSKIM
SSFSKIM merged commit 22b9feb into master Nov 24, 2026
@SSFSKIM
SSFSKIM deleted the ux-wave/tail-first-load branch November 24, 2026 11:51
@SSFSKIM

SSFSKIM commented Nov 24, 2026

Copy link
Copy Markdown
Owner Author

Landed master-first as 22b9feb (parents 6304d31, 06a5b22; tree aa870c4c = the gated head's). Branch and worktree removed.

Sminos-Session: master-landing-architect#37052769 (MAWS on macbook)

SSFSKIM added a commit that referenced this pull request Nov 24, 2026
…tool card's retirement

Sminos-Session: ux-wave#10d85d03 (MAWS on macbook)
SSFSKIM added a commit that referenced this pull request Nov 24, 2026
…t) into question sheet C3

Tail-first took WIRE_MINOR 63; the sheet's namespace moves to 64 and the
pinned manifest and fingerprint are regenerated over master's.

Sminos-Session: question-sheet-design#23738737 (MAWS on macbook)
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