paperclipai/paperclip · error · Error
Could not arm “Run tasks in this worktree” for Paperclip ins
Error message
Could not arm “Run tasks in this worktree” for Paperclip instance ${instanceId}. Check that PAPERCLIP_IN_WORKTREE=true and retry the command. What it means
reconcileTestDriveWorktreeExecution arms the experimental 'Run tasks in this worktree' setting on the Paperclip instance and then re-reads /api/instance/settings/experimental to verify it actually took effect. This error means the verification read-back shows the setting is still not armed for the given instance.
Source
Thrown at cli/src/commands/test-drive.ts:312
if (!current.enableWorktreeRunExecution) {
await api.patch<InstanceExperimentalSettings>("/api/instance/settings/experimental", {
enableWorktreeRunExecution: true,
});
} else if (!worktreeExecutionArmed(current, instanceId)) {
await api.patch<InstanceExperimentalSettings>("/api/instance/settings/experimental", {
enableWorktreeRunExecution: false,
});
await api.patch<InstanceExperimentalSettings>("/api/instance/settings/experimental", {
enableWorktreeRunExecution: true,
});
}
const verified = requiredApiResult(
await api.get<InstanceExperimentalSettings>("/api/instance/settings/experimental"),
"verifying experimental settings",
);
if (!worktreeExecutionArmed(verified, instanceId)) {
throw new Error(
`Could not arm “Run tasks in this worktree” for Paperclip instance ${instanceId}. ` +
"Check that PAPERCLIP_IN_WORKTREE=true and retry the command.",
);
}
}
export async function bootstrapTestDrive(input: {
api: TestDriveApi;
options: TestDriveOptions;
linkedWorktree: boolean;
instanceId: string;
env?: NodeJS.ProcessEnv;
}): Promise<TestDriveBootstrapResult> {
const companies = requiredApiResult(
await input.api.get<Company[]>("/api/companies"),
"reading companies",
);
const existingCompany = companies[0];View on GitHub (pinned to 01ad858492)
Solutions
- Restart the Paperclip server with PAPERCLIP_IN_WORKTREE=true and retry the command
- Verify the instance ID matches the running instance (`paperclip` status or instance listing)
- Re-run the command after confirming the server is healthy via /api/health
Example fix
// before paperclip serve # worktree execution unavailable // after PAPERCLIP_IN_WORKTREE=true paperclip serve
Defensive patterns
Strategy: retry
Validate before calling
const settings = await fetch('/api/instance/settings/experimental').then(r => r.json());
if (!settings.worktreeExecution?.enabled) {
throw new Error('Start the server with PAPERCLIP_IN_WORKTREE=true first');
} Try / catch
try {
await bootstrapTestDrive(opts);
} catch (e) {
if (String(e.message).includes('Run tasks in this worktree')) {
console.error('Restart server with PAPERCLIP_IN_WORKTREE=true, then retry');
} else throw e;
} Prevention
- Always launch dev servers with PAPERCLIP_IN_WORKTREE=true when testing worktree flows
- Confirm the setting stuck via GET /api/instance/settings/experimental after arming
- Keep instance IDs current — refresh after server restarts
When it happens
Trigger: The Paperclip server was not started with PAPERCLIP_IN_WORKTREE=true, so the worktree-execution capability cannot be armed; the instance ID does not match the instance the setting was applied to; or the settings API accepts but does not persist the flag.
Common situations: Running the test-drive CLI against a Paperclip instance launched normally (not inside a worktree); a stale instanceId from an old session; server restarted without the env var after a previous successful arm.
Related errors
- Unknown config key ${warning.path}; did you mean ${warning.s
- Registered ${label} Paperclip config is missing its adjacent
- Registered ${label} Paperclip config has no PAPERCLIP_INSTAN
- Worktree seed source is not registered. Managed boot require
- Registered base project workspace has no Paperclip config of
AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-09-10).
Data as JSON: /api/errors/ab1fcc6f49400eef.
Report an issue: GitHub.