Repository navigation
feat: expand OAuth subscriptions for inference and Gateway - #2562
Conversation
|
Verified basic capabilities live with existing Codex and GitHub credentials (no new login). Other subscriptions rely primarily on migrated community test cases. Reviewers or contributors with those subscriptions are welcome to test them; subscription-specific fixes can follow in separate PRs and need not block this stack. |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
hidb4ai
left a comment
There was a problem hiding this comment.
Two fixes are needed before merging: preserve Claude CLI truncation state and synchronize the dependent lockfiles. Details are inline.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
hireview001
left a comment
There was a problem hiding this comment.
- CI failed: CI result (failure).
- CI failed: Upgrade release gate (failure).
- CI failed: tests (3.11, unit) (failure).
- CI did not complete: tests (3.14, unit) (cancelled).
- CI did not complete: tests (3.13, unit) (cancelled).
- CI did not complete: tests (3.13, e2e) (cancelled).
- CI did not complete: tests (3.14, e2e) (cancelled).
- CI did not complete: tests (3.12, e2e) (cancelled).
- CI did not complete: tests (3.11, e2e) (cancelled).
- CI failed: Main (failure). Failed steps: tests (3.11, e2e) / Run remaining end-to-end tests; tests (3.12, e2e) / Run remaining end-to-end tests; tests (3.11, unit) / Run unit tests.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
hidb4ai
left a comment
There was a problem hiding this comment.
@PsiACE, the Python 3.11 stdin deadlock and Code Assist candidate-count issue are fixed at 083f17e. One release-build regression remains: adding Authlib to the build-host group pulls in cryptography before pinned native preparation, breaking all three managed-resource candidate jobs. Details are inline.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
hidb4ai
left a comment
There was a problem hiding this comment.
Re-reviewed 7af7088. The missing-Content-Type SSE regression is fixed through the actual HTTP/UDS pipeline, and forbidden-content controls still block. The opaque SSE, Grok error, Claude composition and authentication-header fixes also pass focused checks. No additional correctness findings in this update.
The PR adds CLI/configuration/protocol contracts and extends /v1/context/check, so it does not meet the requested automatic-approval condition. No database tables or HTTP routes are added. CI is still running; provider and CLI validation here uses controlled fixtures, without renewed live-subscription acceptance.
hidb4ai
left a comment
There was a problem hiding this comment.
Re-reviewed 55281d6 after the master/Scope sync. No new correctness findings in the merge delta. The generated contract identities agree, the combined OAuth/Scope Desktop qualification covers all 13 operations, and historical qualifications are preserved. Generated-code checks and the contract suite pass.
No database tables or HTTP routes are added. The PR still adds model/CLI/configuration/protocol contracts and extends /v1/context/check, so it does not satisfy the requested automatic-approval condition. This review did not renew live-subscription or installed Desktop GUI acceptance.
frf12
left a comment
There was a problem hiding this comment.
Reviewed ceb62d07908137a4f43e6a76458681820ceb03d8. The Grok web-search concern is withdrawn after verifying Magpie's deliberate compatibility behavior and xAI's explicit unsupported-field contract. No remaining blocking code findings in my reviewed scope.
The existing E2E timeouts and downstream CI failures still need to be cleared before merge. Rust was source-reviewed; live-subscription acceptance was not renewed in this review.
| for part in parts: | ||
| text = part.get("text") if isinstance(part, dict) else None | ||
| if isinstance(text, str): | ||
| fragments.append(text) |
There was a problem hiding this comment.
[P1] Inspect visible Code Assist text separately from thoughts
A completed google-codeassist response containing visible text "sec", a thought part containing "padding", and visible text "ret" is inspected as "secpaddingret", while the Google SDK exposes "secret", allowing a forbidden value through with complete coverage. Inspect the concatenated visible and thought text separately before authorizing release.
| .ok() | ||
| .filter(Value::is_object) | ||
| .unwrap_or_else(|| json!({"output":text})); | ||
| parts = vec![json!({"functionResponse":{"name":name,"response":response}})]; |
There was a problem hiding this comment.
[P2] Preserve IDs for parallel Gemini tool calls
With two parallel calls to the same function, swapping the Chat results' tool_call_ids leaves the converted Code Assist payload unchanged because both native calls and responses discard IDs, losing the association between results and arguments. Preserve correlation IDs through both conversions, or reject this unsupported case before sending.
hireview001
left a comment
There was a problem hiding this comment.
- Resolve merge conflicts with the target branch.
| return self.decision(phase, "withhold", "content_field_unsupported") | ||
| if value.get("stream") is True and (not profile.allow_streaming or profile.protocol != "openai-chat"): | ||
| if value.get("stream") is True and ( | ||
| not profile.allow_streaming or profile.protocol not in {"openai-chat", "openai-responses"} |
There was a problem hiding this comment.
[P2] Reject unsupported local Responses streams before sending
With enforcing protection and allow_streaming=True, this now admits Responses streams through ProtectedAsyncTransport, whose release path still uses the Chat-only inspect_sse, so successful Responses SSE calls consume provider quota before being withheld. Reject these streams before local dispatch or implement a compatible local release checker while preserving Gateway support.
hidb4ai
left a comment
There was a problem hiding this comment.
Re-reviewed 8dd736a5d. The Code Assist channel separation, Gemini tool-call IDs, and local Responses-stream support fixes pass their focused checks. A new enforcing-mode disclosure remains: the Responses checker uses different part identities from Pydantic AI, allowing forbidden text to be assembled after approval. See the inline reproduction. @PsiACE @frf12 please address this before merging.
| self.parts[output, content, kind].append(text) | ||
|
|
||
| def _sdk_part(self, kind: str, output: int, content: int, text: str = "") -> None: | ||
| self.sdk_parts.setdefault((kind, output, content), []).append(text) |
There was a problem hiding this comment.
[P1] Reject collisions in SDK-derived reasoning identities
With enforcing protection forbidding secret, a Responses stream can emit sec for (output_index=0, item_id="rs_test", summary_index=1) and ret for (output_index=1, item_id="rs_test-1", summary_index=0), with normal added/done/completed events. I reproduced this on 8dd736a5d through ProtectedAsyncTransport and the actual Pydantic AI 2.64.0 client using a controlled upstream: the checker allows the stream, but ModelResponse.thinking contains padding\n\nsecret. Changing the second item ID to rs_other produces separate sec and ret parts.
Pydantic AI derives the vendor part ID as item_id for summary 0 and f"{item_id}-{summary_index}" otherwise, so these two different raw item IDs collide. This tuple key keeps them separate, and _identity() only checks raw item IDs, missing the content that the consumer actually concatenates. Reject derived-identity collisions, or inspect the same assembled content as the supported SDK before releasing the buffered stream.
There was a problem hiding this comment.
Verified fixed at 80556602a: replaying the original stream through ProtectedAsyncTransport and the actual Pydantic AI consumer now withholds it with output_identity_unsupported. The distinct-ID control still releases separate reasoning parts, and the ordinary forbidden-content control still blocks. This finding is addressed.
hidb4ai
left a comment
There was a problem hiding this comment.
Re-reviewed 80556602a, focusing on the changes since 8dd736a5d. The previously reported SDK-derived identity collision is fixed; the original enforcing-mode reproduction is now withheld while safe controls remain usable. No new blocking correctness findings in this update. The scheduler and usage-recovery test changes preserve the failure/deadline assertions while separating recovery from artificial short budgets.
No database tables or HTTP routes are added, but model/CLI/configuration/protocol contracts are added and /v1/context/check is extended. This does not meet the requested automatic-approval condition. CI is still pending. Validation used controlled provider responses and local SQLite; live subscriptions and Rust/host acceptance were not rerun in this incremental review.
Which issue or RFC does this PR close?
Related: RFC 0016 and RFC 2086.
Rationale for this change
Make mainstream LLM subscriptions usable through the existing Pydantic AI and Rust Gateway paths.
What changes are included in this PR?
LICENSES/oauth.md; update bilingual guides and required source headers.Are there any user-facing changes?
New model prefixes and device-login commands. Protocol limits and credential ownership are documented; Python Claude CLI requires inference protection to be disabled. With continuations disabled, truncated output retains diagnostics and fails structured generation. Upgrade Core before Gateway to accept the additive original-response evidence field.
How was this change tested?
0b22a60f7, Python 3.12 inference, Core context-check, Code Assist privacy, usage-recorder and Responses privacy suites: 550 passed, 1 platform skip. Stream cases use the actual OpenAI SDK and Pydantic AI with controlled responses, including parallel tools, initial content, text/thinking/refusal assembly, interrupted streams and usage. Eleven additional cases cover derived reasoning/tool/file identity collisions and safe controls, including raw reasoning with summary 0; four collision cases fail against the previous head and pass with the fix.make checkpassed after merging master; root, evaluation and Bub lock checks passed. Generated API and contract checks passed (69 tests).70cd1539e, Main 45019934521 completed with 68 successful jobs, 22 conditional skips and two failed statuses. All twelve Python unit/E2E jobs, Gateway formatting/Clippy/workspace tests/upstream protocol TCK, website/docs, Harness scenario acceptance and four SQLite upgrade configurations passed. The sole original failure was Ubuntu cold bootstrap: downloading the uv installer failed with an SSL connection timeout before PowerContext installation. The final CI result failed as a consequence. The installer source is unchanged by this PR, and the failure was retained without rerunning or changing tests.b5177d87ehas the identical Git tree. Its Ubuntu installer job passed on the first attempt, as did Gateway and Harness acceptance. Main 45020820484 still had two resource-candidate jobs pending at the last observation; this is not represented as a completed successful workflow.AI usage statement
Implementation, documentation and tests were assisted by OpenAI Codex.