You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
write the normalized incoming model back into the request before provider dispatch
keep [1m] as a Claude Code-only context hint, matching the documented behavior
add an integration regression test through /v1/messages/count_tokens
Problem
Provider selection already strips a trailing [1m], but the selected provider still receives the original model string. For example, gpt-5.6-luna[1m] reaches the Codex provider and is then rejected as an unsupported model with HTTP 400.
Verification
regression test failed before the fix with 400 instead of 200
cargo test --locked (541 passed)
targeted regression test passed again after rebasing onto the latest main
This restores behavior from the original TypeScript implementation. Commit 66f957a normalized body.model before provider dispatch as a defense-in-depth fallback.
During the Rust port, normalization remained in Registry::provider_for_model, so provider selection accepts gpt-5.6-luna[1m], but the selected provider still receives the original value and rejects it with HTTP 400. The regression test demonstrates that path.
You’re right that this is not needed for Claude Code itself if it strips [1m] before sending the request. The intent is parity with the previous implementation, support for other Anthropic-compatible clients, and matching the current README statement that the proxy strips the suffix. If that fallback is no longer desired, the PR can be closed and the README wording should be adjusted instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[1m]as a Claude Code-only context hint, matching the documented behavior/v1/messages/count_tokensProblem
Provider selection already strips a trailing
[1m], but the selected provider still receives the original model string. For example,gpt-5.6-luna[1m]reaches the Codex provider and is then rejected as an unsupported model with HTTP 400.Verification
400instead of200cargo test --locked(541 passed)maingit diff --check