Repository navigation
port(upstream): #2608 - Route Claude models through GitHub Copilot native /v1/messages - #291
Conversation
7d1dc8b to
5ccf065
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d1dc8bf40
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
5ccf065 to
25d7517
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 25d7517de4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…tion_tokens/stop/tool_choice on Claude /v1/messages Codex review on PR #291 (1 P1 + 3 P2): the new native /v1/messages path translated the OpenAI body without the stripUnsupportedParams pass the /chat/completions path applies, and the generic OpenAI->Claude translator dropped max_completion_tokens, stop, and tool_choice "none". - github executor: stripUnsupportedParams("github", model, {...body}) before translateRequest so temperature/thinking/reasoning_effort no longer 400. - openai-to-claude: honor max_completion_tokens when max_tokens absent (prefer explicit max_tokens); map stop string|string[] to stop_sequences (guard stop:null); map tool_choice "none" to Anthropic {type:"none"}. Tests: route assertions in github-claude-messages.test.js; shared translator cases in openai-to-claude.test.js (30 passed across claude suites).
25d7517 to
3624109
Compare
…p/tool_choice on /v1/messages Codex review on PR #291 (1 P1 + 3 P2): the new native /v1/messages path translated the OpenAI body without the stripUnsupportedParams pass the /chat/completions path applies, and the generic OpenAI->Claude translator dropped max_completion_tokens, stop, and tool_choice "none". - github executor: stripUnsupportedParams("github", model, {...body}) before translateRequest so temperature/thinking/reasoning_effort no longer 400. - openai-to-claude: honor max_completion_tokens when max_tokens absent (prefer explicit max_tokens); map stop string|string[] to stop_sequences (guard stop:null); map tool_choice "none" to Anthropic {type:"none"}. Tests: route assertions in github-claude-messages.test.js; shared translator cases in openai-to-claude.test.js (30 passed across claude suites).
3624109 to
e6a4ff6
Compare
…p/tool_choice on /v1/messages Codex review on PR #291 (1 P1 + 3 P2): the new native /v1/messages path translated the OpenAI body without the stripUnsupportedParams pass the /chat/completions path applies, and the generic OpenAI->Claude translator dropped max_completion_tokens, stop, and tool_choice "none". - github executor: stripUnsupportedParams("github", model, {...body}) before translateRequest so temperature/thinking/reasoning_effort no longer 400. - openai-to-claude: honor max_completion_tokens when max_tokens absent (prefer explicit max_tokens); map stop string|string[] to stop_sequences (guard stop:null); map tool_choice "none" to Anthropic {type:"none"}. Tests: route assertions in github-claude-messages.test.js; shared translator cases in openai-to-claude.test.js (30 passed across claude suites).
e6a4ff6 to
1c59908
Compare
|
All 8 Codex findings addressed on Original 4 (already in code, this push confirms):
New 4 (added this push): Defended by 6 new tests in tests/unit/github-claude-messages.test.js (timeout aborts with 1 dispatch; 503 exhausted after initial+3 retries; 503→200 transient recovery; persona absent for non-Claude-Code client; persona kept for claude-cli; unsigned thinking stripped). Targeted suite 31/31 green; full |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e3892be073
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…p/tool_choice on /v1/messages Codex review on PR #291 (1 P1 + 3 P2): the new native /v1/messages path translated the OpenAI body without the stripUnsupportedParams pass the /chat/completions path applies, and the generic OpenAI->Claude translator dropped max_completion_tokens, stop, and tool_choice "none". - github executor: stripUnsupportedParams("github", model, {...body}) before translateRequest so temperature/thinking/reasoning_effort no longer 400. - openai-to-claude: honor max_completion_tokens when max_tokens absent (prefer explicit max_tokens); map stop string|string[] to stop_sequences (guard stop:null); map tool_choice "none" to Anthropic {type:"none"}. Tests: route assertions in github-claude-messages.test.js; shared translator cases in openai-to-claude.test.js (30 passed across claude suites).
e3892be to
362d896
Compare
…tive /v1/messages
…p/tool_choice on /v1/messages Codex review on PR #291 (1 P1 + 3 P2): the new native /v1/messages path translated the OpenAI body without the stripUnsupportedParams pass the /chat/completions path applies, and the generic OpenAI->Claude translator dropped max_completion_tokens, stop, and tool_choice "none". - github executor: stripUnsupportedParams("github", model, {...body}) before translateRequest so temperature/thinking/reasoning_effort no longer 400. - openai-to-claude: honor max_completion_tokens when max_tokens absent (prefer explicit max_tokens); map stop string|string[] to stop_sequences (guard stop:null); map tool_choice "none" to Anthropic {type:"none"}. Tests: route assertions in github-claude-messages.test.js; shared translator cases in openai-to-claude.test.js (30 passed across claude suites).
… + thinking guards
…to passing contract
…ry parity (Codex #291)
362d896 to
938336e
Compare
Summary
/v1/messagesshim;message_stopusage fallback folds cache_read/cache_creation intoprompt_tokens. Hardened the route per Codex review: strips params upstream rejects, mapsmax_completion_tokens/stop/tool_choice:"none"to Anthropic shapes, bounds the fetch with the provider connect timeout, retries transient 502/503/504 + network failures, drops the Claude Code persona for non-Claude-Code Copilot clients, and strips unsignedthinkinghistory./v1/messagesis the only Copilot endpoint that surfaces prompt-cache token counts (cached_tokens);/chat/completionsnever gets cache_control. Non-Claude models (gpt/gemini/grok) keep existing/chat/completions(or/responses) routes untouched.Type
feat:— new feature (port)Breaking changes
Testing
tool_choice:"none"→{type:"none"}contract (promoted from known-bugit.fails).npm run test:ci(full fail-closed gate); targeted vitestunit/github-claude-messages.test.js+unit/openai-to-claude.test.js.npm run test:ciRaw failures: 0 under pinned Node 20.20.2; CI 3/3 GREEN on heade3892be0— ✨ Lint & Build, 🧪 Vitest + No-regression gate, commitlint.git diff --check origin/dev...HEADclean.Checklist
tests/unit/github-claude-messages.test.js+6 tests;tests/translator/bugs-toClaude-context.test.jsknown-bug promoted)port(upstream):/fix(port):/test(port):)Upstream: decolua/9router#2608
Agent disclosure
This contribution is agent-generated as part of the orchestrated upstream-port cycle and was produced without interactive human review of the diff in this session.