Skip to content

bug: ProviderCapabilities.get_capabilities() static fallbacks are skipped when LiteLLM introspection fails #6412

Closed as not planned

Description

Description

In crewai/llm.py, the ProviderCapabilities dataclass (#6233) adds static fallback detection for response_format and reasoning_effort support. However, when the LiteLLM supports_response_schema field is unavailable, the code returns early before get_capabilities() can run, skipping the static fallback logic entirely.

Where

crewai/llm.py — The early return guard above get_capabilities() bypasses both the static response_format fallback AND reasoning_effort validation when supports_response_schema is unavailable from LiteLLM introspection.

Impact

  • Providers that don't expose supports_response_schema via LiteLLM lose all capability detection, even for features that have static fallbacks (e.g., well-known provider lists)
  • response_format requests are incorrectly sent to providers that don't support it
  • reasoning_effort settings are not validated against known provider lists

Reproduction

Use a provider where LiteLLM doesn't return supports_response_schema:

  1. Configure response_format={"type": "json_object"}
  2. The capability check returns early
  3. The request may be sent to a provider that doesn't support it

Related

Proposed Fix

Move the static capability checks (get_capabilities()) before the LiteLLM introspection early return, so static fallbacks are always evaluated regardless of introspection availability.

Activity

  1. STiFLeR7 commented on Jul 10, 2026

    @STiFLeR7

    This looks like it's already resolved on the current revision of #6233.

    Checked lib/crewai/src/crewai/llm.py on PR #6233's latest commit (ff65516, 2026-07-09): _validate_call_params now only early-returns on not _ensure_litellm(), and unconditionally calls caps = self.get_capabilities() afterward regardless of whether supports_response_schema was importable from litellm. get_capabilities() itself has its own litellm-introspection-with-static-fallback logic for each capability (_PROVIDERS_WITHOUT_RESPONSE_FORMAT, _PROVIDERS_WITH_REASONING), so the "static fallback skipped when introspection unavailable" bug described here doesn't reproduce against that commit.

    Timeline-wise: the fix landed in PR #6233's commit fix(providers): address CodeRabbit review on capability detection on 2026-06-29, two days before this issue was filed (2026-07-01) — so this may have been filed against an earlier revision of the PR branch, or against the CodeRabbit comment thread itself rather than the current diff.

    Once #6233 merges this should be fully covered; happy to be corrected if there's a remaining gap I'm missing.

  2. IgorGanapolsky commented on Jul 23, 2026

    @IgorGanapolsky

    Reliability note

    Production automation failures usually reduce to a contract issue before a model/prompt issue:

    1. Success criteria — durable artifact id (message/booking/row), not only node green
    2. Side-effect before complete — never blind-retry without an idempotency key on the business object
    3. Tool vs path split — external action can succeed while the node/agent path still errors (silent-green / false-red)

    If you have one failing execution + expected vs actual, reply with stack/version and I will send a free root-cause checklist.

  3. github-actions commented on Aug 22, 2026

    @github-actions
    Contributor

    This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

  4. github-actions commented on Aug 27, 2026

    @github-actions
    Contributor

    This issue was closed because it has been stalled for 5 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions