Repository navigation
fix(mcp): make the checkpoint store owner-only and clearable - #1587
Merged
Merged
Conversation
…1, WI-CP1.2) MCP checkpoints persist the full prior text of every AI write to `mcp-checkpoints.jsonl` in app data. The fs plugin created it 0644, and nothing in the UI showed how large it had grown or cleared it for every file at once. A new `mcp_checkpoint_store_init` command resolves the path itself (no path crosses IPC), creates the file, and tightens it to 0600 on Unix before every read and write. Its failure is logged and never blocks a checkpoint: losing the restore history would cost more than a permissive file mode. The history popover's footer now reports the file's on-disk size and offers Clear all checkpoint history. It removes every line, clears the clicking window's memory, and broadcasts `mcp:checkpoints-cleared` so other windows drop their lists too. The footer lives here rather than Settings because the Settings window is filesystem-free by capability (pinned by capabilities.test.rs). Full `contentBefore` is kept deliberately: restore is the feature, and a hash or a truncated snapshot would remove it. Encryption with a key stored beside the file would not add a boundary. Docs updated in all ten locales. Refs #1580
…oint-store-privacy
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.
Summary
0600on Unix before every read and write.mcp:checkpoints-cleared, so other windows drop their in-memory lists.Closes #1580
What changed
mcp_checkpoint_store_init(Rust): resolves the app-data path itself, so no path crosses the IPC boundary; creates the file withmode(0o600)and re-applies the mode so a file written0644by an older release is tightened. A hardening failure is logged and never blocks a checkpoint — losing the restore history would cost more than a permissive mode.src/stores/mcpCheckpointPersistence.ts: hardens before hydrate, append, compaction and clear; exportscheckpointStoreInfo().McpHistoryStoreFooter.tsx+useCheckpointClearBroadcast.ts: the popover footer and the cross-window clear event.Why the control is not in Settings
The Settings window is deliberately filesystem-free by capability —
capabilities.test.rsasserts it has nofs:orshell:permission — so a file-size and clear action there would break a stated boundary. The status-bar history popover already owns the checkpoint file and is the natural place for both.Why not opt-in, encryption, or hashes
contentBeforeis what makes restore work; a hash or a truncated snapshot would remove the safety net the feature exists for. Encryption with a key stored beside the file does not add a boundary. The issue's third option — easy to inspect and clear from the UI — is what this ships.Validation
pnpm typecheckpnpm lintpnpm test:changed— 18,254 passedcargo clippy --all-targets -- -D warnings,cargo fmt --check, checkpoint testspnpm check:predelta