Skip to content

Commit f8d70be

Browse files
committed
fix: expose ragweld qwen3 in chat + GEN pickers @codex
1 parent 3c93823 commit f8d70be

2 files changed

Lines changed: 21 additions & 7 deletions

File tree

web/src/components/Chat/ChatInterface.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,7 @@ export function ChatInterface({ traceOpen, onTraceUpdate }: ChatInterfaceProps)
790790
const toOverrideValue = (m: ChatModelInfo): string => {
791791
if (m.source === 'local') return `local:${m.id}`;
792792
if (m.source === 'openrouter') return `openrouter:${m.id}`;
793+
if (m.source === 'ragweld') return `ragweld:${m.id}`;
793794
return String(m.id || '');
794795
};
795796

@@ -822,7 +823,7 @@ export function ChatInterface({ traceOpen, onTraceUpdate }: ChatInterfaceProps)
822823
(localModels.length
823824
? (localDefaultOption ? `local:${localDefaultTrimmed}` : `local:${localModels[0].id}`)
824825
: '') ||
825-
(cloudDefaultOption ? String(cloudDefaultOption.id) : '');
826+
(cloudDefaultOption ? toOverrideValue(cloudDefaultOption) : '');
826827

827828
const nextOverride = preferred
828829
? String(preferred)

web/src/components/RAG/RetrievalSubtab.tsx

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState, useEffect, useCallback, useRef } from 'react';
1+
import { useState, useEffect, useCallback, useMemo, useRef } from 'react';
22
import { EmbeddingMismatchWarning } from '@/components/ui/EmbeddingMismatchWarning';
33
import { LiveTerminal, LiveTerminalHandle } from '@/components/LiveTerminal/LiveTerminal';
44
import { CollapsibleSection } from '@/components/ui/CollapsibleSection';
@@ -150,17 +150,30 @@ export function RetrievalSubtab() {
150150
} = useConfig();
151151

152152
// --- Derived helpers -----------------------------------------------------
153+
const ragweldGenModelOption = useMemo(() => {
154+
const base = String(config?.training?.ragweld_agent_base_model || 'mlx-community/Qwen3-1.7B-4bit').trim();
155+
if (!base) return '';
156+
return `ragweld:${base}`;
157+
}, [config?.training?.ragweld_agent_base_model]);
158+
153159
const loadModels = useCallback(async () => {
160+
let models: string[] = [];
154161
try {
155162
const data = await modelsApi.listByType('GEN');
156-
const models = Array.isArray(data) ? data.map((m: any) => m.model).filter(Boolean) : [];
157-
if (models.length) {
158-
setAvailableModels(models);
159-
}
163+
models = Array.isArray(data) ? data.map((m: any) => m.model).filter(Boolean) : [];
160164
} catch (error) {
161165
console.error('Failed to load models from /api/models/by-type/GEN:', error);
162166
}
163-
}, []);
167+
168+
const merged: string[] = [];
169+
if (ragweldGenModelOption) merged.push(ragweldGenModelOption);
170+
for (const m of models) {
171+
if (!m) continue;
172+
if (merged.includes(m)) continue;
173+
merged.push(m);
174+
}
175+
setAvailableModels(merged);
176+
}, [ragweldGenModelOption]);
164177

165178
useEffect(() => {
166179
loadModels();

0 commit comments

Comments
 (0)