test: add waiting_user continuity gate case

This commit is contained in:
Eve
2026-04-24 11:57:37 +08:00
parent eeec38bff6
commit 99d2de44fb

View File

@@ -174,6 +174,47 @@ stdout=${result.stdout}`);
} }
}, },
}, },
{
name: 'continuity: passes when task is complete, next action is known, no dispatch receipt exists, and closure is waiting_user',
run() {
const fixture = createFixture({
'input.json': {
planId: 'plan-waiting-user-closure',
currentTask: 'task-8',
taskState: 'complete',
nextDerivedAction: {
type: 'message_subagent',
task: 'continue with task-9',
},
replyClosureState: 'waiting_user',
dispatchReceipt: null,
},
});
try {
const result = runGate({
args: ['--compact', '--input', fixture.path('input.json')],
});
if (result.status !== 0 && result.status !== null) {
throw new Error(`expected controlled execution, got status=${result.status}
${result.stderr || result.stdout}`);
}
if (!result.json || typeof result.json !== 'object') {
throw new Error(`expected JSON output
stdout=${result.stdout}`);
}
if (result.json.ok !== true) {
throw new Error(`expected continuity pass ok=true when closure is waiting_user, got ${JSON.stringify(result.json)}`);
}
} finally {
fixture.cleanup();
}
},
},
]; ];
const results = []; const results = [];