Fix Claude CLI reasoning effort fallback#6
Open
suninrain086 wants to merge 2 commits into
Open
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Using Claude CLI against the gateway initially failed with the following upstream Copilot error:
The root cause is that native
/v1/messagesrequests can forward Claude CLI reasoning effort settings that Copilot rejects for a given model, and the gateway previously surfaced that400directly back to the client.Summary
xhighin Anthropicoutput_config.efforttyping/v1/messagesinvalid_reasoning_effortresponses from Copilot400back to Claude CLIxhightomediumfallback pathTesting
deno test187 passed / 0 failedsrc/app-control_test.tssrc/lib/models-cache_test.tssrc/lib/probe_test.tssrc/lib/sse-reassemble_test.tssrc/lib/translate/anthropic-to-responses-stream_test.tssrc/lib/translate/chat-to-messages_test.tssrc/lib/translate/messages-to-chat-stream_test.tssrc/lib/translate/messages-to-chat_test.tssrc/lib/translate/responses-request_test.tssrc/middleware/usage_test.tssrc/routes/chat-completions_test.tssrc/routes/count-tokens_test.tssrc/routes/data-transfer_test.tssrc/routes/messages_test.tssrc/routes/responses_test.tssrc/ui/dashboard_test.ts