Skip to content

[Bug]: Bedrock GPT-6 Sol/Luna/Astra and GPT-5.6 fail with 400 "Unknown parameter: 'thinking'" on the locked LiteLLM 1.93.0 #5292

Open

Description

@kimnamu

Thanks for keeping the LiteLLM pin in one place; it made comparing versions quick.

Is there an existing issue for the same bug?

  • I have searched existing issues and this is not a duplicate.

Bug Description

The lock (uv.lock, also used by CI and the agent-server image) has LiteLLM 1.93.0. It turns the SDK default reasoning_effort="high" into an Anthropic-style thinking field on the Converse request, which Bedrock GPT-6 Sol/Luna/Astra and GPT-5.6 reject with a 400. LiteLLM 1.102.x sends reasoning.effort instead; pip install openhands-sdk already gets 1.102.1.

Expected Behavior

The ids below answer with default settings on the lock too.

Actual Behavior

uv run python d3.py bedrock/us.openai.gpt-6-sol bedrock/global.openai.gpt-6-astra bedrock/us.openai.gpt-5.6-sol (code sample below) on main @ 5b36cac:

litellm 1.93.0
MODEL bedrock/us.openai.gpt-6-sol reasoning_effort high uses_responses_api True
  ERR LLMBadRequestError litellm.BadRequestError: BedrockException - {"message":"The model returned the following errors: {\"error\":{\"code\":\"unknown_parameter\",\"message\":\"Unknown parameter: 'thinking'.\",\"param\":\"thinking\",\"type\":\"invalid_request_error\"}}"}
MODEL bedrock/global.openai.gpt-6-astra reasoning_effort high uses_responses_api True
  ERR LLMBadRequestError litellm.BadRequestError: BedrockException - {"message":"The model returned the following errors: {\"error\":{\"code\":\"unknown_parameter\",\"message\":\"Unknown parameter: 'thinking'.\",\"param\":\"thinking\",\"type\":\"invalid_request_error\"}}"}
MODEL bedrock/us.openai.gpt-5.6-sol reasoning_effort high uses_responses_api True
  ERR LLMBadRequestError litellm.BadRequestError: BedrockException - {"message":"The model returned the following errors: {\"error\":{\"code\":\"unknown_parameter\",\"message\":\"Unknown parameter: 'thinking'.\",\"param\":\"thinking\",\"type\":\"invalid_request_error\"}}"}

Same script, SDK from main with litellm==1.102.1 in a separate venv:

litellm 1.102.1
MODEL bedrock/us.openai.gpt-6-sol reasoning_effort high uses_responses_api True
  OK pong
MODEL bedrock/global.openai.gpt-6-astra reasoning_effort high uses_responses_api True
  OK pong
MODEL bedrock/us.openai.gpt-5.6-sol reasoning_effort high uses_responses_api True
  OK pong

Steps to Reproduce

  1. uv sync --extra boto3 on main, Bedrock credentials in the environment (us-east-1).
  2. uv run python d3.py bedrock/us.openai.gpt-6-sol

Acceptance Criteria

  • On the lock, the ids below answer with the default reasoning_effort
  • The Converse request carries reasoning.effort, not thinking

Installation Method

uv sync from a clone of main

SDK Version

main @ 5b36cac (openhands-sdk 1.49.5)

Model Name (if applicable)

bedrock/us.openai.gpt-6-sol, bedrock/global.openai.gpt-6-sol, bedrock/us.openai.gpt-6-luna, bedrock/us.openai.gpt-6-astra, bedrock/global.openai.gpt-6-astra, bedrock/us.openai.gpt-5.6-sol, bedrock/us.openai.gpt-5.6-luna

Minimal Code Sample

import os, sys, importlib.metadata as md
os.environ["OPENHANDS_SUPPRESS_BANNER"] = "1"
from openhands.sdk import LLM
from openhands.sdk.llm import Message, TextContent
print("litellm", md.version("litellm"))
for model in sys.argv[1:]:
    llm = LLM(model=model, usage_id="t", aws_region_name="us-east-1", num_retries=0)
    print("MODEL", model, "reasoning_effort", llm.reasoning_effort, "uses_responses_api", llm.uses_responses_api())
    try:
        r = llm.completion([Message(role="user", content=[TextContent(text="Reply with exactly: pong")])])
        print("  OK", "".join(getattr(c, "text", "") for c in r.message.content))
    except Exception as e:
        print("  ERR", type(e).__name__, str(e)[:330])

Screenshots and Additional Context

LLM(...), us-east-1 lock (LiteLLM 1.93.0) LiteLLM 1.102.1
GPT-6 Sol, Luna, Astra (us.) and Sol, Astra (global.), default effort 400 thinking ✅ pong
GPT-5.6 Sol, Luna, default effort 400 thinking ✅ pong
GPT-6 Sol, Luna, Astra: generate() with a tool, then the tool result 400 thinking ✅ tool call, then Four
GPT-6 Sol, Astra: streaming 400 thinking ✅
all seven ids, reasoning_effort=None ✅ ✅
GPT-6 Sol/Luna and GPT-5.6, reasoning_effort="none" ✅ ✅
GPT-6 Astra, reasoning_effort="none" ✅ (1.93.0 drops the field) 400 Unsupported value: 'none'

Workaround on the lock: reasoning_effort=None. "none" passes on the lock only because 1.93.0 drops it; GPT-6 Astra rejects it after a bump.

Notes for the next LiteLLM bump

additionalModelRequestFields from litellm.completion(model="bedrock/<id>", reasoning_effort="high"), captured before sending:

LiteLLM GPT-5.6 Sol GPT-6 Sol / Luna / Astra
1.93.0 (lock) thinking thinking
1.101.0, 1.101.2 reasoning.effort ✅ thinking
1.102.0, 1.102.1 reasoning.effort ✅ reasoning.effort ✅
FAILED tests/sdk/llm/test_chat_options.py::test_litellm_translates_claude_5_reasoning_to_adaptive_thinking[claude-sonnet-5-anthropic]
FAILED tests/sdk/llm/test_chat_options.py::test_litellm_translates_claude_5_reasoning_to_adaptive_thinking[us.anthropic.claude-sonnet-5-v1:0-bedrock]
FAILED tests/sdk/llm/test_chat_options.py::test_litellm_translates_claude_5_reasoning_to_adaptive_thinking[claude-opus-5-anthropic]
FAILED tests/sdk/llm/test_chat_options.py::test_litellm_translates_claude_5_reasoning_to_adaptive_thinking[us.anthropic.claude-opus-5-v1:0-bedrock]
FAILED tests/sdk/llm/test_model_features.py::test_reasoning_effort_support[moonshot/kimi-k2.5-False]
FAILED tests/sdk/llm/test_model_features.py::test_get_features_with_provider_prefix
FAILED tests/sdk/llm/test_llm_completion.py::test_llm_streaming_preserves_cache_read_tokens
FAILED tests/sdk/llm/test_model_features.py::test_reasoning_effort_overrides_are_not_redundant
FAILED tests/sdk/llm/test_responses_parsing_and_kwargs.py::test_responses_reasoning_options_not_sent_for_non_reasoning_model
FAILED tests/sdk/llm/test_responses_parsing_and_kwargs.py::test_responses_encrypted_reasoning_not_added_for_non_reasoning_model
10 failed, 1008 passed

I used Claude Code to bisect the versions, search the tracker and run the checks.

Activity

  1. all-hands-bot commented on Sep 24, 2026

    @all-hands-bot
    Collaborator

    The following comments were added by the OpenHands AI agent.

    Decision needed

    I reproduced the report against a scratch clone (main @ e21d776, uv sync --extra boto3, us-east-1) and confirmed the mechanism: on the lock, LiteLLM 1.93.0 maps Bedrock reasoning to additionalModelRequestFields.thinking for these ids, and 1.102.x maps it to reasoning.effort. Two decisions block ready-for-dev; both are yours to make, not inferable from the repo.

    1. Which version, and do we override the 7-day guardrail? The root [tool.uv] table sets exclude-newer = "7 days", and .agents/skills/custom-codereview-guide.md requires a maintainer decision before merging a distribution uploaded less than seven days ago. I checked PyPI upload times and the per-version wire output:

    version uploaded GPT-6 Sol/Luna/Astra GPT-5.6
    1.93.0 (lock) 2026-07-19 thinking (400) thinking (400)
    1.101.0 2026-09-14 thinking (400) reasoning.effort
    1.102.0 2026-09-20 reasoning.effort reasoning.effort
    1.102.1 2026-09-23 reasoning.effort reasoning.effort

    The only releases outside the guardrail today (1.101.x) do not fix GPT-6 Sol/Luna/Astra, and 1.102.1 clears the window around 2026-09-30. Should the PR wait for 1.102.1 to clear, or override exclude-newer-package for litellm and record the override in the PR (as #4284 and #3233 did)? Which exact version should the lock target — and should openhands-sdk's litellm>=1.93.0 floor move with it, so a constrained resolver cannot select the broken 1.93.0 that pip install openhands-sdk avoids only by taking latest?

    2. Scope: one bump PR, or a narrower fix? A trial lock at 1.102.1 turns tests/sdk/llm red. I ran the suite on both locks: 3 failed / 1033 passed at 1.93.0 (two are pre-existing environment path failures in tests/sdk/llm/auth/test_credentials.py), versus 11 failed / 1024 passed at 1.102.1. The bump-specific failures are the four test_litellm_translates_claude_5_reasoning_to_adaptive_thinking cases (upstream now adds a display key to the adaptive thinking dict), test_reasoning_effort_support[moonshot/kimi-k2.5], test_get_features_with_provider_prefix (upstream now reports reasoning_effort for openai/gpt-4o, which also silently drops temperature/top_p and adds reasoning_effort in select_chat_options), the two test_responses_*_not_sent_for_non_reasoning_model cases, and test_llm_streaming_preserves_cache_read_tokens (the PromptTokensDetailsWrapper.cache_creation_tokens AttributeError tracked separately as #5168). Note test_reasoning_effort_overrides_are_not_redundant is already red on the current lock, because LiteLLM fetches its model map from main at import (#4880) and now reports gpt-5.2-codex as supporting reasoning_effort. Should this land as a single LiteLLM-upgrade PR that also carries the coupled expectation and code updates (and either absorbs #5168 or depends on it), or should #5168 land first and this follow?

  2. Bharrguv commented on Oct 4, 2026

    @Bharrguv

    I reproduced this issue locally and have a focused fix with regression coverage ready in PR #5463. Could this issue be marked ready-for-dev if the scope looks appropriate?

  3. kimnamu commented on Oct 4, 2026

    @kimnamu
    ContributorAuthor

    Thanks @Bharrguv for digging into this and for putting #5463 together with tests.

    I reproduced this issue locally and have a focused fix with regression coverage ready in PR #5463.

    As far as I can tell, #5463 is aimed at the stop-word bug from #5290, and the thinking 400 in this issue still happens on its head. This one depends on the LiteLLM version in the lock (table in the issue body), so it still needs the version decision from the triage comment above.

    #5463 head c6502f4b, lock (LiteLLM 1.93.0), default reasoning_effort, us-east-1, request captured before sending:

    litellm 1.93.0 method completion
    MODEL bedrock/us.openai.gpt-6-sol effort high responses_api True
      REQ /model/us.openai.gpt-6-sol/converse keys ['additionalModelRequestFields', 'inferenceConfig', 'messages'] {'additionalModelRequestFields': {'thinking': {'type': 'enabled', 'budget_tokens': 4096}}}
       ERR LLMBadRequestError litellm.BadRequestError: BedrockException - {"message":"The model returned the following errors: {\"error\":{\"code\":\"unknown_parameter\",\"message\":\"Unknown parameter: 'thinking'.\",\"param\":\"t
    MODEL bedrock/global.openai.gpt-6-astra effort high responses_api True
      REQ /model/global.openai.gpt-6-astra/converse keys ['additionalModelRequestFields', 'inferenceConfig', 'messages'] {'additionalModelRequestFields': {'thinking': {'type': 'enabled', 'budget_tokens': 4096}}}
       ERR LLMBadRequestError litellm.BadRequestError: BedrockException - {"message":"The model returned the following errors: {\"error\":{\"code\":\"unknown_parameter\",\"message\":\"Unknown parameter: 'thinking'.\",\"param\":\"t
    MODEL bedrock/us.openai.gpt-5.6-sol effort high responses_api True
      REQ /model/us.openai.gpt-5.6-sol/converse keys ['additionalModelRequestFields', 'inferenceConfig', 'messages'] {'additionalModelRequestFields': {'thinking': {'type': 'enabled', 'budget_tokens': 4096}}}
       ERR LLMBadRequestError litellm.BadRequestError: BedrockException - {"message":"The model returned the following errors: {\"error\":{\"code\":\"unknown_parameter\",\"message\":\"Unknown parameter: 'thinking'.\",\"param\":\"t
    

    If the label is for the PR description check: #5290 already has ready-for-dev, and the check passes locally once ## Issue Number says Fixes #5290 instead of N/A.

    $ GITHUB_TOKEN=$(gh auth token) python3 .github/scripts/check_pr_description.py --event-path event_asis.json
    ::error::Link an issue in the `## Issue Number` section (e.g. `Fixes #123`). Newly opened issues must carry the `ready-for-dev` label.
    PR description validation failed with 1 error(s).
    $ GITHUB_TOKEN=$(gh auth token) python3 .github/scripts/check_pr_description.py --event-path event_fix5290.json
    PR description validation passed.
    
    #5463 and the us./global. ids from #5290

    The GPT-6 and GPT-5.6 ids in #5290 are inference profile ids like bedrock/us.openai.gpt-6-sol. "bedrock/openai." isn't a substring of those, so on #5463's head get_features(...).supports_stop_words is False for bedrock/openai.gpt-oss-120b-1:0 and still True for all eight us./global. ids listed in #5290 and here. The #5290 repro (prompt-based tool calling, reasoning_effort=None) on the same head:

    OK  bedrock/openai.gpt-oss-120b-1:0 tool_calls: ['think']
    ERR bedrock/us.openai.gpt-5.6-sol BedrockException - {"message":"This model doesn't support the stopSequences field. Remove stopSequences and try again."}
    ERR bedrock/us.openai.gpt-6-sol BedrockException - {"message":"This model doesn't support the stopSequences field. Remove stopSequences and try again."}
    ERR bedrock/us.openai.gpt-6-luna BedrockException - {"message":"This model doesn't support the stopSequences field. Remove stopSequences and try again."}
    ERR bedrock/us.openai.gpt-6-astra BedrockException - {"message":"This model doesn't support the stopSequences field. Remove stopSequences and try again."}
    OK  bedrock/us.anthropic.claude-haiku-4-5-20251001-v1:0 tool_calls: ['think']
    

    #5291 (opened for #5290 on 09-24) matches openai.gpt-, and its tests include us./global. ids. I'm happy to go with whichever the maintainers prefer.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions