fix(story-mode): a turn ended only by the next prompt says so

A turn with no end marker of its own (an abandoned or crashed turn) was
closed when the next prompt started and then drawn as "Mission complete!".
It now reads "To be continued…" / "The trail stops here: the next prompt
starts a new turn.", and the page carries `superseded`. The Director's cut
names what ended every turn: turn_duration, stop_hook_summary, a local
command, an interrupt, or the next prompt.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer committed 2026-10-18 11:42:26 +02:00
1 parent 873b899c52
commit f4898a626f
4 files changed
+33 -12

No files matched your search

+9 -1
View File
@@ -879,7 +879,15 @@ describe('buildStoryPage', () => {
{ type: 'user', timestamp: '2026-10-18T09:50:00.000Z', message: { content: '[Request interrupted by user]' } },
])
);
expect(turns[0]).toMatchObject({ ended: true, interrupted: false });
expect(turns[0]).toMatchObject({ ended: true, interrupted: false, endedBy: 'next prompt' });
const superseded = buildStoryPage(turns[0]);
expect(superseded.superseded).toBe(true);
expect(superseded.panels[superseded.panels.length - 1].caption.story).toBe(
'The trail stops here: the next prompt starts a new turn.'
);
expect(superseded.panels[superseded.panels.length - 1].caption.director).toMatch(
/^superseded by the next prompt · /
);
expect(turns[0].durationMs).toBeGreaterThan(0);
expect(turns[1]).toMatchObject({ ended: true, interrupted: true });
expect(turns[1].durationMs).toBeGreaterThan(0);