Repository navigation
perf: admit and select inference grants in one authority call - #269
Conversation
Publish secretless routing projections with credential-owner attachment state and select eligible grants in the admission transaction. Share eligibility, strategy and sticky-input behavior with the legacy path; fence bounded KV backfills and retain fresh failover authorization. Keep per-request credential-owner materialization: an owner can revoke secrets while authority publication is unavailable, so the authority's old generation cannot safely authorize cached tokens. Document this work-order escape hatch. Validate with pnpm check, pnpm worker:e2e, selection/migration/revocation regressions and the synthetic local load sweep. Independent autoreview is clean.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR combines proxy-key HTTP admission and grant selection in one authority call using persisted, secretless routing projections. Example: A warm POST /v1/messages request for anthropic/claude-sonnet-5 using a subscription grant.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 4 items remain Keep this PR open: it delivers a useful, distinct performance improvement beyond current main, with no definite introduced code defect found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe Worker prepares an inference operation, the access authority validates its caller and selects a scoped grant, and the credential owner supplies current secrets before budgeted provider dispatch. flowchart LR
A[HTTP inference request] --> B[Worker operation preparation]
B --> C[Access authority admission and selection]
D[Secretless routing projections] --> C
C --> E[Credential owner materialization]
E --> F[Budget and retention checks]
F --> G[Provider dispatch and accounting]
Technical reviewBest possible solution: Land the combined selection path with per-request credential materialization after final-effect authority evidence and retained-state upgrade validation. Do we have a high-confidence way to reproduce the issue? This is a performance optimization; current-main source independently confirms the extra selection call and KV read targeted by the change. Is this the best way to solve the issue? Combining selection with admission is a sound approach because both paths share eligibility rules and the existing selector, while credential materialization remains authoritative for revocation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 311b4e5bc2b5. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: shipped entry point. SecurityNeeds attention: No concrete bypass was found, but the persisted authority cutover needs final-effect evidence under revocation and publication failure. EvidenceWhat I checked:
Likely related people:
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 12, 2026, 12:58 AM ET / 04:58 UTC. |
Summary
Follow-up to #268. Warm subscription inference made two sequential calls to the global
ACCESS_CONTROLauthority plus a KV read before the credential owner (/admission/resolve→ KV grant projections + local filters →/grant-pools/select). In production each authority hop costs ~70–85 ms.Warm proxy-key HTTP inference: 2 authority calls + KV + credential owner → 1 authority call + credential owner. Access-session, pinned continuations and WebSocket paths unchanged.
Verification
pnpm check: 1,301 Worker / 224 admin / 343 script tests;pnpm worker:e2e; autoreview clean through P2 (fixed legacy-failover scope/stickiness races found in review).reauth_required, policy disable and rotation tests.Local workerd has no Worker↔DO network hop; production saves one more authority round trip on top.