Skip to content

Commit b527122

Browse files
committed
fix(tui): exit hint prints resume subcommand form
The CL-8418 contract names the session as `Run corbits resume <uuid>` (resume verb, not --resume flag). Align formatResumeHint and its expectations with the verbatim contract.
1 parent e4b3ded commit b527122

6 files changed

Lines changed: 10 additions & 9 deletions

File tree

‎src/config.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ describe("loadConfig", () => {
798798
},
799799
home,
800800
);
801-
// The exact argv form the exit hint prints (`Run corbits --resume <id>`).
801+
// The exact argv form the exit hint prints (`corbits resume <id>`).
802802
const config = await loadConfig(["--resume", sessionId, "--cwd", cwd], {
803803
globalSettingsPath: globalPath,
804804
home,

‎src/config/index.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,8 @@ export async function loadConfig(
889889
throw new Error("cannot combine a session id with --resume");
890890
}
891891
// Optional session id: `corbits --resume <uuid>` reopens that session
892-
// directly (the form the exit hint prints); bare `--resume` opens the
892+
// directly (an alias for the `corbits resume <uuid>` form the exit
893+
// hint prints); bare `--resume` opens the
893894
// picker. A non-flag token that is not a session id errors exactly like
894895
// the `resume` verb path instead of leaking into task text.
895896
const next = args[i + 1];

‎src/session/resume-hint.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { formatResumeHint, printResumeHint } from "./resume-hint.js";
55
describe("resume hint", () => {
66
test("formats the resume command with the exited session id", () => {
77
expect(formatResumeHint("123e4567-e89b-12d3-a456-426614174000")).toBe(
8-
"Run corbits --resume 123e4567-e89b-12d3-a456-426614174000",
8+
"Run corbits resume 123e4567-e89b-12d3-a456-426614174000",
99
);
1010
});
1111

@@ -23,7 +23,7 @@ describe("resume hint", () => {
2323
spy.mockRestore();
2424
}
2525
expect(writes).toEqual([
26-
"Run corbits --resume 123e4567-e89b-12d3-a456-426614174000\n",
26+
"Run corbits resume 123e4567-e89b-12d3-a456-426614174000\n",
2727
]);
2828
});
2929
});

‎src/session/resume-hint.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { COMMAND_NAME } from "../branding.js";
55
// so the process-level signal handlers can use it without pulling the TUI
66
// or config graph — see the import-cost comment in process-handlers.ts.
77
export function formatResumeHint(sessionId: string): string {
8-
return `Run ${COMMAND_NAME} --resume ${sessionId}`;
8+
return `Run ${COMMAND_NAME} resume ${sessionId}`;
99
}
1010

1111
export function printResumeHint(sessionId: string): void {

‎src/tui/runner/exit.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,9 @@ describe("finalizeTUIRun resume hint", () => {
230230
stdoutSpy.mockRestore();
231231
dirs.cleanup();
232232
}
233-
expect(
234-
writes.some((w) => w === `Run corbits --resume ${sessionId}\n`),
235-
).toBe(true);
233+
expect(writes.some((w) => w === `Run corbits resume ${sessionId}\n`)).toBe(
234+
true,
235+
);
236236
});
237237
});
238238

‎tests/integration/signal-finalize.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe("integration — signal finalizes run.json", () => {
5555
}
5656
rest += decoder.decode();
5757
reader.releaseLock();
58-
expect(rest).toContain(`Run corbits --resume ${sessionId}`);
58+
expect(rest).toContain(`Run corbits resume ${sessionId}`);
5959

6060
// The fixture parks two unawaited straggler "running" snapshot writes
6161
// behind setTestWriteGate and releases them only after markCrashed()

0 commit comments

Comments
 (0)