-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Unknown tool call is not guarded early (model calls non-existent tool despite provided tools) #8166
Copy link
Copy link
Open
Description
Summary
In headless runs, the model can emit tool calls for names not present in the provided tools list (e.g. read_file, view_file, run_command), and Goose only fails later at dispatch with Tool 'x' not found. This causes avoidable turn failures and task interruption.
Environment
- Goose CLI: 1.29.0
- Provider: custom OpenAI-compatible endpoint (
custom_omlx) - Model:
Qwen3.5-122B-A10B-Text-mxfp4-mlx toolshim: false
Evidence
- Request payload includes a non-empty
toolsarray. - Model still emits tool calls not in that array.
- Runtime error examples:
Tool 'read_file' not foundTool 'view_file' not foundTool 'run_command' not found
Expected Behavior
If model emits an unknown tool name:
- Detect it immediately before dispatch.
- Return structured correction to model (valid tool list and/or closest match suggestion).
- Retry tool-call turn (bounded retries) instead of hard-failing flow progress.
Actual Behavior
Unknown tool call reaches dispatch and fails with Tool 'x' not found, often breaking task continuity.
Suggested Fix
- Add guardrail in tool-call handling path:
- Validate tool name against current advertised tool set before dispatch.
- On mismatch, inject synthetic tool error response with valid names (or fuzzy suggestion).
- Allow bounded retry for tool selection.
- Add telemetry/logging for unknown tool-name rate by provider/model to help track compatibility quality.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels