test(acp): honor the asynchronous content fixture contract

The initial-cancellation regression supplied a synchronous content array to
defineContentToolFixture, whose executor contract requires a Promise of
content blocks. Vitest executes the fixture, but the strict repository
Host build correctly rejects its signature with TS2739.

Return the same blocks through Promise.resolve. Keep the deterministic
stream/output gates and assertions unchanged; do not widen the shared
fixture API merely to accept this one caller.

Validation: the focused initial-cancellation regression passes. The full
Host build is rerun before publication to validate the fixture signature.
This commit is contained in:
Tianyi Cui committed 2026-10-06 02:00:43 +08:00
1 parent cbf618845a
commit 813c7d2ef8
1 file changed
+1 -1
+1 -1
View File
@@ -696,7 +696,7 @@ describe('ACP prompt lifecycle', () => {
const ref = await harness.attachments!.saveImage({ data: Uint8Array.of(6), mediaType: 'image/png' })
ctx.tools.register(defineContentToolFixture({
name: 'continue_stream', description: 'Continue the interrupted response.', parameters: {},
execute: () => [{ type: 'text', text: 'continue until cancelled' }],
execute: () => Promise.resolve([{ type: 'text', text: 'continue until cancelled' }]),
}))
// Interrupted streams retain only text/reasoning, so a completed step supplies the queued image.
script.push([