fix(cli): make new workspace creation explicit (#2315)

Agent callers now stay in their current workspace unless --new-workspace explicitly requests a separate local or worktree workspace.
This commit is contained in:
Mohamed Boudra
2026-07-22 18:26:40 +08:00
committed by GitHub
parent 0afcc96370
commit 246c07fba5
8 changed files with 167 additions and 53 deletions
+24
View File
@@ -58,6 +58,8 @@ try {
assert(result.stdout.includes("--title"), "help should mention --title option");
assert(result.stdout.includes("--provider"), "help should mention --provider option");
assert(result.stdout.includes("--mode"), "help should mention --mode option");
assert(result.stdout.includes("--new-workspace"), "help should mention --new-workspace option");
assert(!result.stdout.includes("--isolation"), "help should not mention --isolation");
assert(result.stdout.includes("--cwd"), "help should mention --cwd option");
assert(result.stdout.includes("--output-schema"), "help should mention --output-schema option");
assert(result.stdout.includes("--host"), "help should mention --host option");
@@ -244,6 +246,28 @@ try {
assert(output.includes("unknown option"), "should report unknown option for --ui");
console.log("✓ run --ui is rejected\n");
}
// Test 15: run --new-workspace is accepted
{
console.log("Test 15: run --new-workspace is accepted");
const result =
await $`PASEO_HOST=localhost:${port} PASEO_HOME=${paseoHome} npx paseo run --new-workspace local "test prompt"`.nothrow();
const output = result.stdout + result.stderr;
assert(!output.includes("unknown option"), "should accept --new-workspace");
assert(!output.includes("error: option"), "should not have option parsing error");
console.log("✓ run --new-workspace is accepted\n");
}
// Test 16: run --isolation is rejected (unreleased flag removed)
{
console.log("Test 16: run --isolation is rejected");
const result =
await $`PASEO_HOST=localhost:${port} PASEO_HOME=${paseoHome} npx paseo run --isolation local "test prompt"`.nothrow();
assert.notStrictEqual(result.exitCode, 0, "should fail for removed --isolation flag");
const output = result.stdout + result.stderr;
assert(output.includes("unknown option"), "should report unknown option for --isolation");
console.log("✓ run --isolation is rejected\n");
}
} finally {
// Clean up temp directory
await rm(paseoHome, { recursive: true, force: true });