Repository navigation
Let a Planner clean up a document Chopin no longer has, and run agents on NVX 30bf7f0 - #1006
Merged
Merged
Conversation
…ent's disk When a document was archived or deleted, chopin connect stopped its Planner process and removed its disk, leaving any state the Planner kept outside the disk (such as sessions in the machine's agent store) orphaned. Before removing a slot that Chopin says is archived or gone (the forget set in sweepPlannerDisks, never reset, 30-day age, or unpair/revocation), chopin connect now runs the configured --planner-command once while holding the disk lock and while the slot's agent folder still exists. The run receives CHOPIN_FORGOTTEN_DOCUMENT=<document id>, CHOPIN_URL, CHOPIN_AI=chopin, the slot's agent state directories with the machine's agent store settings when configured, and user --env values, inside the same microVM/sandbox image as a Planner, with no Chopin credential, GitHub token, checkout, or worktree. It is bounded to 2 minutes; any failure or timeout logs one dimmed line and never prevents the disk from being removed. Bumps @chopin/connector to 0.0.40. Assistant-model: Claude Opus 5.5 (fast)
NVX's last 365 commits since c753e7b4c288 fix microVM file sharing (READDIRPLUS skipping gone or hidden names, links and renames of unlinked or denied paths, the aggregate root's link count and FSYNCDIR, Windows share name checks and argument quoting) and pin each fix with a test. The pin moves with this connector release; nvx-vm.test.ts passes on KVM with the new release. Assistant-model: Claude Opus 5.5 (fast)
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.
When Chopin says a document is archived or gone,
chopin connectstops its Planner and removes its disk, which left state the Planner kept outside the disk (such as sessions in the machine's agent store) orphaned.Change
beforeForgethook tosweepPlannerDisks(apps/connector/src/planner-disks.ts) that runs only for theforgetset on the current server (never forreset, 30-day age, oreverything/unpair), beforeremovePlannerSlotwhile holding the disk lock.forgetPlannerDocument(apps/connector/src/planner.ts) and wired it inapps/connector/src/main.tswhen--planner-commandis configured. It runs the Planner command once in the machine's sandbox/microVM (same Planner image, no repository/disk/checkout mounted,cwdandHOMEat the slot's.agentfolder) withCHOPIN_FORGOTTEN_DOCUMENT=<document id>,CHOPIN_URL,CHOPIN_AI=chopin, the slot's agent state env with the machine'sagentStoresettings when present, and user--envvalues — and no Chopin credential, GitHub token, checkout, or worktree.FORGET_TIMEOUT_MS); non-zero exit, spawn error, or timeout logs one dimmed redacted line (Couldn't let the Planner of <doc> clean up: …) and never blocks disk removal.docs/agent-connection.mdanddocs/chopin-cli.md.@chopin/connectorto0.0.40.Verification
apps/connector/src/planner-disks.test.tscovering forget-only triggering, env/store/microVMvmSpeccontract, failure/timeout handling with secret redaction, and empty-command skip.bun run types(all packages pass).npx dprint checkandnpx oxlint(0 errors, 0 warnings on changed source files).GIT_CONFIG_GLOBAL=/dev/null bun testinapps/connector(482 pass, 0 fail across 43 files).NVX
Also moves the NVX pin from
0.1.0-dev.c753e7b4c288to0.1.0-dev.30bf7f09e59a(365 commits of microVM file-sharing fixes, each pinned by a test), so both ship in connector 0.0.40.nvx-vm.test.tspasses on a KVM machine with the new release (18 pass); connector tests 482 pass.