fix(story-mode): a stop says where it landed and what was saved before it

From review round 8: "STOPPED" with the balloon "Step 3: new tests under
test/." read like progress, and nothing said what the stop left. The
final panel now names the step Claude last announced and the commits made
before the stop: "You stop Claude here, during its step 3. Saved before
the stop: 2 commits."

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer committed 2026-10-18 15:27:30 +02:00
1 parent 88040c997d
commit b19317175e
3 files changed
+11 -3

No files matched your search

+7 -1
View File
@@ -2547,8 +2547,14 @@ function completePanel(turn: StoryTurn, page: Omit<StoryPage, 'panels'>, trailin
const laterHelpers = later.filter((e) => e.helper).length;
const laterCommands = later.length - laterHelpers;
const done = turn.durationMs !== undefined ? `Done in ${roughDuration(turn.durationMs)}.` : 'Done.';
// Where a stop landed: the step Claude last announced ("Step 3: …"), and what it had saved by then.
const announced = [...page.events].reverse().find((e) => e.intent === 'say' && /^\W{0,4}step \d+\b/i.test(e.label));
const step = announced ? /step (\d+)/i.exec(announced.label)?.[1] : undefined;
const savedBefore = page.events.reduce((n, e) => n + (e.commits ?? 0), 0);
const story = turn.interrupted
? 'You stop Claude here.'
? `You stop Claude here${step ? `, during its step ${step}` : ''}.${
savedBefore ? ` Saved before the stop: ${plural(savedBefore, 'commit')}.` : ''
}`
: page.noneWorked
? 'Nothing Claude tried worked, so the job is not done.'
: turn.endedBy === 'next prompt'
@@ -300,7 +300,7 @@
{
"kind": "complete",
"ok": null,
"story": "You stop Claude here.",
"story": "You stop Claude here, during its step 3. Saved before the stop: 2 commits.",
"director": "interrupted · 2 min 41 s · 5 tool calls · 4 files changed",
"balloon": "Step 3: new tests under test/.",
"tests": null,
+3 -1
View File
@@ -98,7 +98,9 @@ describe('Story Mode on real sessions', () => {
['human', true],
['human', true],
]);
expect(pages[3].panels.at(-1)?.story).toBe('You stop Claude here.');
expect(pages[3].panels.at(-1)?.story).toBe(
'You stop Claude here, during its step 3. Saved before the stop: 2 commits.'
);
});
it('a commit at the end of a test one-liner is kept, and a background helper reports back in 9 s', () => {