Files
crewAI/lib/crewai/tests/llms
alex-clawd 155ba11c4a refactor(openai): drop the hardcoded model list entirely
`_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.
2026-07-26 03:28:42 -07:00
..
2026-06-14 04:19:48 -03:00
2025-10-20 14:10:19 -07:00