Skip to content

Commit d8fce0b

Browse files
committed
test(server): expect failed ACP tools to settle without Stop
1 parent 98b2f65 commit d8fce0b

3 files changed

Lines changed: 16 additions & 28 deletions

File tree

‎apps/server/src/orchestration-v2/testkit/fixtures/index.ts‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,10 @@ import {
177177
import { toolCallReadOnlyOnRequestInput } from "./tool_call_read_only_on_request/input.ts";
178178
import { assertToolCallReadOnlyOnRequestFxOutput } from "./tool_call_read_only_on_request/fx_output.ts";
179179
import {
180-
stopBackgroundWorkAfterFailedTurnInput,
181-
stopBackgroundWorkAfterReleaseInput,
180+
unfinishedToolsAfterFailedTurnInput,
181+
unfinishedToolsAfterReleaseInput,
182182
} from "./stop_background_work_after_failed_turn/input.ts";
183-
import { assertStopBackgroundWorkAfterFailedTurnOutput } from "./stop_background_work_after_failed_turn/output.ts";
183+
import { assertUnfinishedToolsAfterFailedTurnOutput } from "./stop_background_work_after_failed_turn/output.ts";
184184
import { assertToolCallRestrictedGranularClaudeOutput } from "./tool_call_restricted_granular/claude_output.ts";
185185
import { assertToolCallRestrictedGranularOutput } from "./tool_call_restricted_granular/codex_output.ts";
186186
import { toolCallRestrictedGranularInput } from "./tool_call_restricted_granular/input.ts";
@@ -1798,23 +1798,24 @@ export const ORCHESTRATOR_REPLAY_FIXTURES: ReadonlyArray<OrchestratorReplayFixtu
17981798
],
17991799
},
18001800
{
1801-
name: "stop_background_work_after_failed_turn",
1802-
buildInput: stopBackgroundWorkAfterFailedTurnInput,
1801+
name: "unfinished_tools_after_failed_turn",
1802+
buildInput: unfinishedToolsAfterFailedTurnInput,
18031803
providers: [
18041804
{
18051805
driver: ProviderDriverKind.make("acpRegistry"),
18061806
transcriptFile: new URL(
18071807
"./stop_background_work_after_failed_turn/registry_transcript.ndjson",
18081808
import.meta.url,
18091809
),
1810+
recordedScenario: "stop_background_work_after_failed_turn",
18101811
modelSelection: ACP_REGISTRY_MODEL_SELECTION,
1811-
assertOutput: assertStopBackgroundWorkAfterFailedTurnOutput,
1812+
assertOutput: assertUnfinishedToolsAfterFailedTurnOutput,
18121813
},
18131814
],
18141815
},
18151816
{
1816-
name: "stop_background_work_after_release",
1817-
buildInput: stopBackgroundWorkAfterReleaseInput,
1817+
name: "unfinished_tools_after_release",
1818+
buildInput: unfinishedToolsAfterReleaseInput,
18181819
providers: [
18191820
{
18201821
driver: ProviderDriverKind.make("acpRegistry"),
@@ -1824,7 +1825,7 @@ export const ORCHESTRATOR_REPLAY_FIXTURES: ReadonlyArray<OrchestratorReplayFixtu
18241825
),
18251826
recordedScenario: "stop_background_work_after_failed_turn",
18261827
modelSelection: ACP_REGISTRY_MODEL_SELECTION,
1827-
assertOutput: assertStopBackgroundWorkAfterFailedTurnOutput,
1828+
assertOutput: assertUnfinishedToolsAfterFailedTurnOutput,
18281829
},
18291830
],
18301831
},

‎apps/server/src/orchestration-v2/testkit/fixtures/stop_background_work_after_failed_turn/input.ts‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,17 @@ import type { OrchestratorFixtureInput } from "../shared.ts";
33
export const STOP_BACKGROUND_WORK_AFTER_FAILED_TURN_PROMPT =
44
"Start the dev server in the background with `bun run dev` and keep it running.";
55

6-
export function stopBackgroundWorkAfterFailedTurnInput(): OrchestratorFixtureInput {
6+
export function unfinishedToolsAfterFailedTurnInput(): OrchestratorFixtureInput {
77
return {
8-
steps: [
9-
{ type: "message", text: STOP_BACKGROUND_WORK_AFTER_FAILED_TURN_PROMPT },
10-
{ type: "stop_background_work", targetRunIndex: 1 },
11-
],
8+
steps: [{ type: "message", text: STOP_BACKGROUND_WORK_AFTER_FAILED_TURN_PROMPT }],
129
};
1310
}
1411

15-
export function stopBackgroundWorkAfterReleaseInput(): OrchestratorFixtureInput {
12+
export function unfinishedToolsAfterReleaseInput(): OrchestratorFixtureInput {
1613
return {
1714
steps: [
1815
{ type: "message", text: STOP_BACKGROUND_WORK_AFTER_FAILED_TURN_PROMPT },
1916
{ type: "advance_clock", duration: "31 minutes" },
20-
{ type: "stop_background_work", targetRunIndex: 1 },
2117
],
2218
};
2319
}

‎apps/server/src/orchestration-v2/testkit/fixtures/stop_background_work_after_failed_turn/output.ts‎

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
} from "../shared.ts";
1111
import { STOP_BACKGROUND_WORK_AFTER_FAILED_TURN_PROMPT } from "./input.ts";
1212

13-
export function assertStopBackgroundWorkAfterFailedTurnOutput(
13+
export function assertUnfinishedToolsAfterFailedTurnOutput(
1414
result: OrchestratorV2ScenarioResult,
1515
transcript: ProviderReplayTranscript,
1616
) {
@@ -19,21 +19,12 @@ export function assertStopBackgroundWorkAfterFailedTurnOutput(
1919
assertSemanticProjectionIntegrity(projection);
2020
assertUserMessagesInclude(projection, [STOP_BACKGROUND_WORK_AFTER_FAILED_TURN_PROMPT]);
2121

22-
const before = result.capturedShellSnapshots
23-
.get("before-stop")
24-
?.threads.find((thread) => thread.id === projection.thread.id);
25-
assert.deepEqual(
26-
before?.pendingBackgroundTasks?.map((task) => task.kind),
27-
["command"],
28-
"the failed turn leaves its command on the Waiting strip",
29-
);
30-
3122
const command = projection.turnItems.find((item) => item.type === "command_execution");
32-
assert.equal(command?.status, "interrupted");
23+
assert.equal(command?.status, "failed");
3324
assert.isNotNull(command?.completedAt);
3425
const shell = result.shellSnapshot.threads.find((thread) => thread.id === projection.thread.id);
3526
assert.deepEqual(shell?.pendingBackgroundTasks ?? [], []);
36-
assert.include(
27+
assert.notInclude(
3728
projection.turnItems.map((item) => item.type),
3829
"run_interrupt_request",
3930
);

0 commit comments

Comments
 (0)