Skip to content

Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.

fix(cli): keep refusal repair commands copyable [L3]

Corey Olson664996d092a8
diff --git a/src/cli.js b/src/cli.js
index 82ae6a52..d197be80 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -2767,7 +2767,7 @@ async function runCommand(argv, io) {
} catch (error) {
if (error instanceof Refused) {
io.refusal?.(error);
- io.err(`pullboard: ${error.message}; next: ${refusalDocument(error).error.next}`);
+ io.err(`pullboard: ${error.message}\nnext: ${refusalDocument(error).error.next}`);
return 1;
}
throw error;
@@ -2819,7 +2819,7 @@ async function runMain(argv, streams) {
} catch (error) {
if (!(error instanceof Refused)) throw error;
io.refusal(error);
- io.err(`pullboard: ${error.message}; next: ${refusalDocument(error).error.next}`);
+ io.err(`pullboard: ${error.message}\nnext: ${refusalDocument(error).error.next}`);
io.flush(1);
return 1;
}
@@ -2833,7 +2833,7 @@ async function runMain(argv, streams) {
}
catch (error) {
if (!(error instanceof Refused)) throw error;
- if (!['NOT_A_REPO', 'NO_REPO', 'NO_CONFIG', 'CORE_BARE'].includes(error.code)) io.err(`pullboard: ${error.message}; next: ${refusalDocument(error).error.next}`);
+ if (!['NOT_A_REPO', 'NO_REPO', 'NO_CONFIG', 'CORE_BARE'].includes(error.code)) io.err(`pullboard: ${error.message}\nnext: ${refusalDocument(error).error.next}`);
}
};
if (needsRepo) rememberTrunk(io);
@@ -2843,7 +2843,7 @@ async function runMain(argv, streams) {
try { await executePersonRequests(io.cwd, io, main); }
catch (error) {
if (!(error instanceof Refused)) throw error;
- if (!['NOT_A_REPO', 'NO_REPO', 'NO_CONFIG', 'CORE_BARE'].includes(error.code)) io.err(`pullboard: ${error.message}; next: ${refusalDocument(error).error.next}`);
+ if (!['NOT_A_REPO', 'NO_REPO', 'NO_CONFIG', 'CORE_BARE'].includes(error.code)) io.err(`pullboard: ${error.message}\nnext: ${refusalDocument(error).error.next}`);
}
}
const code = await runCommand(argv, io);
diff --git a/test/view-port.test.js b/test/view-port.test.js
index 4cb00671..252b0cf6 100644
--- a/test/view-port.test.js
+++ b/test/view-port.test.js
@@ -28,5 +28,11 @@ test("a named port that is busy is refused with the way out, not a stack trace [
cwd: dir, env, encoding: 'utf8', timeout: 20000,
});
assert.equal(result.status, 1, `a refusal, not a crash or a hang: ${result.stderr}`);
- assert.equal(result.stderr.trim(), `pullboard: [PORT_BUSY] port ${port} is in use: name another with --port, or leave --port out to take any free one`);
+ const json = spawnSync(process.execPath, [BIN, 'view', '--no-open', '--port', String(port), '--json'], {
+ cwd: dir, env, encoding: 'utf8', timeout: 20000,
+ });
+ assert.equal(json.status, 1, json.stderr);
+ const refusal = JSON.parse(json.stdout).error;
+ assert.equal(refusal.code, 'PORT_BUSY');
+ assert.equal(result.stderr.trim(), `pullboard: [PORT_BUSY] port ${port} is in use: name another with --port, or leave --port out to take any free one\nnext: ${refusal.next}`);
});