Skip to content

Commit 744a84e

Browse files
test(server): the handoff tool call test expects its run to complete
The test waited for the run to end failed, which was the behaviour this branch fixes. The tool call still ends interrupted; the run now completes. Co-Authored-By: Claude Fable 5.2 <[email protected]>
1 parent 4eff08e commit 744a84e

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎apps/server/src/orchestration-v2/testkit/ProviderSwitch.integration.test.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2004,8 +2004,9 @@ describe("orchestration v2 provider switching", () => {
20042004
yield* Deferred.await(started);
20052005
yield* Fiber.join(toolCallRunning);
20062006

2007-
const runFailed = yield* awaitEvent(
2008-
(event) => event.type === "run.updated" && event.payload.status === "failed",
2007+
// The handoff itself is not a failure: the run completes once the session closes.
2008+
const runSettled = yield* awaitEvent(
2009+
(event) => event.type === "run.updated" && event.payload.status === "waiting",
20092010
);
20102011
yield* orchestrator.dispatch({
20112012
type: "thread.metadata.update",
@@ -2016,9 +2017,11 @@ describe("orchestration v2 provider switching", () => {
20162017
expectedWorktreePath: null,
20172018
});
20182019
yield* worker.drain();
2019-
yield* Fiber.join(runFailed);
2020+
yield* Fiber.join(runSettled);
2021+
yield* worker.drain();
20202022

20212023
const projection = yield* orchestrator.getThreadProjection(scenarioThreadId);
2024+
assert.equal(projection.runs.at(-1)?.status, "completed");
20222025
const toolCall = projection.turnItems.find((item) => item.id === toolCallId);
20232026
assert.equal(toolCall?.status, "interrupted");
20242027
assert.isNotNull(toolCall?.completedAt);

0 commit comments

Comments
 (0)