test: add blocked closure continuity case

This commit is contained in:
Eve
2026-04-24 11:58:49 +08:00
parent 99d2de44fb
commit cff363f7c7

View File

@@ -215,6 +215,47 @@ stdout=${result.stdout}`);
}
},
},
{
name: 'continuity: passes when task is complete, next action is known, no dispatch receipt exists, and closure is blocked',
run() {
const fixture = createFixture({
'input.json': {
planId: 'plan-blocked-closure',
currentTask: 'task-9',
taskState: 'complete',
nextDerivedAction: {
type: 'message_subagent',
task: 'continue with task-10',
},
replyClosureState: 'blocked',
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 blocked, got ${JSON.stringify(result.json)}`);
}
} finally {
fixture.cleanup();
}
},
},
];
const results = [];