Repository navigation
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.
| "jieba==0.42.1", | ||
| "packaging>=24,<27", | ||
| "pydantic-ai-slim[anthropic,openai]>=2.27.1,<3", | ||
| "pydantic-ai-slim[anthropic,openai]>=2.64.0,<3", |
There was a problem hiding this comment.
[P2] Preserve the Anthropic x-api-key header across the SDK upgrade. With generation_model=anthropic:..., a custom base URL, and generation_headers={"x-api-key": "test-key"}, composition removes that header and passes it as api_key to the upgraded Anthropic SDK, which now sends Authorization: Bearer test-key instead. I reproduced this through open_builtin_runtime against a local Anthropic-compatible endpoint requiring x-api-key: it received no such header, returned 401, and generation readiness became misconfigured: provider-rejected. The same change affects ANTHROPIC_API_KEY on custom endpoints. Please preserve the existing header contract for these endpoints and verify both explicit-header and environment-key configurations against a server that enforces authentication.
Which issue or RFC does this PR close?
No linked issue or RFC.
Rationale for this change
Allow PowerContext to use existing Codex and GitHub Copilot subscriptions for generation. Upgrading Pydantic AI provides credential reuse without adding a login flow.
What changes are included in this PR?
pydantic-ai-slimto>=2.64.0,<3and adapt inference clients, error handling, tracing, and integration context history.Are there any user-facing changes?
Use
openai-codex:<model>with an existing Codex login file, orgithub-copilot:<model>with an existing OAuth token and a Chat Completions model. These providers support Memory, Experience, and Profile generation. Topic Memory, Dream, and built-in inference protection are unavailable with these providers.SDK callers supplying HTTP clients for MiniMax embeddings or Jev reranking must use
httpx2.AsyncClient.How was this change tested?
UV_NO_SYNC=1 make check.openai-codex:gpt-6.1-solandgithub-copilot:claude-haiku-4.5. Both passed Server readiness, Memory extraction and storage by a spawned worker, and readback after restart. The Codex login file remained unchanged.AI usage statement
OpenAI Codex assisted with implementation, documentation, and validation.