Commit Graph

2 Commits

Author SHA1 Message Date
ruvnet 9dd999c93d fix(#2357): add sonnet-5 to the sampling-params rejection regex
Sonnet 5 joined the Claude 5 adaptive-thinking family and removed temperature/top_p/top_k like Fable 5, Opus 4.8, and Opus 4.7 — the Anthropic API returns 400 'Extra inputs are not permitted' when any is present. The `modelRejectsSamplingParams` regex in agent-execute-core.ts didn't include sonnet-5, so callAnthropicMessages() would forward its 0.7-default temperature and get rejected on any Sonnet 5 call (including the internal routing that 3.30.4 just bumped `sonnet` → `claude-sonnet-5`).

Test coverage extended: sonnet-5 added to both the alias-check and the request-body drop test (32 tests pass, up from 30).

Bumps @claude-flow/cli, claude-flow, and ruflo to 3.30.5 (PATCH — bug fix, no API change).

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-07-15 11:21:59 -04:00
Mr. Mak b12788777a fix(agent-execute): omit removed sampling params for Fable 5 / Opus 4.8 / Opus 4.7 (#2357) (#2358)
callAnthropicMessages always sent temperature (default 0.7), but the
adaptive-thinking family (claude-fable-5, claude-opus-4-8,
claude-opus-4-7) removed temperature/top_p/top_k — the Anthropic API
returns 400 "Extra inputs are not permitted", so agent_execute /
workflow_run / the WASM-agent Anthropic path could not call any
current frontier model when an ANTHROPIC_API_KEY was set.

Gate the param on a new exported modelRejectsSamplingParams() predicate
(prefix-matched so dated snapshots are covered). Behavior for models
that still accept sampling params (sonnet / haiku / opus <= 4.6) is
unchanged, including the 0.7 default. The Ollama / OpenRouter
OpenAI-compat paths accept temperature and are untouched.

Vitest regression included (sampling-params-2357.test.ts), pinning
both the predicate and the request-body contract via a mocked fetch.

Part of #2357 (Finding A) — does not close the issue.

Co-authored-by: Mak Allen <mak@heroforge.ai>
Co-authored-by: ruflo <ruv@ruv.net>
2026-06-12 09:45:36 -04:00