GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — [Bug]: NoSuchToolError (dummy_tool) should be gracefully handled instead of crashing the session · Issue #13317 · anomalyco/opencode Closed as not planned Closed as not planned Copy link DescriptionDescriptionWhen the model hallucinates a tool call to a non-existent tool during compaction or agent recovery, OpenCode throws a Error message: Root CauseThe AI SDK's tool execution layer throws This commonly happens when:
Proposed FixInstead of throwing a fatal error, OpenCode should gracefully handle unknown tool calls: // In the tool execution layer: try { const result = await executeTool(toolCall); } catch (error) { if (error instanceof NoSuchToolError) { // Log warning but don't crash log.warn(`Model hallucinated tool call to '${error.toolName}', skipping`); // Return an error result to the model so it can self-correct return { type: "tool-result", toolCallId: toolCall.toolCallId, result: `Error: Tool '${error.toolName}' does not exist. Please use only available tools.`, isError: true, }; } throw error; } This approach:
Steps to Reproduce
Expected BehaviorOpenCode should return a tool error result to the model and allow the conversation to continue, rather than crashing the entire agent turn. Actual BehaviorFatal Impact
Environment
Related Issues
Reacted by Denis K and Denis Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |