Repository navigation
Refactor token ownership and HTTPX request/response adapters - #15
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The PR appears safe to merge; no new actionable issues remain. SummaryThe PR lets applications own token refresh directly and separates request adapters from response adapters. It also separates managed execution from request export and strengthens cancellation and cleanup behavior.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Build request] --> B{Execution owner}
B -->|Caller| C[Authorize and adapt once]
C --> D[Export native request]
B -->|Sunday| E[Authorize and adapt attempt]
E --> F[Send through HTTPX]
F --> G[Notify credential owner]
G --> H[Adapt response]
H --> I{Retry or redirect allowed?}
I -->|Yes| J[Finish response cleanup]
J --> E
I -->|No| K[Return or decode response]
Reviews (2) · Last reviewed commit: "Sanitize managed response execution erro..." · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 02826952fb
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f4c48dd246
ℹ️ 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".
Client settings previously wrapped token providers in a
TokenManager, introducing a second cache when an external framework already owned token refresh and invalidation. Transports now use providers directly; applications opt into Sunday caching by supplying aTokenManager.Changes
RequestAdapterandResponseAdapterABCs, asynchronous callable support, and flattenedchain_tocomposition. Each Sunday-managed attempt authorizes and adapts once; request export transfers lifecycle ownership to the caller.RequestCancellationErroras an unconditional stop signal, preserving its identity through retries, SSE reconnects, encoding/decoding, and nullable operations.Compatibility
ClientSettings.token_providersandHttpxTransport(token_providers=...)replace manager-based wiring;TokenManagerFactoryis removed. Existing legacyadapters=remain supported. Custom transport integrations should useexecute_requestfor managed execution and retaintransport_requestfor export. README migration guidance covers explicit caching and the new adapter contract. Generator and other-runtime updates are outside this PR.Validation