mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 16:52:20 +00:00
fix(tools): stop cancelled calls before execution and discard late results
This commit is contained in:
1 parent
6dd4d0156f
commit
691be39c1b
4 files changed
+50
No files matched your search
@@ -178,6 +178,7 @@ export function composeCatalog({
|
||||
return chain({ tool, args, signal, ...(parent ? { parent } : {}) });
|
||||
};
|
||||
const execute = async ({ tool, args, signal }) => {
|
||||
signal?.throwIfAborted();
|
||||
const problems = validateValue(tool.inputSchema, args);
|
||||
if (problems.length)
|
||||
throw new ToolError('invalid_arguments', problems.join('; '));
|
||||
@@ -194,6 +195,7 @@ export function composeCatalog({
|
||||
} catch (error) {
|
||||
throw fromSourceError(error);
|
||||
}
|
||||
signal?.throwIfAborted();
|
||||
if (!result || typeof result.summary !== 'string' || !result.data)
|
||||
throw new TypeError(`${tool.name} returned no summary or data`);
|
||||
if (
|
||||
|
||||
Reference in new issue
Block a user