ultraworkers-claw-code/rust/crates
YeonGyu-Kim 523ce7474a fix(api): sanitize Anthropic body — strip frequency/presence_penalty, convert stop→stop_sequences
MessageRequest now carries OpenAI-compatible tuning params (c667d47), but
the Anthropic API does not support frequency_penalty or presence_penalty,
and uses 'stop_sequences' instead of 'stop'. Without this fix, setting
these params with a Claude model would produce 400 errors.

Changes to strip_unsupported_beta_body_fields:
- Remove frequency_penalty and presence_penalty from Anthropic request body
- Convert stop → stop_sequences (only when non-empty)
- temperature and top_p are preserved (Anthropic supports both)

Tests added:
- strip_removes_openai_only_fields_and_converts_stop
- strip_does_not_add_empty_stop_sequences

87 api lib tests passing, 0 failing.
cargo check --workspace: clean.
2026-04-08 09:05:10 +09:00
..
api fix(api): sanitize Anthropic body — strip frequency/presence_penalty, convert stop→stop_sequences 2026-04-08 09:05:10 +09:00
commands feat: b5-markdown-fence — batch 5 wave 2 2026-04-07 15:19:45 +09:00
compat-harness wip: plugins progress 2026-04-01 07:09:06 +00:00
mock-anthropic-service feat(harness+usage): add auto_compact and token_cost parity scenarios 2026-04-03 22:41:42 +09:00
plugins Resolve claw-code main merge conflicts 2026-04-06 07:16:57 +00:00
runtime fix(dead-code): remove stale constants + dead function; add workspace_sessions_dir tests 2026-04-08 04:04:54 +09:00
rusty-claude-cli feat(api): add tuning params (temperature, top_p, penalties, stop) to MessageRequest 2026-04-08 07:07:33 +09:00
telemetry feat: anthropic SDK header matching + request profile 2026-04-01 05:55:25 +00:00
tools feat(api): add tuning params (temperature, top_p, penalties, stop) to MessageRequest 2026-04-08 07:07:33 +09:00