da260c38cb
opencode / the ai-sdk OpenAI-compatible client sends a large default max_tokens (> the server's --max-tokens cap, 1024 by default), and generation_options returned 400 "must be an integer between 1 and 1024" — even for a trivial "hello". OpenAI-compatible servers clamp to their own ceiling rather than reject. Now max_tokens > limit is clamped to limit; only non-int / non-positive values are a hard error. Test updated to assert the clamp + keep the <1 reject. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>