feat(terminal): keep recent sessions warm - #195
Conversation
Ark0N
commented
Aug 5, 2026
Hi Lior, closing this one as part of a cleanup of the seventeen PRs currently open from you. The full explanation is in #173, and I would rather you read that one than this note, because it is the honest version and it is not a dismissal of your work. The short form: sixteen PRs opened in a single day, roughly 42,000 added lines in total, landing mostly on the same few files (nine touch Going forward, please keep no more than three open PRs at a time, each one a single behavior change that stands on its own, with a test that fails on master and passes with the fix. #214 and #215, merged today, are good models. If this particular change fixes something that genuinely annoys you in daily use, it is a good candidate to be the first one you reopen on its own, rebased on current master. I will review it properly. Thanks for the effort you put in, and sorry to close it this way. |
Summary
Why
Every session switch currently downloads and replays the terminal tail. On mobile, rapid switches can expose stale frames, repeat expensive xterm parsing, and make recently viewed sessions feel cold even though their rendered state is already in memory.
This change keeps a small recent range live. A quick switch-back becomes:
Any uncertainty falls back to the existing canonical fetch.
Correctness Boundaries
Dependencies
Merge order:
This branch temporarily includes
92dbe64from #193 and should be rebased after #193 merges. It does not duplicate #189. Before #189 is present, the extended subscription ID is rejected and entries remain ineligible, so the client safely uses canonical loads.Commit Structure
92dbe64 fix(terminal): retain session replay ownership- prerequisite from fix(terminal): preserve replay and history ownership #1938d9e00c feat(terminal): keep recent sessions warm- this featureOut Of Scope
Validation
npx vitest run --config config/vitest.config.ts test/warm-terminal-cache.test.ts test/terminal-flush-budget.test.ts test/codex-snapshot-replay.test.ts test/terminal-buffer-flush.test.ts- 26 passednpm run check:lockfilenpm run typechecknpm run lintnpm run check:frontend-syntaxnpm run check:public-assetsnpm run format:checknpm run buildgit diff --checkThe unsafe bare full-suite path was not run; its destructive quick-start fixture is isolated separately in #175.