Skip to content

Commit 34f5565

Browse files
committed
🤖 fix: use defaultModel directly instead of wrapper
Remove unnecessary defaults.ts wrapper - CLI code can import defaultModel directly from @/common/utils/ai/models. _Generated with `mux`_
1 parent 39b066b commit 34f5565

File tree

4 files changed

+6
-19
lines changed

4 files changed

+6
-19
lines changed

src/cli/debug/agentSessionCli.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
type SendMessageOptions,
2525
type WorkspaceChatMessage,
2626
} from "@/common/types/ipc";
27-
import { getDefaultModel } from "@/common/utils/model/defaults";
27+
import { defaultModel } from "@/common/utils/ai/models";
2828
import { ensureProvidersConfig } from "@/common/utils/providers/ensureProvidersConfig";
2929
import { modeToToolPolicy, PLAN_MODE_INSTRUCTION } from "@/common/utils/ui/modeUtils";
3030
import {
@@ -184,7 +184,7 @@ async function main(): Promise<void> {
184184
}
185185

186186
const model =
187-
values.model && values.model.trim().length > 0 ? values.model.trim() : getDefaultModel();
187+
values.model && values.model.trim().length > 0 ? values.model.trim() : defaultModel;
188188
const timeoutMs = parseTimeout(values.timeout);
189189
const thinkingLevel = parseThinkingLevel(values["thinking-level"]);
190190
const initialMode = parseMode(values.mode);

src/cli/debug/costs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as path from "path";
33
import { defaultConfig } from "@/node/config";
44
import type { MuxMessage } from "@/common/types/message";
55
import { calculateTokenStats } from "@/common/utils/tokens/tokenStatsCalculator";
6-
import { getDefaultModel } from "@/common/utils/model/defaults";
6+
import { defaultModel } from "@/common/utils/ai/models";
77

88
/**
99
* Debug command to display cost/token statistics for a workspace
@@ -35,7 +35,7 @@ export async function costsCommand(workspaceId: string) {
3535

3636
// Detect model from first assistant message
3737
const firstAssistantMessage = messages.find((msg) => msg.role === "assistant");
38-
const model = firstAssistantMessage?.metadata?.model ?? getDefaultModel();
38+
const model = firstAssistantMessage?.metadata?.model ?? defaultModel;
3939

4040
// Calculate stats using shared logic (now synchronous)
4141
const stats = await calculateTokenStats(messages, model);

src/cli/debug/send-message.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as path from "path";
33
import { defaultConfig } from "@/node/config";
44
import type { MuxMessage } from "@/common/types/message";
55
import type { SendMessageOptions } from "@/common/types/ipc";
6-
import { getDefaultModel } from "@/common/utils/model/defaults";
6+
import { defaultModel } from "@/common/utils/ai/models";
77
import { getMuxSessionsDir } from "@/common/constants/paths";
88

99
/**
@@ -104,7 +104,7 @@ export function sendMessageCommand(
104104

105105
// Prepare options
106106
const options: SendMessageOptions = {
107-
model: getDefaultModel(),
107+
model: defaultModel,
108108
};
109109

110110
if (editMessageId) {

src/common/utils/model/defaults.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)