Skip to content

Let a Planner clean up a document Chopin no longer has, and run agents on NVX 30bf7f0 - #1006

Merged
lavaman131 merged 2 commits into
mainfrom
planner-forget-run
Nov 24, 2026
Merged

lavaman131 merged 2 commits into
mainfrom
planner-forget-run

Conversation

@lavaman131

@lavaman131 lavaman131 commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

When Chopin says a document is archived or gone, chopin connect stops 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

  • Added a beforeForget hook to sweepPlannerDisks (apps/connector/src/planner-disks.ts) that runs only for the forget set on the current server (never for reset, 30-day age, or everything/unpair), before removePlannerSlot while holding the disk lock.
  • Added forgetPlannerDocument (apps/connector/src/planner.ts) and wired it in apps/connector/src/main.ts when --planner-command is configured. It runs the Planner command once in the machine's sandbox/microVM (same Planner image, no repository/disk/checkout mounted, cwd and HOME at the slot's .agent folder) with CHOPIN_FORGOTTEN_DOCUMENT=<document id>, CHOPIN_URL, CHOPIN_AI=chopin, the slot's agent state env with the machine's agentStore settings when present, and user --env values — and no Chopin credential, GitHub token, checkout, or worktree.
  • Bounded to 2 minutes (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.
  • Documented the contract in docs/agent-connection.md and docs/chopin-cli.md.
  • Bumped @chopin/connector to 0.0.40.

Verification

  • Added 4 tests in apps/connector/src/planner-disks.test.ts covering forget-only triggering, env/store/microVM vmSpec contract, failure/timeout handling with secret redaction, and empty-command skip.
  • bun run types (all packages pass).
  • npx dprint check and npx oxlint (0 errors, 0 warnings on changed source files).
  • GIT_CONFIG_GLOBAL=/dev/null bun test in apps/connector (482 pass, 0 fail across 43 files).

NVX

Also moves the NVX pin from 0.1.0-dev.c753e7b4c288 to 0.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.ts passes on a KVM machine with the new release (18 pass); connector tests 482 pass.

…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)
@lavaman131 lavaman131 changed the title Run the Planner command to clean up before removing a forgotten document's disk Let a Planner clean up a document Chopin no longer has, and run agents on NVX 30bf7f0 Nov 24, 2026
@lavaman131
lavaman131 merged commit 84b24c3 into main Nov 24, 2026
26 checks passed
@lavaman131
lavaman131 deleted the planner-forget-run branch November 24, 2026 19:07
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.

1 participant