Repository navigation
refactor: remove the on-disk ghost log - #1235
Merged
Merged
Conversation
Owner decision (2026-09-25, #1227). <userData>/ghost-logs persisted the renderer's provisional rows so a pane that crashed mid-turn could show them after a restart. Nothing had read those files since 0cb71e9 (2026-07-16): the only reader looked them up under a freshly minted spawn id. They had grown to 2.1 GB (1,935 of 1,955 files for sessions that no longer existed), had OOM'd main once, and needed their own compaction and retention. Reviving the reader (#1227) needed clock and identity machinery to avoid repainting committed turns, for a rare case whose restored text is not in the agent's own resumed conversation. Removed: GhostJournal and its compaction, the ghost:append/ghost:read IPC and preload bridge, every renderer append, the dead spawn-time bootstrap, ghostsToPersist, the ghost-logs retention bucket and #1223's owner provider (with the store's sessionOwnershipKnown flag it existed for). storage/legacyGhostLogs.ts deletes the old directory in the background on launch. In-memory ghosts (the live streaming preview and the JSONL-stuck fallback) are unchanged. docs/design/ghost-system.md says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps #1228's sweepGhosts and drops ghostsToPersist, which this branch removes along with the on-disk log. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Juliusolsson05
added a commit
that referenced
this pull request
Sep 25, 2026
- ARCHITECTURE.md: drop the dead ghost-journal link and the crash-resume claims; the storage table lists the legacy directory as deleted on launch. - ghost-system.md: the lifecycle, TTL and eviction sections no longer describe a journal. - Stale code comments (devDebug, bundleCorpus, useIpcSubscriptions, SessionFeed) and the extraction script note corrected; unused basename import removed. - legacyGhostLogs tests now pin the quiet no-op (no warn when the directory is already gone) and the never-rejects contract its void call site depends on; both surviving mutants are killed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Juliusolsson05
added a commit
that referenced
this pull request
Sep 25, 2026
This was referenced Sep 25, 2026
Open
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #731
Why (owner decision, 2026-09-25)
<userData>/ghost-logs/<sessionId>.ghost.jsonlpersisted the renderer's provisional rows, so that a pane which crashed mid-turn could show them after a restart.What goes
GhostJournalwith its startup compaction, theghost:append/ghost:readIPC, and the shutdown flush.ghostAppend;session.ts;ghostsToPersist.ghost-logsbucket, and fix(storage): prune orphaned ghost logs; protect a ghost log only while its session exists #1223's owner provider together withWorkspaceFileStore.sessionOwnershipKnown, which existed only for it.sessionIds()stays because it has another caller.What stays
In-memory ghosts are unchanged: the live streaming preview, and the fallback for JSONL stuck mid-turn while the pane is live.
docs/design/ghost-system.mdnow says crash-resume is deliberately not covered, and explains why.Cleanup of existing installs
storage/legacyGhostLogs.tsremoves the directory in the background on every launch. It is an idempotentrm -rf, and failure is logged and harmless. It can be deleted a few releases after this change ships.Tests
legacyGhostLogs.test.tschecks that the directory is removed, its siblings are untouched, and a missing directory is a no-op.tsc -bis clean.src/main/workflows/control.system.test.ts(a 5 s timeout), fails identically on a cleanorigin/mainlocally, and main's CI is green. It is local environment, unrelated.🤖 Generated with Claude Code
Review disposition (A Claude, B Pi; 2 rounds)
dfc1534e)basenameimportforce:falseand a removed try/catch survived)736e51e9(#1228 conflict)sweepGhostsintact, every persistence call site goneRound 2: A and B MERGE-READY on
dfc1534e. Steering q7 condition met: round 2 and CI both ran on the post-merge head.