test(snapshot): cover minimum child turn waits

This commit is contained in:
_Kerman
2026-08-03 12:32:54 +08:00
parent ffb35cdb9d
commit 616ee55372

View File

@@ -826,6 +826,16 @@ describe('runScenario', () => {
{ agent: AGENT, mode: 'replay', fixtureFile: closed.fixtureFile },
)
expect(result.sessionLogs[1]?.parentSession).toBe(result.sessionId)
await expect(runScenario(
{
steps: [
...boot,
{ op: 'promptAndCancel', text: 'hang' },
{ op: 'waitForSubagentTurnEnd', minimumTurn: 2, timeoutMs: 20 },
],
},
{ agent: AGENT, mode: 'replay', fixtureFile: closed.fixtureFile },
)).rejects.toThrow(/subagent child #1 did not persist closed turn 2 within 20ms/)
const seedOnly = await scenario({
prompt: 'hang-until-cancel',
@@ -859,13 +869,13 @@ describe('runScenario', () => {
],
},
{ agent: AGENT, mode: 'replay', fixtureFile: seedOnly.fixtureFile },
)).rejects.toThrow(/subagent child #1 did not persist a closed work turn within 20ms/)
)).rejects.toThrow(/subagent child #1 did not persist closed turn 1 within 20ms/)
const missing = await scenario({})
await expect(runScenario(
{ steps: [...boot, { op: 'waitForSubagentTurnEnd', child: 2, timeoutMs: 20 }] },
{ agent: AGENT, mode: 'replay', fixtureFile: missing.fixtureFile },
)).rejects.toThrow(/subagent child #2 did not persist a closed work turn within 20ms/)
)).rejects.toThrow(/subagent child #2 did not persist closed turn 1 within 20ms/)
})
it('waitForTitleAfterTurnEnd times out when the title precedes the boundary', { timeout: 20_000 }, async () => {