Repository navigation
feat(checkpoints): allow disabling workspace checkpoints via features.checkpoints and OMB_CHECKPOINTS - #65
Merged
Conversation
…ia config and OMB_CHECKPOINTS
4 of 5 tasks
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
~/.openmausbot/checkpoints):config.json:"features": { "checkpoints": false }(also writable viaPATCH /api/configand exposed onGET /api/configasfeatures.checkpoints).OMB_CHECKPOINTS=off/0/false/no(oron/1/true/yes), which overridesconfig.jsonand causes conflictingPATCH /api/configrequests to fail with409(code: "checkpoints_env").trueso existing digest file-diff behavior and upstream compatibility are preserved.checkpoints.snapshot(...), post-turncheckpoints.diffWorkingTree(...), and read-aheadcheckpointSeedspriming are skipped (zero shadow git creation/I/O).PATCH /api/configcancels queued/in-flight read-ahead primes (clearingqueuedso re-enabling later works cleanly) and drops pending/in-flight shadow GC collections without re-queueing them; any in-flight turn still releases its pin without triggering GC.features.checkpointsdoes not invalidate engine CLI status snapshots (NO_ENGINE_EFFECT.features).delete-leftovers.ts) stays active so existing shadow folders are still cleaned up when a bot is deleted.skills/openmausbot-docs/SKILL.mdto reflect thatcheckpoints/is used for turn digest file diffs (rollback routes were removed earlier) and documents the opt-out.Why
GET /api/bots/:id/checkpoints,POST /api/bots/:id/checkpoints/restore) were already removed in6dd4403d8. Todayserver/checkpoints.tsonly powers the optionalfilesdiff section on turn digests, yet shadow git repos per(botId, cwd)can accumulate gigabytes on disk (observed: 13 GB across 25 bots) with no way to disable them — deleting~/.openmausbot/checkpointsonly led to immediate re-creation on the next turn or startup seed pass.Verification
Automated tests & checks
pnpm typecheck— passedpnpm lint(oxlint --deny-warnings .) — passedpnpm exec vitest run server/digest.e2e.test.ts server/checkpoints.test.ts server/host/checkpoint-seeds.test.ts server/routes/config-engine-effect.test.ts— 4 files / 60 passed (1 skipped)pnpm exec vitest run server/checkpoints-perf.test.ts scripts/testing/file-size-ratchet.test.ts scripts/testing/comment-history.test.ts scripts/testing/index-route-ratchet.test.ts— all passedpnpm exec vitest run server/bot-box/env.test.ts—OMB_CHECKPOINTSaccepted; pre-existing failure onmainfor 4 unrelatedOMB_WORKTREE_*names remains untouched.Before / After (Isolated real server execution)
Launched isolated OpenMyBot server fixtures (disposable
OMB_DATA_DIR, temp git repos, fakeclaudeAgentCLI):features.checkpoints: true):GET /api/config→features.checkpoints: truecwdruns a turn →DATA_DIR/checkpoints/<botId>/created (beforeShadowCount: 1), digest includesfiles: { changed: [], added: [], deleted: [] }.PATCH /api/config { features: { checkpoints: false } }):PATCH /api/config→200,features.checkpoints: false, persisted toconfig.json.cwdruns a turn →DATA_DIR/checkpoints/<newBotId>not created (afterPatchShadowCreatedForNewBot: false), turn & digest succeed (afterPatchDigestExists: true,afterPatchDigestFiles: null).OMB_CHECKPOINTS=off):GET /api/config→features.checkpoints: falsePATCH /api/config { features: { checkpoints: true } }→409(code: "checkpoints_env")cwdruns a turn →DATA_DIR/checkpointsroot directory never created (checkpointsRootDirCreated: false), turn & digest succeed (digestExists: true,digestFiles: null).Notes / Follow-ups (out of scope for this PR)
<shadowHash>folders when a bot changescwdor a worktree/thread is removed) and per-file/per-shadow size bounds can be addressed in a separate PR.