Skip to content

Commit 45abd8b

Browse files
test(server): ACP held-root tests with in-turn subagent terminals hold with a monitor
The finalization-window and in-turn-handled re-report tests need a root that is settled and still held when their subagent terminals arrive. A subagent alone no longer holds it, so a running monitor now does; the finalization-window test ends the monitor right after its first subagent so the finish debounce arms as before. Assertions are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent ba1f00a commit 45abd8b

1 file changed

Lines changed: 26 additions & 3 deletions

File tree

‎apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts‎

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5622,6 +5622,9 @@ describe("AcpAdapterV2", () => {
56225622
capabilities: AcpProviderCapabilitiesV2,
56235623
deferFinalizeForBackgroundWork: true,
56245624
enablePostSettleContinuation: true,
5625+
// A running monitor holds the settled root; a subagent alone no longer does.
5626+
extractBackgroundTaskId: (toolCall) =>
5627+
toolCall.toolCallId === "tool-call-monitor-hold" ? "task-monitor-hold" : undefined,
56255628
extractSubagentUpdate: (toolCall) => {
56265629
if (toolCall.toolCallId === "tool-call-generic-1") {
56275630
return {
@@ -5652,7 +5655,10 @@ describe("AcpAdapterV2", () => {
56525655
makeRuntime: makeMockRuntime({
56535656
childProcessSpawner,
56545657
mockAgentPath,
5655-
environment: { T3_ACP_EMIT_GENERIC_TOOL_PLACEHOLDERS: "1" },
5658+
environment: {
5659+
T3_ACP_EMIT_GENERIC_TOOL_PLACEHOLDERS: "1",
5660+
T3_ACP_EMIT_RUNNING_MONITOR_WITH_GENERIC: "1",
5661+
},
56565662
wrapRuntime: (runtime) => ({
56575663
...runtime,
56585664
handleSessionUpdate: (handler) =>
@@ -5716,6 +5722,15 @@ describe("AcpAdapterV2", () => {
57165722
rawOutput: { content: "FIRST_DONE" },
57175723
},
57185724
}).pipe(Effect.provideService(Clock.Clock, blockingClock));
5725+
// The monitor ends too, leaving only subagents: finalize arms.
5726+
yield* sessionUpdateHandler!({
5727+
sessionId: "mock-session-1",
5728+
update: {
5729+
sessionUpdate: "tool_call_update",
5730+
toolCallId: "tool-call-monitor-hold",
5731+
status: "completed",
5732+
},
5733+
}).pipe(Effect.provideService(Clock.Clock, blockingClock));
57195734
for (let attempt = 0; attempt < 10; attempt += 1) {
57205735
yield* Effect.yieldNow;
57215736
}
@@ -6708,8 +6723,13 @@ describe("AcpAdapterV2", () => {
67086723
capabilities: AcpProviderCapabilitiesV2,
67096724
deferFinalizeForBackgroundWork: true,
67106725
enablePostSettleContinuation: true,
6726+
// A running monitor holds the settled root; a subagent alone no longer does.
67116727
extractBackgroundTaskId: (toolCall) =>
6712-
toolCall.toolCallId === "tool-call-generic-1" ? "task-generic-1" : undefined,
6728+
toolCall.toolCallId === "tool-call-generic-1"
6729+
? "task-generic-1"
6730+
: toolCall.toolCallId === "tool-call-monitor-hold"
6731+
? "task-monitor-hold"
6732+
: undefined,
67136733
extractSubagentUpdate: (toolCall) =>
67146734
toolCall.toolCallId !== "tool-call-generic-1"
67156735
? undefined
@@ -6735,7 +6755,10 @@ describe("AcpAdapterV2", () => {
67356755
makeRuntime: makeMockRuntime({
67366756
childProcessSpawner,
67376757
mockAgentPath,
6738-
environment: { T3_ACP_EMIT_GENERIC_TOOL_PLACEHOLDERS: "1" },
6758+
environment: {
6759+
T3_ACP_EMIT_GENERIC_TOOL_PLACEHOLDERS: "1",
6760+
T3_ACP_EMIT_RUNNING_MONITOR_WITH_GENERIC: "1",
6761+
},
67396762
wrapRuntime: (runtime) => ({
67406763
...runtime,
67416764
handleSessionUpdate: (handler) =>

0 commit comments

Comments
 (0)