diff --git a/packages/support/acp-snapshot/tests/fixtures/fake-acp-agent.ts b/packages/support/acp-snapshot/tests/fixtures/fake-acp-agent.ts index 5dd5524ed0..647ffbb5d9 100644 --- a/packages/support/acp-snapshot/tests/fixtures/fake-acp-agent.ts +++ b/packages/support/acp-snapshot/tests/fixtures/fake-acp-agent.ts @@ -266,7 +266,9 @@ function flushLogsAndExit(): void { `setTimeout(() => process.stdout.write(${JSON.stringify(`${frame}\n`)}), 50)`, `setTimeout(() => process.stderr.write(${JSON.stringify('late inherited stderr\n')}), 75)`, ].join(';') - spawn(process.execPath, ['-e', code], { stdio: ['ignore', 1, 2] }).unref() + spawn(process.execPath, ['-e', code], { + stdio: ['ignore', process.stdout, process.stderr], + }).unref() } process.exit(0) } diff --git a/packages/support/acp-snapshot/tests/harness.spec.ts b/packages/support/acp-snapshot/tests/harness.spec.ts index 2c4478e158..08b069338c 100644 --- a/packages/support/acp-snapshot/tests/harness.spec.ts +++ b/packages/support/acp-snapshot/tests/harness.spec.ts @@ -139,6 +139,9 @@ describe('runScenario', () => { update.sessionUpdate === 'agent_message_chunk' && update.content.type === 'text' && update.content.text === 'late inherited stdout') + // Arm rejection handling before close may exhaust the stream; the later assertion still + // observes the original promise and turns a missing inherited frame into the test failure. + void lateUpdate.catch(() => undefined) await launched.close()