Pular para conteúdo

AUR-460 — omit temperature always, let the gateway pick its own default

Documento histórico do board. Pode descrever componentes removidos; para uso atual, consulte o guia do produto.

The measured defect

A live-gateway test (2026-08-14) ran aurumcode review --base HEAD~1 --modelo gpt-5.6-luna against a real gateway serving 82 models. The provider rejected the call with a 400:

Unsupported value: 'temperature' does not support 0.3 with this model.
Only the default (1) value is supported.

The whole gpt-5.6 family (luna, sol, terra) was unreachable this way, and the user has no flag to work around it. Sending temperature: 0 instead of 0.3 was also measured to fail against the same model family: the only value proven to work is the key's absence from the request entirely.

Three places fixed the value at 0.3 and forwarded it unconditionally:

  • internal/llm.DefaultOptions() returned Temperature: 0.3.
  • internal/review.DefaultConfig() returned Temperature: 0.3.
  • internal/llm/provider/litellm's wire struct, completionRequest, carried Temperature float64 \json:"temperature"`with noomitempty— so even a caller-supplied0still serialized as"temperature":0`, which the achado also measured as rejected.

The fix

Omit always; do not build a per-model compatibility table (the card forbids inventing one — the achado is explicit that "omitir sempre" beats guessing which models tolerate which values).

internal/llm/provider/litellm/provider.go's completionRequest no longer has a Temperature field at all, and Complete no longer reads opts.Temperature when building the request body. This is the load-bearing change: no matter what value a caller's llm.Options.Temperature holds — the old fixed 0.3, an explicit 0, or a caller's own deliberate choice — the JSON this provider sends never contains a "temperature" key. The gateway applies whatever default it wants, exactly as 1 is what the achado's provider named as its own default.

internal/llm.DefaultOptions() and internal/review.DefaultConfig() no longer set Temperature: 0.3; both leave it at the zero value. Nothing in the reviewer's path needs a package-level default now that the one provider that path uses (internal/llm/provider/litellm, the only provider cmd/aurumcode wires for --modelo and for the default LLM_API_KEY/LLM_BASE_URL path — see cmd/aurumcode/main.go's selectProvider and selectProviderForModel) never reads the field. The Options.Temperature field itself stays on the struct: a caller of a different provider (openai, anthropic, ollama — all outside this card's paths) that still wants an explicit temperature can still set it.

No CLI flag changes. cmd/aurumcode is untouched: the achado's own "conserto mínimo" is that omitting always needs no new flag for the user to configure, so this card does not serialize behind a CLI change.

Public contract

aurumcode review --base HEAD~1 and its output format are unchanged. The only observable difference is that models which previously 400'd on the fixed temperature now answer.

Proof

  • tests/unit/AUR-460.go (TestAUR460) — the litellm provider, called directly and in isolation with an httptest server, never puts a "temperature" key on the wire, across a spread of llm.Options.Temperature values (the old default 0.3, zero, a caller-chosen 0.9, and llm.DefaultOptions()). This is the card's one required proof.
  • tests/integration/AUR-460.go (IntegrationAUR460) — the composition of internal/review.Reviewer, internal/llm.Orchestrator and the real litellm.Provider against a fixture gateway that reproduces the measured behavior (400 on any request containing "temperature"); GenerateReview succeeds and returns the real finding.
  • tests/e2e/AUR-460.sh (E2EAUR460) — the compiled aurumcode binary, as a real subprocess over a real loopback socket, running the exact measured command review --base HEAD~1 --modelo gpt-5.6-luna against the same fixture gateway; asserts exit 0, the finding on stdout, and determinism across two identical runs.
  • tests/acceptance/AUR-460.sh — AC-001 (delegates to the E2E proof above, built from a staged, isolated source copy) and AC-001-MUT-001.

MUT-001 reintroduces the removed Temperature field and its unconditional serialization in internal/llm/provider/litellm/provider.go via an awk/ENVIRON source rewrite (no git, no python3 — the sealed acceptance image has neither), rebuilds, and runs the mutant against the same fixture gateway tests/e2e/AUR-460.sh builds. The mutant's request carries "temperature", the fixture gateway 400s it exactly as the real gateway did, and the review call fails — reproducing the defect this card fixes. All three proof selectors (TestAUR460, IntegrationAUR460, E2EAUR460) independently detect the same reintroduced field: manually confirmed by re-adding it to internal/llm/provider/litellm/provider.go, observing TestAUR460 fail red on the exact substring assertion, then restoring the fix and confirming green again.