diff options
| author | Dax Raad <[email protected]> | 2025-08-05 15:57:14 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-08-05 15:58:12 -0400 |
| commit | 857a3cd52221b820dbfd34dae8ff1d42bbb8c108 (patch) | |
| tree | 8972b8a592bd1bdd5713be296b7c07d675a178ad | |
| parent | 6ed774ef62a2137ad64ad53d3708c7b3f6871615 (diff) | |
| download | opencode-857a3cd52221b820dbfd34dae8ff1d42bbb8c108.tar.gz opencode-857a3cd52221b820dbfd34dae8ff1d42bbb8c108.zip | |
hint back to llm when tool does not exist
| -rw-r--r-- | packages/opencode/src/session/index.ts | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/packages/opencode/src/session/index.ts b/packages/opencode/src/session/index.ts index e8ccc9205..8e75e749b 100644 --- a/packages/opencode/src/session/index.ts +++ b/packages/opencode/src/session/index.ts @@ -13,7 +13,6 @@ import { type ModelMessage, stepCountIs, type StreamTextResult, - InvalidToolInputError, } from "ai" import PROMPT_INITIALIZE from "../session/prompt/initialize.txt" @@ -874,17 +873,14 @@ export namespace Session { } }, async experimental_repairToolCall(input) { - if (InvalidToolInputError.isInstance(input.error)) { - return { - ...input.toolCall, - input: JSON.stringify({ - tool: input.toolCall.toolName, - error: input.error.message, - }), - toolName: "invalid", - } + return { + ...input.toolCall, + input: JSON.stringify({ + tool: input.toolCall.toolName, + error: input.error.message, + }), + toolName: "invalid", } - return null }, maxRetries: 3, activeTools: Object.keys(tools).filter((x) => x !== "invalid"), |
