Skip to content

Commit 1500421

Browse files
committed
fix(claude): refresh fallback selection when reusing a query
1 parent da93dd9 commit 1500421

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6533,8 +6533,23 @@ describe("ClaudeAdapterV2 background wake turns", () => {
65336533
yield* harness.runtime.startTurn(turn(3, original));
65346534
yield* settle;
65356535
assert.deepEqual(harness.liveSelectionChanges[0], { model: original.model });
6536+
const explicitDefault = { ...original, options: [{ id: "fastMode", value: false }] };
6537+
yield* harness.runtime.startTurn(turn(4, explicitDefault));
6538+
yield* Queue.offer(
6539+
harness.sdkMessages,
6540+
refusalFallback("session", "00000000-0000-4000-8000-000000000404"),
6541+
);
6542+
yield* settle;
6543+
const defaultUpdate = harness.events
6544+
.filter((event) => event.type === "app_thread.model_selection.updated")
6545+
.at(-1);
6546+
assert.deepEqual(defaultUpdate?.previousModelSelection, explicitDefault);
6547+
assert.deepEqual(defaultUpdate?.modelSelection, {
6548+
...fallback,
6549+
options: explicitDefault.options,
6550+
});
65366551
const steered = { ...original, model: "claude-sonnet-4-6" };
6537-
const input = turn(4, original);
6552+
const input = turn(5, original);
65386553
yield* harness.runtime.startTurn(input);
65396554
const idAllocator = yield* IdAllocator.IdAllocatorV2;
65406555
yield* harness.runtime.steerTurn({

‎apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11303,6 +11303,7 @@ export const makeClaudeAdapterV2 = Effect.fn("makeClaudeAdapterV2")(function* (
1130311303
}),
1130411304
);
1130511305
}
11306+
existing.modelSelection = turnInput.modelSelection;
1130611307
return existing;
1130711308
}
1130811309

0 commit comments

Comments
 (0)