Repository navigation
feat(inference): reuse Codex and Copilot subscriptions - #2432
Conversation
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.
The dependency upgrade breaks authentication for existing Anthropic-compatible endpoints that require the configured API key in x-api-key.
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.
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 the Anthropic credential fix. Both API-key-only and gateway-plus-upstream authentication now pass the local runtime probes in disabled and shadow protection modes. CI is still running, and GitHub reports merge conflicts that need resolution.
hireview001
left a comment
There was a problem hiding this comment.
- Resolve merge conflicts with the target branch.
hidb4ai
left a comment
There was a problem hiding this comment.
I reproduced the conversation-history regression reported in this existing thread: after a second run with the first run's history, new_messages() includes both the first and second user prompts. I am changing my earlier approval to request changes until that boundary is preserved.
…orized HTTP errors
Reconcile the PR's httpx2 SDK migration with master's provider observation wrapping: observability and composition inspect httpx2 clients and transports, and MiniMax keeps its observation operation around the httpx2 request path. Merge the bilingual observability docs onto master's full text, which already covers the tracing, worker coverage, and provider-observation contracts. Keep the uncategorized-HTTP-400 context-overflow fallback and its single helper definition.
… every step The new-message boundary fix moved recalled context to the current-run boundary in persisted history, which also demoted it from a leading SystemPromptPart to a mid-conversation <system>-tagged user turn for providers without inline system prompts. Pydantic AI keeps the outgoing request list and the persisted history separate after the before-hook chain detaches, so persist the context at the boundary for new_messages() and lead the model-facing request with it. Later tool steps rebuild their request from persisted history, so reorder there too, restoring the system-role contract on every step. The regression now covers a new prompt, the multi-step tool turn, and a history-only resume whose input ends in a ModelRequest, and snapshots the caller's history instead of asserting message counts.
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.
…ult ACLs The case directory is a temporary directory, and on a runner whose temp root carries a default POSIX ACL that entry is inherited by every hook-created subdirectory and file. A default ACL overrides the umask, so the hooks' own `$HOME/.local`, `$HOME/.local/state/powercontext`, and diagnostics file were recorded as 775/664 instead of the characterized 755/644 even though each hook process already starts with umask 0o022. Remove the inherited default entry at the case root before any hook runs; it is created before the first step, so modes below it then follow the umask alone. Only the root needs handling, and private 0600/0700 expectations are unchanged. The attribute is Linux-specific, so other hosts are left alone, and an unexpected removal error still fails the case. Every other fixture field was identical in the failing CI run.
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.
The earlier new_messages() counterexample now passes, but I independently confirmed the existing environment-selected Anthropic gateway issue in both disabled and shadow modes. I also reproduced the Codex refresh lifecycle issue with synthetic credentials and a single-use refresh stub; this was not a live subscription test. These issues still need resolution before approval.
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.
|
please resolve conflicts |
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.
Superseded by the Anthropic authentication fixes in 8c83d2c: custom endpoints retain X-Api-Key and gateway Authorization alongside the upstream API key. The associated thread is resolved; requesting a fresh review.
`test_codex_workers_and_restart_observe_cli_renewal` joins each spawned
worker for ten seconds and then asserts `exitcode == 0`. Every worker has
already answered on the pipe at that point, so the assertion is about
interpreter shutdown, not about the credential behaviour under test, and the
shared matrix runner gives two cores to eight pytest workers:
- run 42687710011, `tests (3.12, unit)`:
`AssertionError: assert None == 0 ... <SpawnProcess name='SpawnProcess-2' pid=... started>`
- run 42714396200, `tests (3.11, unit)`: the same assertion, same worker
state, after the expected `[(".../codex/responses", "***", "renewed-account")]`
reply had already been asserted.
The test arrived on master today in oceanbase#2432 (`6d781dcfe`). Wait up to a minute
and report the worker that did not exit, so a scheduling delay no longer
reads as a product failure while a worker that never exits still fails here.
No production code changes.
Which issue or RFC does this PR close?
No linked issue or RFC.
Rationale for this change
Reuse existing Codex and GitHub Copilot subscriptions for generation without adding a login flow. The Pydantic AI upgrade must preserve authentication, conversation boundaries, error classification and content-free observability.
What changes are included in this PR?
pydantic-ai-slimto>=2.64.0,<3and migrate provider clients, tracing and integration history to its HTTPX2/message contracts.X-Api-Keyauthentication for Anthropic-compatible endpoints selected through either explicit configuration orANTHROPIC_BASE_URL. Keep separate gateway and upstream credentials, and preserve default official-endpoint authentication.c4c95e46, retaining its Source locators, provider observations and shared CI fixes. Adapt Atomic Memory retry fixtures to SDK-normalized feedback and assert exact Source sequence locators while preserving business assertions.Are there any user-facing changes?
Use
openai-codex:<model>with an existing file-backed Codex CLI login, orgithub-copilot:<model>with an existing OAuth token and a Chat Completions model. Memory, Experience and Profile generation are supported; Topic Memory, Dream and built-in inference protection are not supported for these subscription providers.Codex credential renewal remains the CLI's responsibility; this integration does not provide unattended renewal. Server and worker processes must be able to read the same login file. SDK callers injecting clients for MiniMax embeddings or Jev reranking must use
httpx2.AsyncClient. English and Chinese documentation describe these contracts.How was this change tested?
pydantic==2.12.0: 97 passed across Source locator serialization, Source observations and API contracts in an isolated environment.make check: passed, including all hooks, lock consistency and type checks.Live subscription calls, the full Python/backend matrix and installed-release upgrade acceptance remain separate CI/operator checks. No claim of live-provider acceptance is made by the controlled transport tests.
AI usage statement
OpenAI Codex assisted implementation and review. Earlier repairs used local Bub with
magpie:group/deepseek-flashat high reasoning effort. Codex directly reproduced and implemented the current authentication and integration fixes, reviewed the resulting diff and ran acceptance; Bub was not used for this update.