Skip to content

Sonnet/Haiku/Fable 5 return empty replies on the native Anthropic path (temperature guard + 4096 output budget) #7435

Backlog

Description

@8107psn-sketch

Two independent causes make every Sonnet/Haiku/Fable 5 reply come back empty on the native Anthropic path, both measured against api.anthropic.com on 2026-11-30. The code paths below are current on main (9d0d372).

1. The temperature guard only matches "opus"

_anthropic_rejects_temperature() in src/llm_core.py strips temperature only for ids containing "opus", so Sonnet/Haiku/Fable 5 requests still carry it. Measured, one tiny request per model:

model temperature: 0.3
claude-fable-5-1 HTTP 400 "temperature is deprecated for this model."
claude-fable-5-2 HTTP 400 (same)
claude-sonnet-5-5 HTTP 400 (same)
claude-haiku-5-5 HTTP 400 (same)
claude-opus-5-5 HTTP 400 when sent — but the guard matches the id, so it is never sent

Opus therefore works and nothing else does. #5753 / #5761 fixed exactly this for major-only Opus ids; the other families now need the same treatment. The threshold differs per family: Opus dropped the sampling parameters at 4.7, the others at 5.0, so claude-sonnet-4-6 and claude-haiku-4-5 must keep temperature.

2. The 4096 default output budget is spent on thinking

With temperature omitted, short prompts succeed but long conversations still fail. _build_anthropic_payload falls back to max_tokens: 4096 when the caller passes none, and extended-thinking tokens are billed inside that budget. Observed with claude-fable-5-2 on a 22-message conversation, 9234 input tokens:

stop_reason=max_tokens  content=['thinking']  output_tokens=4096  text blocks=0

The model spent the whole allowance thinking and the stream closed before a single text delta. The same prompt in a fresh conversation answers fine, which makes the failure look intermittent.

Every family-first id accepts a 32K budget (measured: claude-fable-5-2, claude-sonnet-5-5, claude-haiku-5-5, claude-opus-5-5, claude-sonnet-4-5-20250929, claude-haiku-4-5-20251001). The Claude 3 generation, whose ids put the version first (claude-3-5-sonnet-20241022), should keep 4096.

Why this is hard to diagnose

In both cases the stream ends without a text delta, and the caller reports:

All model candidates returned no substantive output  (502)

Neither the provider's own 400 message nor the thinking truncation reaches the user, so the obvious suspects are the API key, the endpoint or a local model being down. Finding cause 2 took instrumenting the Anthropic branch of stream_llm to log stop_reason and the block types.

Environment

  • Official GHCR image, docker compose stack, native Anthropic endpoint (https://api.anthropic.com), streaming chat.
  • Reproduces with any claude-sonnet-5-*, claude-haiku-5-* or claude-fable-5-* selection; cause 2 needs a conversation long enough that the model thinks past the budget.

Checks run

  • Each table row is a live request through the project's own _build_anthropic_payload, not a hand-written payload.
  • A local patch (family-aware temperature guard; family-first default budget; and a specific error event when stop_reason=max_tokens arrives with only a thinking block) has been running here since, and all four Claude 5 models answer normally.

Happy to open a PR against dev with that patch if you want it — raising this as an issue first per the agent-PR note in CONTRIBUTING.md. Investigation and measurements were done with Claude Code.

Activity

  1. added
    ready for review
    on Nov 30, 2026
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

    ready for review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions