Skip to content

Commit 6cd905d

Browse files
🤖 fix: apply gateway transformation to compaction model (#1089)
Compaction model preference was bypassing mux-gateway even when the user had gateway enabled for that model. The raw model ID from `resolveCompactionModel()` was used directly without applying `toGatewayModel()` transformation. Now `applyCompactionOverrides()` applies the gateway transformation when a compaction-specific model is used, ensuring consistent routing behavior with normal message flow. _Generated with `mux`_
1 parent 852b6b1 commit 6cd905d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/browser/utils/messages/compactionOptions.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import type { SendMessageOptions } from "@/common/orpc/types";
99
import type { CompactionRequestData } from "@/common/types/message";
10+
import { toGatewayModel } from "@/browser/hooks/useGatewayModels";
1011

1112
/**
1213
* Apply compaction-specific option overrides to base options.
@@ -24,7 +25,8 @@ export function applyCompactionOverrides(
2425
compactData: CompactionRequestData
2526
): SendMessageOptions {
2627
// Use custom model if specified, otherwise use workspace default
27-
const compactionModel = compactData.model ?? baseOptions.model;
28+
// Apply gateway transformation - compactData.model is raw, baseOptions.model is already transformed
29+
const compactionModel = compactData.model ? toGatewayModel(compactData.model) : baseOptions.model;
2830

2931
return {
3032
...baseOptions,

0 commit comments

Comments
 (0)