mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-07-27 17:49:22 +00:00
`_TOOLS_REASONING_EFFORT_INCOMPATIBLE` was kept as a "fast path" to skip a doomed
request for gpt-5.4/5.5/5.6. That was the wrong call: it still meant a model table
in this file, and I got that table wrong twice already -- first missing gpt-5.4 and
gpt-5.5 entirely, then missing the -mini and -nano variants.
Nothing is assumed up front now. The first call for a model goes out exactly as the
caller asked; if it comes back 400, `_call_completions` retries with
reasoning_effort="none" and records the model, so subsequent calls skip straight to
"none". Same shape as the responses-only handling.
Cost is one wasted round trip per model per process instead of a release every time
OpenAI extends the restriction.
`_supports_reasoning_effort_with_tools` is now purely a cache lookup, so both
recovery paths in this file are driven by what the API actually returns rather than
by what was measured on a particular night.
Verified live with no list present:
learned before -> set()
1st call gpt-5.6-sol -> tool call returned (400 caught and recovered)
learned after -> {('https://api.openai.com/v1', 'gpt-5.6-sol')}
2nd call -> tool call returned, no 400
real Agent + tools -> 391
Tests: the fast-path cases are rewritten around learned state -- an unknown model
sends what was asked, a known one is rewritten to "none", learning doesn't leak to
other models, and the vacuous-pass guard is kept.
tests/llms/openai -> 159 passed, 1 skipped. Ruff + mypy clean.