Skip to content

Commit e8e55ec

Browse files
NicL9923claude
authored andcommitted
test(provider-copilot): a subagent starting keeps a steer's abort from reading as a cancel
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 1677e19 commit e8e55ec

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎packages/provider-copilot/src/server/copilotSdkRuntime.test.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,21 @@ it.effect("steers a working main agent by queueing, then interrupting only its t
571571
}).pipe(Effect.scoped),
572572
);
573573

574+
it.effect("keeps a steer's abort from counting as a cancel when a subagent starts", () =>
575+
Effect.gen(function* () {
576+
const fakes = makeFakes();
577+
const runtime = yield* makeCopilotSdkRuntime({ cwd: "/repo", client: fakes.client });
578+
const prompt = yield* startPrompt(runtime);
579+
fakes.emit(event("assistant.turn_start"));
580+
yield* runtime.request(COPILOT_SDK_STEER_METHOD, { text: "change course" });
581+
582+
fakes.emit(event("assistant.turn_start", {}, "agent-1"));
583+
fakes.emit(event("session.idle", { aborted: true }));
584+
585+
assert.strictEqual((yield* Fiber.join(prompt)).stopReason, "end_turn");
586+
}).pipe(Effect.scoped),
587+
);
588+
574589
// regression: interrupting after the main agent finished loses the queued message
575590
it.effect("applies a reasoning level when Copilot reports no current one", () =>
576591
Effect.gen(function* () {

0 commit comments

Comments
 (0)