diff options
| author | Dax Raad <[email protected]> | 2025-09-09 23:25:27 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-09-09 23:25:27 -0400 |
| commit | e69d10b6c978048510eec21ca5c648336ebacb47 (patch) | |
| tree | 7675d526375c51ca2c0053fba87db4ec9acef5c8 | |
| parent | 10aee9755c81864113389158b2b843116358bac2 (diff) | |
| download | opencode-e69d10b6c978048510eec21ca5c648336ebacb47.tar.gz opencode-e69d10b6c978048510eec21ca5c648336ebacb47.zip | |
repair tool calls when casing is wrong
| -rw-r--r-- | packages/opencode/src/session/index.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/packages/opencode/src/session/index.ts b/packages/opencode/src/session/index.ts index 2b49bb74a..83f2d0012 100644 --- a/packages/opencode/src/session/index.ts +++ b/packages/opencode/src/session/index.ts @@ -1007,6 +1007,17 @@ export namespace Session { } }, async experimental_repairToolCall(input) { + const lower = input.toolCall.toolName.toLowerCase() + if (lower !== input.toolCall.toolName && tools[lower]) { + log.info("repairing tool call", { + tool: input.toolCall.toolName, + repaired: lower, + }) + return { + ...input.toolCall, + toolName: lower, + } + } return { ...input.toolCall, input: JSON.stringify({ |
