@@ -4925,7 +4925,6 @@ describe("AcpAdapterV2", () => {
49254925 const mockAgentPath = yield* path.fromFileUrl(
49264926 new URL("../../../scripts/acp-mock-agent.ts", import.meta.url),
49274927 );
4928- const protocolEvents = yield* Queue.bounded<EffectAcpProtocol.AcpProtocolLogEvent>(256);
49294928 const instanceId = ProviderInstanceId.make("acp-test");
49304929 const promptSettled = yield* Deferred.make<void>();
49314930 const adapter = makeAcpAdapterV2({
@@ -4955,7 +4954,6 @@ describe("AcpAdapterV2", () => {
49554954 childProcessSpawner,
49564955 mockAgentPath,
49574956 environment: { T3_ACP_EMIT_GENERIC_TOOL_PLACEHOLDERS: "1" },
4958- protocolEvents,
49594957 }),
49604958 },
49614959 fileSystem,
@@ -4997,11 +4995,7 @@ describe("AcpAdapterV2", () => {
49974995 driver: ACP_TEST_DRIVER,
49984996 nativeTurnId: acpScopedNativeId(instanceId, "mock-session-1:turn:1"),
49994997 });
5000- const interruptFiber = yield* runtime
5001- .interruptTurn({ providerThread, providerTurnId })
5002- .pipe(Effect.forkScoped);
5003- yield* TestClock.adjust("10 seconds");
5004- yield* Fiber.join(interruptFiber);
4998+ yield* runtime.interruptTurn({ providerThread, providerTurnId });
50054999
50065000 let terminalStatus: string | null = null;
50075001 while (terminalStatus === null) {
@@ -5027,7 +5021,6 @@ describe("AcpAdapterV2", () => {
50275021 const mockAgentPath = yield* path.fromFileUrl(
50285022 new URL("../../../scripts/acp-mock-agent.ts", import.meta.url),
50295023 );
5030- const protocolEvents = yield* Queue.bounded<EffectAcpProtocol.AcpProtocolLogEvent>(256);
50315024 const instanceId = ProviderInstanceId.make("acp-test");
50325025 let subagentPhase: "spawn" | "complete" = "spawn";
50335026 const promptSettled = yield* Deferred.make<void>();
@@ -5071,7 +5064,6 @@ describe("AcpAdapterV2", () => {
50715064 childProcessSpawner,
50725065 mockAgentPath,
50735066 environment: { T3_ACP_EMIT_GENERIC_TOOL_PLACEHOLDERS: "1" },
5074- protocolEvents,
50755067 }),
50765068 },
50775069 fileSystem,
@@ -5112,11 +5104,7 @@ describe("AcpAdapterV2", () => {
51125104 driver: ACP_TEST_DRIVER,
51135105 nativeTurnId: acpScopedNativeId(instanceId, "mock-session-1:turn:1"),
51145106 });
5115- const interruptFiber = yield* runtime
5116- .interruptTurn({ providerThread, providerTurnId: firstProviderTurnId })
5117- .pipe(Effect.forkScoped);
5118- yield* TestClock.adjust("10 seconds");
5119- yield* Fiber.join(interruptFiber);
5107+ yield* runtime.interruptTurn({ providerThread, providerTurnId: firstProviderTurnId });
51205108
51215109 let subagentTurnItemId: string | null = null;
51225110 let firstTerminalStatus: string | null = null;
@@ -5181,7 +5169,6 @@ describe("AcpAdapterV2", () => {
51815169 const mockAgentPath = yield* path.fromFileUrl(
51825170 new URL("../../../scripts/acp-mock-agent.ts", import.meta.url),
51835171 );
5184- const protocolEvents = yield* Queue.bounded<EffectAcpProtocol.AcpProtocolLogEvent>(256);
51855172 const instanceId = ProviderInstanceId.make("acp-test");
51865173 let subagentPhase: "spawn" | "complete" = "spawn";
51875174 const promptSettled = yield* Deferred.make<void>();
@@ -5223,7 +5210,6 @@ describe("AcpAdapterV2", () => {
52235210 childProcessSpawner,
52245211 mockAgentPath,
52255212 environment: { T3_ACP_EMIT_GENERIC_TOOL_PLACEHOLDERS: "1" },
5226- protocolEvents,
52275213 }),
52285214 },
52295215 fileSystem,
@@ -5271,11 +5257,7 @@ describe("AcpAdapterV2", () => {
52715257 driver: ACP_TEST_DRIVER,
52725258 nativeTurnId: acpScopedNativeId(instanceId, "mock-session-1:turn:1"),
52735259 });
5274- const interruptFiber = yield* runtime
5275- .interruptTurn({ providerThread, providerTurnId: firstProviderTurnId })
5276- .pipe(Effect.forkScoped);
5277- yield* TestClock.adjust("10 seconds");
5278- yield* Fiber.join(interruptFiber);
5260+ yield* runtime.interruptTurn({ providerThread, providerTurnId: firstProviderTurnId });
52795261
52805262 let firstTerminalStatus: string | null = null;
52815263 while (firstTerminalStatus === null) {
@@ -5334,7 +5316,6 @@ describe("AcpAdapterV2", () => {
53345316 const mockAgentPath = yield* path.fromFileUrl(
53355317 new URL("../../../scripts/acp-mock-agent.ts", import.meta.url),
53365318 );
5337- const protocolEvents = yield* Queue.bounded<EffectAcpProtocol.AcpProtocolLogEvent>(256);
53385319 const secondPromptWireReturned = yield* Deferred.make<void>();
53395320 const releaseSecondPromptCompletion = yield* Deferred.make<void>();
53405321 const instanceId = ProviderInstanceId.make("acp-test");
@@ -5382,7 +5363,6 @@ describe("AcpAdapterV2", () => {
53825363 childProcessSpawner,
53835364 mockAgentPath,
53845365 environment: { T3_ACP_EMIT_GENERIC_TOOL_PLACEHOLDERS: "1" },
5385- protocolEvents,
53865366 wrapRuntime: (runtime) => ({
53875367 ...runtime,
53885368 handleSessionUpdate: (handler) =>
@@ -5449,11 +5429,7 @@ describe("AcpAdapterV2", () => {
54495429 driver: ACP_TEST_DRIVER,
54505430 nativeTurnId: acpScopedNativeId(instanceId, "mock-session-1:turn:1"),
54515431 });
5452- const interruptFiber = yield* runtime
5453- .interruptTurn({ providerThread, providerTurnId: firstProviderTurnId })
5454- .pipe(Effect.forkScoped);
5455- yield* TestClock.adjust("10 seconds");
5456- yield* Fiber.join(interruptFiber);
5432+ yield* runtime.interruptTurn({ providerThread, providerTurnId: firstProviderTurnId });
54575433
54585434 let firstTerminalStatus: string | null = null;
54595435 while (firstTerminalStatus === null) {
@@ -5577,7 +5553,6 @@ describe("AcpAdapterV2", () => {
55775553 const mockAgentPath = yield* path.fromFileUrl(
55785554 new URL("../../../scripts/acp-mock-agent.ts", import.meta.url),
55795555 );
5580- const protocolEvents = yield* Queue.bounded<EffectAcpProtocol.AcpProtocolLogEvent>(256);
55815556 const baseClock = yield* Clock.Clock;
55825557 const finalizationClockRead = yield* Deferred.make<void>();
55835558 const releaseFinalizationClockRead = yield* Deferred.make<void>();
@@ -5649,7 +5624,6 @@ describe("AcpAdapterV2", () => {
56495624 childProcessSpawner,
56505625 mockAgentPath,
56515626 environment: { T3_ACP_EMIT_GENERIC_TOOL_PLACEHOLDERS: "1" },
5652- protocolEvents,
56535627 wrapRuntime: (runtime) => ({
56545628 ...runtime,
56555629 handleSessionUpdate: (handler) =>
@@ -6421,7 +6395,6 @@ describe("AcpAdapterV2", () => {
64216395 const mockAgentPath = yield* path.fromFileUrl(
64226396 new URL("../../../scripts/acp-mock-agent.ts", import.meta.url),
64236397 );
6424- const protocolEvents = yield* Queue.bounded<EffectAcpProtocol.AcpProtocolLogEvent>(256);
64256398 const continuationRequests: Array<ProviderContinuationRequest> = [];
64266399 const bufferedAssistantText = "BUFFERED_WAKE_AFTER_USER_ATTACH";
64276400 const instanceId = ProviderInstanceId.make("acp-test");
@@ -6467,7 +6440,6 @@ describe("AcpAdapterV2", () => {
64676440 childProcessSpawner,
64686441 mockAgentPath,
64696442 environment: { T3_ACP_EMIT_GENERIC_TOOL_PLACEHOLDERS: "1" },
6470- protocolEvents,
64716443 wrapRuntime: (runtime) => ({
64726444 ...runtime,
64736445 handleSessionUpdate: (handler) =>
@@ -6529,11 +6501,7 @@ describe("AcpAdapterV2", () => {
65296501 driver: ACP_TEST_DRIVER,
65306502 nativeTurnId: acpScopedNativeId(instanceId, "mock-session-1:turn:1"),
65316503 });
6532- const interruptFiber = yield* runtime
6533- .interruptTurn({ providerThread, providerTurnId: firstProviderTurnId })
6534- .pipe(Effect.forkScoped);
6535- yield* TestClock.adjust("10 seconds");
6536- yield* Fiber.join(interruptFiber);
6504+ yield* runtime.interruptTurn({ providerThread, providerTurnId: firstProviderTurnId });
65376505
65386506 let firstTerminalStatus: string | null = null;
65396507 while (firstTerminalStatus === null) {
@@ -6716,7 +6684,6 @@ describe("AcpAdapterV2", () => {
67166684 new URL("../../../scripts/acp-mock-agent.ts", import.meta.url),
67176685 );
67186686 const continuationRequests: Array<ProviderContinuationRequest> = [];
6719- const protocolEvents = yield* Queue.bounded<EffectAcpProtocol.AcpProtocolLogEvent>(256);
67206687 const promptWireReturned = yield* Deferred.make<void>();
67216688 const releasePromptCompletion = yield* Deferred.make<void>();
67226689 const instanceId = ProviderInstanceId.make("acp-test");
@@ -6764,7 +6731,6 @@ describe("AcpAdapterV2", () => {
67646731 childProcessSpawner,
67656732 mockAgentPath,
67666733 environment: { T3_ACP_EMIT_GENERIC_TOOL_PLACEHOLDERS: "1" },
6767- protocolEvents,
67686734 wrapRuntime: (runtime) => ({
67696735 ...runtime,
67706736 handleSessionUpdate: (handler) =>
@@ -6850,11 +6816,7 @@ describe("AcpAdapterV2", () => {
68506816 driver: ACP_TEST_DRIVER,
68516817 nativeTurnId: acpScopedNativeId(instanceId, "mock-session-1:turn:1"),
68526818 });
6853- const interruptFiber = yield* runtime
6854- .interruptTurn({ providerThread, providerTurnId: firstProviderTurnId })
6855- .pipe(Effect.forkScoped);
6856- yield* TestClock.adjust("10 seconds");
6857- yield* Fiber.join(interruptFiber);
6819+ yield* runtime.interruptTurn({ providerThread, providerTurnId: firstProviderTurnId });
68586820
68596821 let firstTerminalStatus: string | null = null;
68606822 while (firstTerminalStatus === null) {
@@ -7191,7 +7153,6 @@ describe("AcpAdapterV2", () => {
71917153 const mockAgentPath = yield* path.fromFileUrl(
71927154 new URL("../../../scripts/acp-mock-agent.ts", import.meta.url),
71937155 );
7194- const protocolEvents = yield* Queue.bounded<EffectAcpProtocol.AcpProtocolLogEvent>(256);
71957156 const continuationRequests: Array<ProviderContinuationRequest> = [];
71967157 const instanceId = ProviderInstanceId.make("acp-test");
71977158 const childSessionId = "mock-child-session-pending-continuation";
@@ -7238,7 +7199,6 @@ describe("AcpAdapterV2", () => {
72387199 childProcessSpawner,
72397200 mockAgentPath,
72407201 environment: { T3_ACP_EMIT_GENERIC_TOOL_PLACEHOLDERS: "1" },
7241- protocolEvents,
72427202 wrapRuntime: (runtime) => ({
72437203 ...runtime,
72447204 handleSessionUpdate: (handler) =>
@@ -7300,11 +7260,7 @@ describe("AcpAdapterV2", () => {
73007260 driver: ACP_TEST_DRIVER,
73017261 nativeTurnId: acpScopedNativeId(instanceId, "mock-session-1:turn:1"),
73027262 });
7303- const interruptFiber = yield* runtime
7304- .interruptTurn({ providerThread, providerTurnId: firstProviderTurnId })
7305- .pipe(Effect.forkScoped);
7306- yield* TestClock.adjust("10 seconds");
7307- yield* Fiber.join(interruptFiber);
7263+ yield* runtime.interruptTurn({ providerThread, providerTurnId: firstProviderTurnId });
73087264
73097265 let firstTerminalStatus: string | null = null;
73107266 while (firstTerminalStatus === null) {
@@ -7468,7 +7424,6 @@ describe("AcpAdapterV2", () => {
74687424 const mockAgentPath = yield* path.fromFileUrl(
74697425 new URL("../../../scripts/acp-mock-agent.ts", import.meta.url),
74707426 );
7471- const protocolEvents = yield* Queue.bounded<EffectAcpProtocol.AcpProtocolLogEvent>(256);
74727427 const continuationRequests: Array<ProviderContinuationRequest> = [];
74737428 const instanceId = ProviderInstanceId.make("acp-test");
74747429 const childSessionId = "mock-child-session-root-then-child";
@@ -7514,7 +7469,6 @@ describe("AcpAdapterV2", () => {
75147469 childProcessSpawner,
75157470 mockAgentPath,
75167471 environment: { T3_ACP_EMIT_GENERIC_TOOL_PLACEHOLDERS: "1" },
7517- protocolEvents,
75187472 wrapRuntime: (runtime) => ({
75197473 ...runtime,
75207474 handleSessionUpdate: (handler) =>
@@ -7576,11 +7530,7 @@ describe("AcpAdapterV2", () => {
75767530 driver: ACP_TEST_DRIVER,
75777531 nativeTurnId: acpScopedNativeId(instanceId, "mock-session-1:turn:1"),
75787532 });
7579- const interruptFiber = yield* runtime
7580- .interruptTurn({ providerThread, providerTurnId: firstProviderTurnId })
7581- .pipe(Effect.forkScoped);
7582- yield* TestClock.adjust("10 seconds");
7583- yield* Fiber.join(interruptFiber);
7533+ yield* runtime.interruptTurn({ providerThread, providerTurnId: firstProviderTurnId });
75847534
75857535 let firstTerminalStatus: string | null = null;
75867536 while (firstTerminalStatus === null) {
@@ -7716,7 +7666,6 @@ describe("AcpAdapterV2", () => {
77167666 const mockAgentPath = yield* path.fromFileUrl(
77177667 new URL("../../../scripts/acp-mock-agent.ts", import.meta.url),
77187668 );
7719- const protocolEvents = yield* Queue.bounded<EffectAcpProtocol.AcpProtocolLogEvent>(256);
77207669 const instanceId = ProviderInstanceId.make("acp-test");
77217670 let subagentPhase: "spawn" | "complete" = "spawn";
77227671 let cancelCalled = false;
@@ -7773,7 +7722,6 @@ describe("AcpAdapterV2", () => {
77737722 runtimeOrdinalSeen = Math.max(runtimeOrdinalSeen, runtimeOrdinal);
77747723 return { T3_ACP_EMIT_GENERIC_TOOL_PLACEHOLDERS: "1" };
77757724 },
7776- protocolEvents,
77777725 wrapCancel: (cancel) =>
77787726 Effect.sync(() => {
77797727 cancelCalled = true;
@@ -7820,11 +7768,7 @@ describe("AcpAdapterV2", () => {
78207768 driver: ACP_TEST_DRIVER,
78217769 nativeTurnId: acpScopedNativeId(instanceId, "mock-session-1:turn:1"),
78227770 });
7823- const interruptFiber = yield* runtime
7824- .interruptTurn({ providerThread, providerTurnId: firstProviderTurnId })
7825- .pipe(Effect.forkScoped);
7826- yield* TestClock.adjust("10 seconds");
7827- yield* Fiber.join(interruptFiber);
7771+ yield* runtime.interruptTurn({ providerThread, providerTurnId: firstProviderTurnId });
78287772 assert.isFalse(
78297773 cancelCalled,
78307774 "settled soft steer must not send session/cancel (the real Grok CLI kills background subagents on cancel)",
@@ -13675,7 +13619,6 @@ describe("AcpAdapterV2", () => {
1367513619 const mockAgentPath = yield* path.fromFileUrl(
1367613620 new URL("../../../scripts/acp-mock-agent.ts", import.meta.url),
1367713621 );
13678- const protocolEvents = yield* Queue.bounded<EffectAcpProtocol.AcpProtocolLogEvent>(256);
1367913622 const instanceId = ProviderInstanceId.make("acp-test");
1368013623 let subagentPhase: "spawn" | "complete" = "spawn";
1368113624 const promptSettled = yield* Deferred.make<void>();
@@ -13717,7 +13660,6 @@ describe("AcpAdapterV2", () => {
1371713660 childProcessSpawner,
1371813661 mockAgentPath,
1371913662 environment: { T3_ACP_EMIT_GENERIC_TOOL_PLACEHOLDERS: "1" },
13720- protocolEvents,
1372113663 }),
1372213664 },
1372313665 fileSystem,
@@ -13760,15 +13702,11 @@ describe("AcpAdapterV2", () => {
1376013702 driver: ACP_TEST_DRIVER,
1376113703 nativeTurnId: acpScopedNativeId(instanceId, "mock-session-1:turn:1"),
1376213704 });
13763- const interruptFiber = yield* runtime
13764- .interruptTurn({
13765- providerThread,
13766- providerTurnId: firstProviderTurnId,
13767- requestRuntimeRestart: true,
13768- })
13769- .pipe(Effect.forkScoped);
13770- yield* TestClock.adjust("10 seconds");
13771- yield* Fiber.join(interruptFiber);
13705+ yield* runtime.interruptTurn({
13706+ providerThread,
13707+ providerTurnId: firstProviderTurnId,
13708+ requestRuntimeRestart: true,
13709+ });
1377213710
1377313711 let subagentStatus: string | null = null;
1377413712 let firstTerminalStatus: string | null = null;
0 commit comments