fix: remove L1 bootstrap snapshot cache to fix workspace file staleness#43901
fix: remove L1 bootstrap snapshot cache to fix workspace file staleness#43901mikejuyoon wants to merge 1 commit intoopenclaw:mainfrom
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Greptile SummaryThis PR removes the Level 1 bootstrap snapshot cache ( Key changes:
The PR is a net −215 lines and eliminates a class of bugs where workspace files edited on disk remained invisible to active sessions indefinitely. Confidence Score: 5/5
Last reviewed commit: 6e06b2d |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing this as duplicate or superseded after Codex automated review. This contributor PR identifies a real bootstrap-staleness bug, but it is now superseded by the newer maintainer-tracked #72406, which explicitly carries this work forward with credit and a narrower refresh-in-place implementation. Current main still has the stale session-keyed L1 cache, so this is not implemented-on-main yet; the correct path is to review/land #72406 or an equivalent maintainer-approved fix. Best possible solution: Close this older deletion-style PR as superseded, preserve credit to @mikejuyoon, and focus maintainer review on #72406 because it is the current maintainer-tracked implementation for refreshing long-lived session bootstrap snapshots without removing the cache outright. What I checked:
So I’m closing this here and keeping the remaining discussion on the canonical linked item. Codex Review notes: model gpt-5.5, reasoning high; reviewed against 91e835ebe0ab. |
Summary
Removes the L1 bootstrap snapshot cache (
bootstrap-cache.ts), which cached workspace files per session key with no invalidation. This caused workspace files modified after initial load — by other sessions, cron/heartbeat, sub-agents, or the agent itself — to remain permanently stale.The L2 cache in
workspace.tsalready validates file identity (dev, inode, size, mtime) on every read and auto-invalidates on disk changes. The L1 cache sat on top and short-circuited L2 entirely, preventing it from ever detecting changes.+7 / -215 lines. Pure deletion — no new code paths.
Symptoms this fixes
/newon Teams often fails to clear the cache due to a guard that no-ops whenpreviousSessionIdis undefined. Moot now — there is no cache to clear.Why this is safe
L2 already handles caching correctly with mtime/inode validation. The "uncached" path (calling
loadWorkspaceBootstrapFilesdirectly) is already exercised in production whensessionKeyis absent. Performance impact is negligible: 7-9 stat calls on sub-KB markdown files per message, sub-millisecond total vs. seconds of LLM latency.Fixes
🤖 Generated with Claude Code