Problem#
Closing a running thread skips its disk-cache save, so reopening it after a client relaunch can show "Loading messages..." until the server responds.
Change#
Save the latest committed snapshot once when the view closes, including active runs. Keep the streaming-write guard, expanded-history guard, queued cache repairs, and persistence deduplication unchanged. The shared client runtime serves web, desktop, and mobile.
Verification#
- The regression test fails on main (zero saved snapshots), then passes with the fix. All 39 existing-file thread-sync tests pass.
- Blacksmith
vp run check:changed passes format, lint, knip, affected-package typechecks, and tests. Lint reports two pre-existing polling warnings outside the added test.
- Real web client, system Chrome, Codex GPT-6-Astra: open a running turn, navigate away, close the browser, relaunch, reopen. Separate threads use the same prompt and
sleep 120 command. Snapshot HTTP responses are held only in the browser for both reopens. Main shows a blank timeline until release; the fix displays the saved messages and running command without requesting a snapshot. Clips are functional evidence, not latency measurements.
- CodeRabbit reported its review limit and posted no findings; its check is green.
- Unverified: native iOS/Android and Electron runtime, remote/relay/tunnel, and very large cache-write cost. No provider adapter or wire contract changes.
Before, main 3ca62a564457:

After, e86f36682a17:

Reopen recording, main followed by the fix. Conversation crops match; startup splash frames are trimmed.

Takeover#
Replaces #24210, with thanks to @shivamhwp for the original implementation.
Built with GPT-6.1-Sol in the Codex harness on T3 Code.
No actionable comments were generated in the recent review.
Walkthrough
The thread finalizer now saves non-expanded projections even when a run is preparing, starting, or running. A test verifies that the latest thread snapshot is saved when the view scope closes.
Changes: Running thread persistence
packages/client-runtime/src/state/threads.ts,packages/client-runtime/src/state/threads-sync.test.tsEstimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers:
shivamhwp,juliusmarmingeMerge Risk:
Minimal · up to
d5d40Reopening a running thread after a relaunch now shows cached messages instead of "Loading messages...". The change is small and covered by a regression test, so merge-readiness risk is minimal.
Pre-merge checks:
3 · 
1
#24210may stay, but it does …Full details: Title check
Explanation
The title names the main change: running threads are now cached when their view closes, which matches the summary's finalizer change and the new test. It uses the conventional commit format and a specific scope. The title does not mention the relaunch symptom, but it still identifies the primary change.
Full details: Description check
Explanation
The description follows the template. It has Problem, Change, and Verification sections, and it states the bug, the fix, and the test results. It also includes before and after evidence and notes what remains unverified. The Scope section is missing: the description does not link an issue or explain why no issue is needed. It also does not state a reason for skipping one. The description also replaces PR
#24210and credits its original author, which the template does not require. The author gives no explicit statement about the Scope requirement for a bug fix.Resolution
Add a Scope section. Link the issue that shows the bug. If no issue exists, explain why this small fix of an obvious bug needs none. If a maintainer asked for this PR, link that request. The Takeover note about
#24210may stay, but it does not replace the Scope section.Finishing Touches
Generate unit tests (beta)
65689e51-4ffe-4e73-b3c9-9ec06f9acde8Reviewing files that changed from the base of the PR and between 759f67aed383ed5e29483893926d934a9bfd9a78 and d5d407ab6e8f23f71852101e507f832bf01a265f.
packages/client-runtime/src/state/threads-sync.test.tspackages/client-runtime/src/state/threads.tsIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.