Skip to content

Adaptive-thinking Claude on Bedrock: long tool calls truncate and crash the scan #623

Description

@seanturner83

Summary

Tool-calling scans against an adaptive-thinking Claude model on AWS Bedrock Converse (e.g. bedrock/global.anthropic.claude-opus-4-8, ...anthropic.claude-sonnet-4-6) can crash mid-scan, losing the run.

Symptom

litellm.APIConnectionError: Unable to convert openai tool calls ... to bedrock tool calls.
Received error=Expecting ',' delimiter: line 1 column NNNN

The tool-call arguments JSON is truncated one brace short. The malformed assistant message then poisons the next turn, when litellm's OpenAI→Bedrock converter runs json.loads(arguments).

Root cause

make_model_settings (strix/core/inputs.py) never sets max_tokens. For an adaptive-thinking Claude model, reasoning_effort maps to {"type": "adaptive"} with no fixed budget_tokens, so litellm's update_optional_params_with_thinking_tokens fallback (maxTokens = budget_tokens + DEFAULT_MAX_TOKENS) can't fire — and no maxTokens reaches Bedrock at all. Converse applies a low internal default that "high" thinking exhausts, guillotining a long create_vulnerability_report tool call.

Reproduction

Run any -m quick scan with STRIX_LLM=bedrock/global.anthropic.claude-opus-4-8 against a target that yields a few findings; the longest tool call is truncated and the run dies on the following turn.

Proposed fix

Set an explicit, Claude-family-gated, ceiling-clamped max_tokens. PR to follow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions