mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 17:00:59 +00:00
Fix javascript-repl to throw errors on execution failure
- Throw error instead of returning output when result.success is false - Ensures tool call is marked as failed when code execution fails or is aborted - Matches browser-javascript error handling pattern
This commit is contained in:
parent
4ac774cbbb
commit
c0ad46fa01
1 changed files with 2 additions and 3 deletions
|
|
@ -59,9 +59,8 @@ export async function executeJavaScript(
|
|||
if (output) output += "\n";
|
||||
output += `Error: ${result.error?.message || "Unknown error"}\n${result.error?.stack || ""}`;
|
||||
|
||||
return {
|
||||
output: output.trim(),
|
||||
};
|
||||
// Throw error so tool call is marked as failed
|
||||
throw new Error(output.trim());
|
||||
}
|
||||
|
||||
// Add return value if present
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue