Skip to content

Commit 147a119

Browse files
committed
refactor(server): clarify Claude live model guard
1 parent 61979ed commit 147a119

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9659,13 +9659,12 @@ export const makeClaudeAdapterV2 = Effect.fn("makeClaudeAdapterV2")(function* (
96599659
existing.openedPermissionMode === queryPolicy.permissionMode)
96609660
) {
96619661
const live = existing;
9662-
// `setModel` bypasses a custom binary's `--model` rewrite, so send it only for a
9663-
// new model, or after a failed change (empty identity) left the live model unknown.
9662+
// Preserve launcher-selected models unless the model changed or a failed update left it unknown.
96649663
yield* (
9665-
live.selection.queryIdentity !== "" &&
9666-
live.selection.apiModelId === compiledSelection.apiModelId
9667-
? Effect.void
9668-
: live.query.setModel(compiledSelection.apiModelId)
9664+
live.selection.queryIdentity === "" ||
9665+
live.selection.apiModelId !== compiledSelection.apiModelId
9666+
? live.query.setModel(compiledSelection.apiModelId)
9667+
: Effect.void
96699668
).pipe(
96709669
Effect.andThen(
96719670
live.query.applyFlagSettings(claudeLiveSelectionFlagSettings(compiledSelection)),

0 commit comments

Comments
 (0)