fix(cli): persist snapshot disable across restarts - #13195
Conversation
The slow-repo prompt wrote snapshot:false outside the Effect fiber, so the project config was skipped and snapshots came back after a VS Code restart. Co-authored-by: Cursor <cursoragent@cursor.com>
Code Review SummaryStatus: No Issues Found | Recommendation: Merge The fix is sound: Files Reviewed (3 files)
Reviewed by kimi-k3 · Input: 148.6K · Output: 15.3K · Cached: 1.1M Review guidance: REVIEW.md from base branch |
marius-kilocode
left a comment
There was a problem hiding this comment.
Thanks @quanzhuo this looks good!
The slow-repo prompt wrote snapshot:false outside the Effect fiber, so the project config was skipped and snapshots came back after a VS Code restart.
Issue
Addresses #13134 (slow-repo / chat prompt path only).
This does not change the settings-panel
snapshot: falsesave path. If that path still fails after restart, keep #13134 open or file a follow-up.Context
On a slow repo, the snapshot init prompt offers Disable for this project. That choice is supposed to write
"snapshot": falseto.kilo/kilo.jsoncso later sessions stay off.The write ran through
Effect.promise(...). That dropsInstanceRef/ ALS across the Promise boundary.persistDisablethen could not see the project directory, skipped the file write, and only flipped the in-memory session flag. After a VS Code restart, snapshots came back.Implementation
Keep the existing “write the project file, do not call
Config.update()” design so the live turn is not disposed.Two small changes:
hooks.persistDisable()withEffectBridge.fromPromiseso instance context survives the Promise boundary (same pattern as other kilo Effect/Promise edges).InstanceContextsynchronously at the start ofpersistDisableviacapture(), before anyawait. If there is no instance, log an error instead of returning silently.No settings-panel or
Config.update()changes.Screenshots / Video
N/A — no visual changes.
How to Test
Manual/local verification
bun test ./test/kilocode/snapshot-track-timeout.test.tsfrompackages/opencode/— passed, including the new persistDisable cases.bun run typecheckfor@kilocode/cli— passed.git pushpre-push ranbun turbo typecheck --filter=!@kilocode/kilo-jetbrains— passed (29/29). JetBrains typecheck failed afterward on a CloudFront DNS fetch forrpc-compiler-plugin; unrelated to this diff.Reviewer test steps
.kilo/kilo.jsonccontains"snapshot": false.packages/opencode/:bun test ./test/kilocode/snapshot-track-timeout.test.tsBlocked checks and substitute verification
bun turbo typecheck --filter=@kilocode/kilo-jetbrainswas not completed on the author’s machine because Gradle could not resolvecom.jetbrains.fleet:rpc-compiler-plugin(CloudFront DNS). This PR does not touchpackages/kilo-jetbrains/. Substitute: CLI typecheck + the persistDisable regression tests above.Checklist