Updates
Rolling release / release (push) Successful in 7m29s

This commit is contained in:
2026-09-12 16:46:49 -04:00
parent 04a9306594
commit 4383763cb5
20 changed files with 490 additions and 26 deletions
+24 -3
View File
@@ -10,6 +10,7 @@ const device = require('./device.js');
const events = require('./events.js');
const paths = require('./paths.js');
const completeWatch = require('./complete-watch.js');
const toolParse = require('./tool-parse.js');
let sdk = null;
let initError = null;
@@ -154,11 +155,22 @@ function toTools(tools) {
return {
type: 'function',
name: t.function.name,
description: t.function.description,
parameters: t.function.parameters,
description: t.function.description || t.function.name,
parameters: t.function.parameters && t.function.parameters.type === 'object'
? t.function.parameters
: { type: 'object', properties: {} },
};
}
return t;
if (!t || !t.name) return t;
const parameters = t.parameters && t.parameters.type === 'object'
? t.parameters
: { type: 'object', properties: (t.parameters && t.parameters.properties) || {} };
return {
type: 'function',
name: t.name,
description: t.description || t.name,
parameters,
};
});
}
@@ -455,6 +467,15 @@ async function complete(opts, onEvent) {
if (run.stats) stats = await run.stats;
} catch (_) {}
}
if (tools && tools.length) {
const recovered = toolParse.recover({ text, thinking, tools, existing: toolCalls });
if (!toolCalls.length && recovered.calls.length) {
for (const call of recovered.calls) toolCalls.push(call);
}
text = recovered.text;
} else {
text = toolParse.stripToolMarkup(text);
}
return {
text,
thinking,