fix(runtime): fail fast when the LLM endpoint can't return structured tool calls (#520) - #901
fix(runtime): fail fast when the LLM endpoint can't return structured tool calls (#520)#901devin-ai-integration[bot] wants to merge 1 commit into
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Greptile SummaryAdds a preflight check that verifies structured LLM tool-call support before fresh scans.
Confidence Score: 4/5The PR appears safe to merge, with a non-blocking diagnostics issue when the probe encounters repeated network, authentication, or provider failures. The capability probe is correctly scoped and integrated, but its final error branch reports every repeated unrelated request failure as unsupported tool calling and directs users toward irrelevant server configuration changes. Files Needing Attention: strix/core/warmup.py Important Files Changed
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
strix/core/warmup.py:185-189
**Unrelated failures get capability guidance**
After both probe attempts fail with a network, authentication, or provider error, this branch replaces that failure with `ToolCallingUnsupportedError`. The primary CLI message therefore directs users to change Jinja templates or tool parsers instead of presenting the relevant provider remediation.
Reviews (1): Last reviewed commit: "fix(runtime): fail fast when the LLM end..." | Re-trigger Greptile |
| if last_error is not None and not _looks_like_tool_config_error(last_error): | ||
| # The probe never produced a tool call and the last failure was an | ||
| # unrelated error (connectivity/auth); surface the config guidance but | ||
| # keep the original cause attached for debugging. | ||
| raise ToolCallingUnsupportedError(_GUIDANCE) from last_error |
There was a problem hiding this comment.
Unrelated failures get capability guidance
After both probe attempts fail with a network, authentication, or provider error, this branch replaces that failure with ToolCallingUnsupportedError. The primary CLI message therefore directs users to change Jinja templates or tool parsers instead of presenting the relevant provider remediation.
Prompt To Fix With AI
This is a comment left during a code review.
Path: strix/core/warmup.py
Line: 185-189
Comment:
**Unrelated failures get capability guidance**
After both probe attempts fail with a network, authentication, or provider error, this branch replaces that failure with `ToolCallingUnsupportedError`. The primary CLI message therefore directs users to change Jinja templates or tool parsers instead of presenting the relevant provider remediation.
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
Fixes #520. Strix is entirely tool-driven — every working turn must be a native
tool_callsresponse. Some self-hosted / OpenAI-compatible endpoints (llama.cpp without--jinja, an Ollama model whose template lacks tool wiring, a misconfigured vLLM tool parser) instead return the tool call as plain assistant text. The Agents SDK correctly treats that as a normal final message, so the interactive loop settles towaitingand the scan silently parks on "Send message to resume" with no hint why.Root cause is inference-server configuration, not the model or Strix, and there is no safe client-side way to execute arbitrary text-form tool calls. So instead of stalling mid-scan, we now detect the missing capability up front and fail loudly with actionable guidance, plus document the exact server settings.
Preflight probe (
strix/core/warmup.py), run once inrun_strix_scanbefore the sandbox spins up (skipped on resume):Behavior:
--jinja, tool-templated Ollama model + disable thinking, vLLM--tool-call-parser, ...).tools param requires --jinja flag) → abort immediately with the same guidance.Gating keeps hosted providers (OpenAI/Anthropic/... with no custom
api_base) untouched — no extra latency or cost — andSTRIX_SKIP_TOOL_CALL_PROBE=1is an escape hatch.Verified live against a local
llama-server(jinja default → passes),--no-jinja(aborts), andllama-cpp-pythonwith no tool-aware format (the exact #520 text-leak → aborts).Changes
strix/core/warmup.py— new preflight probe +ToolCallingUnsupportedError.strix/core/runner.py— invokeprobe_tool_callingbefore sandbox bringup (non-resume).strix/config/settings.py— addSTRIX_SKIP_TOOL_CALL_PROBE.docs/llm-providers/local.mdx— "Tool calling must return structuredtool_calls" section with a per-server fix matrix (llama.cpp / Ollama / vLLM).tests/test_warmup_probe.py— deterministic tests (gating, structured-pass, text-only abort, retry, tool-config-error mapping, hosted skip, setting skip). Runner test stubs updated for the new settings fields.Link to Devin session: https://app.devin.ai/sessions/f74044feadc04f02b17d2ccfdc4df7d7
Requested by: @0xallam