mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-14 18:39:33 +01:00
fix(story-mode): background commands, and Save image on a phone
From review round 5 (a phone with touch):
- Save image on a phone exported blank art for every panel not yet scrolled
into view (the frame loop draws only what is on screen). It now draws
every panel completely first, and the file name carries the turn number,
so saves of different turns no longer overwrite each other.
- A test command sent to the background ("Command running in background
with ID …") drew as "The tests pass." with POW before any test ran. It is
now running: "Claude starts the tests in the background.", tagged "in the
background" on the wire, and the final panel says a command is still
running. Its task notification settles it from the exit code, and reading
the job's output file that reports tests is a check ("The tests pass.",
7 passed) instead of "Claude looks around".
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
814bec739d
commit
cdb7b5d55f
4 files changed
+112
-17
No files matched your search
@@ -711,6 +711,54 @@ describe('buildStoryTurns', () => {
|
||||
expect(turn.events.map((e) => e.intent)).toEqual(['prompt', 'compact']);
|
||||
});
|
||||
|
||||
it('a command sent to the background is running, not passed, until its notification; its output read later is a check', () => {
|
||||
const turns = buildStoryTurns(
|
||||
entriesOf([
|
||||
prompt('run the slow tests in the background'),
|
||||
...bash(
|
||||
'b1',
|
||||
'sleep 25 && pytest -q',
|
||||
'Run slow tests',
|
||||
'Command running in background with ID: bg1. Output is being written to: /tmp/x/tasks/bg1.output'
|
||||
),
|
||||
said('The tests are running in the background.'),
|
||||
end(1000),
|
||||
prompt(
|
||||
'<task-notification>\n<task-id>bg1</task-id>\n<tool-use-id>b1</tool-use-id>\n<status>completed</status>\n<summary>Background command \"Run slow tests\" completed (exit code 0)</summary>\n</task-notification>',
|
||||
{ turnOrigin: 'task_notification' }
|
||||
),
|
||||
...bash('b2', 'cat /tmp/x/tasks/bg1.output', 'Read the test output', '7 passed in 25.1s'),
|
||||
end(1000),
|
||||
])
|
||||
);
|
||||
// Before the report the first turn said it was still running; the report settled it.
|
||||
const first = buildStoryPage(turns[0]);
|
||||
expect(first.events[1]).toMatchObject({ intent: 'test', ok: true });
|
||||
expect(first.events[1].running).toBeUndefined();
|
||||
const second = buildStoryPage(turns[1]);
|
||||
expect(second.panels.find((p) => p.kind === 'check')).toMatchObject({
|
||||
caption: { story: 'The tests pass.' },
|
||||
tests: { passed: 7, failed: 0 },
|
||||
});
|
||||
|
||||
const [alone] = buildStoryTurns(
|
||||
entriesOf([
|
||||
prompt('background'),
|
||||
...bash('b1', 'sleep 25 && pytest -q', 'Run slow tests', 'Command running in background with ID: bg1.'),
|
||||
end(1000),
|
||||
])
|
||||
);
|
||||
const page = buildStoryPage(alone);
|
||||
expect(page.events[1]).toMatchObject({ running: true });
|
||||
expect(page.events[1].ok).toBeUndefined();
|
||||
expect(page.panels.find((p) => p.kind === 'check')!.caption.story).toBe(
|
||||
'Claude starts the tests in the background.'
|
||||
);
|
||||
expect(page.panels.at(-1)!.caption.story).toBe(
|
||||
"Claude's part is done in 1 second. A command is still running in the background."
|
||||
);
|
||||
});
|
||||
|
||||
it('an interrupt ends the turn', () => {
|
||||
const turns = buildStoryTurns(
|
||||
entriesOf([prompt('go'), ...bash('b', 'ls', 'List', 'a'), prompt('[Request interrupted by user]')])
|
||||
|
||||
Reference in new issue
Block a user