Fix: Tools-Modul nicht mehr durch lokale Variable überschatten
In runResearchJob wurde die Variable 'tools' für die Tool-Definitionen wiederverwendet und das importierte Tools-Modul überschattet – dadurch schlugen alle Tool-Aufrufe (search, browse, save_dashboard, ...) mit 'Tool-Fehler' fehl. Umbenannt in toolDefs.
This commit is contained in:
1 parent
87eb7029f1
commit
0b51bb6142
1 file changed
+2
-2
+2
-2
@@ -380,7 +380,7 @@ async function runResearchJob(config, session, userMessageText, emit, db) {
|
|||||||
let dashboardSaved = false;
|
let dashboardSaved = false;
|
||||||
|
|
||||||
const model = getModel(session.model || config.model);
|
const model = getModel(session.model || config.model);
|
||||||
const tools = model.vision ? [...TOOL_DEFINITIONS, SCREENSHOT_TOOL] : TOOL_DEFINITIONS;
|
const toolDefs = model.vision ? [...TOOL_DEFINITIONS, SCREENSHOT_TOOL] : TOOL_DEFINITIONS;
|
||||||
const prices = model.prices;
|
const prices = model.prices;
|
||||||
|
|
||||||
const handlers = {
|
const handlers = {
|
||||||
@@ -452,7 +452,7 @@ async function runResearchJob(config, session, userMessageText, emit, db) {
|
|||||||
|
|
||||||
for (let iter = 0; iter < MAX_ITERATIONS; iter++) {
|
for (let iter = 0; iter < MAX_ITERATIONS; iter++) {
|
||||||
emit.progress('🤖', iter === 0 ? 'Analysiere Anfrage und plane Suche…' : 'Weitere Analyse…');
|
emit.progress('🤖', iter === 0 ? 'Analysiere Anfrage und plane Suche…' : 'Weitere Analyse…');
|
||||||
const result = await chatCompletion(config, apiMessages, buildSystemPrompt(session, model), model, tools);
|
const result = await chatCompletion(config, apiMessages, buildSystemPrompt(session, model), model, toolDefs);
|
||||||
trackUsage(result.usage);
|
trackUsage(result.usage);
|
||||||
|
|
||||||
if (result.reasoning) emit.thinking(result.reasoning);
|
if (result.reasoning) emit.thinking(result.reasoning);
|
||||||
|
|||||||
Reference in new issue
Block a user