Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
…nd cap pending arguments
This branch was successfully deployed
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.
TL;DR
The
chatgptprovider answers every chat completions request with501 unsupported_provider_operation, so chat-only harnesses and mixed virtual-model pools cannot use ChatGPT subscription models. Adds the inverse of the existingResponsesViaChatadapter: chat requests translate onto the Responses API upstream, and Responses streams translate back to chat chunks.Closes #1084. Part of #723. Follow-up for the Messages ingress: #1085.
Files to review (12, +3228 / -26):
internal/providers/chat_via_responses.go(start here)ChatViaResponses/StreamChatViaResponses, request mapping, and the rejection rules.internal/providers/chat_via_responses_input.goinstructions. Tool calls becomefunction_callitems.internal/providers/chat_via_responses_output.gochatcmpl-ID. Renames usage fields.internal/providers/chat_via_responses_stream.gointernal/providers/chatgpt/chatgpt.godocs/providers/chatgpt.mdx,docs/providers/overview.mdx*_test.go(4 files)How
n> 1,logit_bias,stop,seed, both penalties,logprobs,top_logprobs,modalities,audio,web_search_options, deprecatedfunctions/function_call. Explicit JSON nulls pass.predictionandn: 1are stripped, not rejected.store: falseand rejectsprevious_response_id. Mintedchatcmpl-IDs are labels, not handles. No chaining exists. Chat clients resend full history as usual.Reviewer notes
response.failedon the non-streaming path returns a 502 provider error. Without the check it would surface as a 200 with empty content.temperatureandmax_tokensmap to valid Responses fields, then Codex drops them upstream. Same behavior as the native Responses path onto this backend. Documented indocs/providers/chatgpt.mdx.chat_via_responses_stream.go—item_idto densetool_calls[].indexmapping under interleaved parallel calls.Tests
go build ./...andgo test ./...pass. New tests cover every mapped field, every rejected field (typed and viaExtraFields), null tolerance, parallel tool calls, refusal, the finish-reason table, truncation, mid-stream failure, usage gating, and ID stability. A wiring test locks thechatgptdelegation with zero network calls.One pre-existing local failure is unrelated:
internal/testconventionsscans.worktrees/directories and lints other branches' files. Fixed separately in #1087.Follow-up
n> 1 (fan-out) andstop(lookbehind cut) is possible later. Not in scope.This PR description was generated with AI assistance.