Skip to content

Commit 2f5ef63

Browse files
committed
fix(gateway): use model from user settings instead of hardcoded gpt-5.4
1 parent 00c1862 commit 2f5ef63

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/gateway/gateway.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
import type { GroupContext } from '../agent/prompts.js';
2424
import { appendFileSync } from 'node:fs';
2525
import { dexterPath } from '../utils/paths.js';
26+
import { getSetting } from '../utils/config.js';
2627

2728
const LOG_PATH = dexterPath('gateway-debug.log');
2829
function debugLog(msg: string) {
@@ -157,11 +158,13 @@ async function handleInbound(cfg: GatewayConfig, inbound: WhatsAppInboundMessage
157158
console.log(`Processing message with agent...`);
158159
debugLog(`[gateway] running agent for session=${route.sessionKey}`);
159160
const startedAt = Date.now();
161+
const model = getSetting('modelId', 'gpt-5.4') as string;
162+
const modelProvider = getSetting('provider', 'openai') as string;
160163
const answer = await runAgentForMessage({
161164
sessionKey: route.sessionKey,
162165
query,
163-
model: 'gpt-5.4',
164-
modelProvider: 'openai',
166+
model,
167+
modelProvider,
165168
channel: 'whatsapp',
166169
groupContext,
167170
});

src/gateway/heartbeat/runner.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { cleanMarkdownForWhatsApp } from '../utils.js';
77
import { buildHeartbeatQuery } from './prompt.js';
88
import { evaluateSuppression, type SuppressionState } from './suppression.js';
99
import { dexterPath } from '../../utils/paths.js';
10+
import { getSetting } from '../../utils/config.js';
1011

1112
const LOG_PATH = dexterPath('gateway-debug.log');
1213

@@ -132,8 +133,8 @@ export function startHeartbeatRunner(params: { configPath?: string }): Heartbeat
132133

133134
// Run agent
134135
debugLog(`[heartbeat] running agent for session=${session.sessionKey}`);
135-
const model = heartbeatCfg.model ?? 'gpt-5.4';
136-
const modelProvider = heartbeatCfg.modelProvider ?? 'openai';
136+
const model = heartbeatCfg.model ?? getSetting('modelId', 'gpt-5.4') as string;
137+
const modelProvider = heartbeatCfg.modelProvider ?? getSetting('provider', 'openai') as string;
137138
const answer = await runAgentForMessage({
138139
sessionKey: session.sessionKey,
139140
query,

0 commit comments

Comments
 (0)