Repository navigation
v0.1.69
Protocol translation — 3 of 62 confirmed findings
Anthropic ingress now requires a positive max_tokens
Anthropic's real Messages API makes max_tokens a required, positive field (unlike OpenAI's optional max_tokens) — a request missing it, or sending 0/negative, gets a clean 400 from the real API. DecodeMessagesRequest validated model and messages as required in the same function but silently accepted a missing/invalid max_tokens, omitting it from the IR entirely and letting the upstream model run with no cap at all — diverging from real Anthropic API behavior and masking what should be a client-side bug behind a silent gateway default.
Fixed by validating max_tokens <= 0 as a 400 alongside the existing model/messages checks.
- Test:
TestDecodeRequiresMaxTokens(new) — missing,0, and negativemax_tokensall rejected - Surgical-revert proof: validation forced to a no-op → all 3 cases failed with "want a max_tokens error, got ". Fix restored, test passes.
Shipped via #140, chart bump #141.
Next up: Protocol translation's finding #4 (temperature-scale documentation gap — Anthropic 0–1 vs OpenAI 0–2, passed through unchanged and undocumented; likely a docs/translation.md note rather than a full fix-ship cycle), then Admin API's Minor findings.
Full Changelog: v0.1.68...v0.1.69