Repository navigation
refactor(agents): simplify runtime-auth deadline plumbing - #189183
Conversation
Inline request auth into its controller and reuse the timer clamp directly. Keep deadline, cancellation, account authority, and error behavior unchanged. Co-authored-by: Alex Mittell <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR inlines request authentication into its controller, removes redundant forwarding helpers, and relocates unchanged cooldown policy. Example: An OAuth credential exchange finishes after a run's 100 ms deadline.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR meaningfully simplifies auth plumbing while preserving existing behavior; no actionable defect was found. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe embedded runner's auth controller receives selected profiles, run authority, cancellation, and deadlines, then resolves credentials and supplies checked authentication to provider transports. flowchart TD
A[Embedded agent run] --> B[Auth controller]
C[Run deadline and cancellation] --> B
B --> D[Canonical credential owner]
D --> E[Runtime auth exchange]
E --> F[Current authority check]
F --> G[Credential installation and provider handoff]
Technical reviewBest possible solution: Retain the controller-owned implementation with the existing deadline, cancellation, account-authority, and cooldown contracts intact. Do we have a high-confidence way to reproduce the issue? This is a refactor rather than a new bug report; source comparison establishes preserved behavior, and no target code was executed during this read-only review. Is this the best way to solve the issue? The change uses existing owners, removes the replaced factory and unused exports completely, and preserves the timer clamp's exact calculation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 36f60baf82a1. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -61. Total -61 across 5 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 31, 2026, 3:31 AM ET / 07:31 UTC. |
|
Merged via squash.
|
…89183) Inline request auth into its controller and reuse the timer clamp directly. Keep deadline, cancellation, account authority, and error behavior unchanged. Co-authored-by: Alex Mittell <[email protected]>
What Problem This Solves
Follow-up to #189144, which fixed stalled provider authentication but added 126 net production lines. This requested simplification targets a net reduction of at least 60 production lines and moves the combined change toward the loop’s net-zero goal.
User Impact
No user-visible behavior change. Authentication still shares the run deadline, propagates cancellation, rejects late credentials, and preserves recovery from provider AbortErrors. Error text and public SDK types are unchanged.
Why This Change Was Made
Inline request authentication into its owning controller, removing the single-use forwarding factory and its duplicated parameter contract. Call the existing timer clamp directly, inline the one-use key-sink type, and return the existing refresh promise. Keep the unchanged pure cooldown policy beside the existing auth-profile failure policy so the controller stays within the source-size limit.
Production delta: −61 lines; test delta: 0. Combined with #189144: +65 production lines. The shared auth deadline remains necessary to distinguish run cancellation from a provider’s own abort and to share the preparation/execution budget.
Evidence
git diff --check: passed.4382e6e9232f, with full affected source and auth test context: scoped-clean, no actionable findings. The final committed headfe628f869ec5only adds mechanical unused-import/shadowing cleanup and restores the original clock-read placement to that reviewed snapshot. Local ClawSweeper is unavailable on this host; hosted ClawSweeper review completed onfe628f869ec5with zero findings and no before-merge actions.fe628f869ec5; no inherited-failure exception was used. Landed throughscripts/prasbae3b0bdbf72. No live Gateway or protected checkout was used.Co-authored-by: Alex Mittell [email protected]