strix/tests
seanturner83 d235aecc49
fix(bedrock): give Claude an explicit, clamped output ceiling
make_model_settings never set max_tokens. On Bedrock Converse an
adaptive-thinking Claude model (opus-4-6/4-8, sonnet-4-6, and future tiers)
maps reasoning_effort 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. Converse then applies a low internal default that "high" thinking
exhausts, truncating a long tool call mid-JSON (arguments cut one brace short).
That malformed assistant message poisons the next turn: litellm's
openai->bedrock converter does json.loads(arguments) and raises
APIConnectionError ("Unable to convert openai tool calls ... Expecting ','
delimiter"), killing the scan.

Fix: resolve_max_tokens(model_name, configured), threaded via STRIX_MAX_TOKENS
(default None) -> make_model_settings -> ModelSettings.max_tokens -> RunConfig.

Scoped deliberately:
- Gated on the CLAUDE FAMILY, not a version/tier list. The adaptive-thinking
  bug spans opus-4-6/4-8 + sonnet-4-6 today and will grow, while opus-4-1 is
  NOT adaptive -- tier is the wrong axis, "claude in name" is stable.
- Non-Claude models (gpt/ollama/gemini/...) are left untouched: configured
  value passes through, None stays None (provider default). A local user on a
  small-context model is never forced past its limit.
- The chosen ceiling is CLAMPED to the model's known max_output_tokens, so it
  can never exceed what the provider accepts (older Claude tops out at
  4096-8192). If a Claude model's ceiling is unknown (absent from litellm's
  cost map) and the user set nothing, fall back to None rather than guess.

Verified end-to-end on Bedrock opus-4-8 (thinking high): a SQLi/cmd-inj/
weak-hash fixture that previously crashed on the 3rd/longest finding now
reports all 3.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 11:30:49 +01:00
..
__init__.py Add configurable token / cost usage limits (#576) 2026-06-22 11:17:08 -04:00
test_agent_factory_shell.py Default sandbox exec commands to Bash (#764) 2026-07-14 03:44:05 -07:00
test_agent_tool_registration.py Allow scan agent tool registration (#733) 2026-07-11 23:58:51 -04:00
test_cli_target_list.py Add target list CLI option (#711) 2026-07-06 23:33:08 -04:00
test_config_loader.py feat(settings): add force_required_tool_choice to LlmSettings (#730) 2026-07-10 18:36:33 -04:00
test_cost_tracking.py fix(report): restore cost tracking for OpenRouter and other LiteLLM-routed models (#801) 2026-07-17 13:38:23 -07:00
test_docker_client_delete.py fix(runtime): swallow torn-down docker socket in sandbox delete() (#721) 2026-07-10 00:13:35 -04:00
test_execution.py Add configurable token / cost usage limits (#576) 2026-06-22 11:17:08 -04:00
test_hooks.py Add configurable token / cost usage limits (#576) 2026-06-22 11:17:08 -04:00
test_inputs.py fix(bedrock): give Claude an explicit, clamped output ceiling 2026-07-21 11:30:49 +01:00
test_local_dir_staging.py fix(runtime): stage symlink-safe copies for LocalDir uploads (#766) 2026-07-14 17:40:23 -04:00
test_local_sources.py Add target list CLI option (#711) 2026-07-06 23:33:08 -04:00
test_model_retry.py fix(llm): add per-turn model request timeout so stalled streams fail fast and retry 2026-07-17 18:40:23 -07:00
test_models.py fix(llm): use a JSON-serializable per-turn model timeout 2026-07-17 19:45:32 -07:00
test_notes.py fix: avoid note ID collisions (#630) 2026-07-02 22:54:44 -04:00
test_optional_deps.py fix(providers): declare bedrock + vertex extras and add provider import-error hints (#588) 2026-07-07 10:24:49 -04:00
test_provider_hints.py fix(providers): match google submodule imports and walk full exception chain 2026-07-10 07:21:47 -07:00
test_proxy_client.py strip transfer encoding (#820) 2026-07-20 21:56:34 -04:00
test_proxy_renderer.py fix(tui): show 'more content available' for view_request over 15 lines (#687) 2026-07-06 03:50:02 -07:00
test_report_writer.py fix(report): prevent code-fence breakout in vulnerability markdown (#817) 2026-07-20 22:07:44 -04:00
test_reporting_fields.py fix(reporting): require advisory_cvss for dependency findings + add SCA TUI renderer (#753) 2026-07-12 17:31:49 -07:00
test_runner_rate_limit.py fix(llm): add per-turn model request timeout so stalled streams fail fast and retry 2026-07-17 18:40:23 -07:00
test_runner_root_prompt.py fix(llm): add per-turn model request timeout so stalled streams fail fast and retry 2026-07-17 18:40:23 -07:00
test_sarif.py feat(report): SARIF 2.1.0 emitter for CI / code-scanning integration (#626) 2026-07-03 10:43:31 -04:00
test_sarif_stride.py feat(report): tag SARIF rules with STRIDE legs derived from CWE (#708) 2026-07-06 21:19:53 -04:00
test_session_entries.py fix(runtime): stage symlink-safe copies for LocalDir uploads (#766) 2026-07-14 17:40:23 -04:00
test_skill_dir_extension.py Add skill directory registration (#746) 2026-07-12 12:05:58 -04:00
test_state_repo_context.py fix(report): omit SARIF provenance for multiple repos (#726) 2026-07-10 09:41:18 -04:00