Skip to content

fix(mcp): make the checkpoint store owner-only and clearable - #1587

Merged
xiaolai merged 2 commits into
mainfrom
fix/issue-1580-checkpoint-store-privacy
Oct 20, 2026
Merged

xiaolai merged 2 commits into
mainfrom
fix/issue-1580-checkpoint-store-privacy

Conversation

@xiaolai

@xiaolai xiaolai commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • The MCP checkpoint log is created, or tightened, to 0600 on Unix before every read and write.
  • The history popover footer reports the file's on-disk size and clears the whole store — every file and every window — in one action.
  • Clear-all broadcasts mcp:checkpoints-cleared, so other windows drop their in-memory lists.
  • Docs updated in all ten locales.

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 with mode(0o600) and re-applies the mode so a file written 0644 by 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; exports checkpointStoreInfo().
  • McpHistoryStoreFooter.tsx + useCheckpointClearBroadcast.ts: the popover footer and the cross-window clear event.
  • Tests: five Rust unit tests (creation, tightening, size, no truncation, missing parents), persistence hardening/fallback tests, popover clear-all and cross-window tests.

Why the control is not in Settings

The Settings window is deliberately filesystem-free by capability — capabilities.test.rs asserts it has no fs: or shell: 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

contentBefore is 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 typecheck
  • pnpm lint
  • pnpm test:changed — 18,254 passed
  • Targeted gates: i18n, ipc-contract, file-size, feature-map, file-headers, ui-consistency, bespoke-buttons, design-tokens, doc-joins, provenance-ids, test-types, emdash
  • cargo clippy --all-targets -- -D warnings, cargo fmt --check, checkpoint tests
  • pnpm check:predelta

…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
@xiaolai
xiaolai merged commit 51486a3 into main Oct 20, 2026
18 checks passed
@xiaolai
xiaolai deleted the fix/issue-1580-checkpoint-store-privacy branch October 20, 2026 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] MCP checkpoints keep full document text in plaintext with no UI, retention window or permission parity

1 participant