Skip to content

Commit de46c2f

Browse files
committed
Fix sameModelSelectionOptions to compare only options, not full ModelSelection
The function was comparing the entire ModelSelection (provider, model, options) via JSON.stringify, but shouldRestartForModelSelectionChange is meant to restart claudeAgent sessions only when options change. Since both adapters report sessionModelSwitch: "in-session", model-name-only changes should use the in-session setModel call, not trigger a full session restart. Changed the comparison to only look at the options field of ModelSelection.
1 parent 96d6160 commit de46c2f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/server/src/orchestration/Layers/ProviderCommandReactor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const TEMP_WORKTREE_BRANCH_PATTERN = new RegExp(`^${WORKTREE_BRANCH_PREFIX}\\/[0
7878
const sameModelSelectionOptions = (
7979
left: ModelSelection | undefined,
8080
right: ModelSelection | undefined,
81-
): boolean => JSON.stringify(left ?? null) === JSON.stringify(right ?? null);
81+
): boolean => JSON.stringify(left?.options ?? null) === JSON.stringify(right?.options ?? null);
8282

8383
function isUnknownPendingApprovalRequestError(cause: Cause.Cause<ProviderServiceError>): boolean {
8484
const error = Cause.squash(cause);

0 commit comments

Comments
 (0)