Repository navigation
improve: avoid repeated runtime setup for Gateway utility calls - #150706
Conversation
|
🦞👀 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 maintainer review before merge. Reviewed September 17, 2026, 3:55 AM ET / 07:55 UTC (Revision 3). ClawSweeper reviewWhat this changesGateway utility calls reuse a compatible prepared provider runtime instead of rebuilding it for each model selection, with focused reuse and lease-retention coverage. Merge readiness✅ Ready for maintainer review This remains a useful, focused optimization absent from the captured main revision. No actionable correctness or security finding was identified, and the previous review has no outstanding concrete findings. Priority: P2 Review scores
Verification
How this fits togetherPrepared model runtimes hold the provider registrations, model information, and credential snapshots used by agent completions. The lease owner matches each request to a suitable runtime and retains its resources until the call finishes. flowchart TD
A[Utility completion request] --> B[Admit configured agent context]
B --> C{Current runtime covers selection?}
C -->|Yes| D[Borrow configured runtime]
C -->|No or explicit discovery| E[Prepare requested runtime]
D --> F[Retain lease and execute completion]
E --> F
F --> G[Release runtime resources]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +33, Tests +137. Total +170 across 3 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Reuse covered selections through the existing lease owner while preserving separate preparation for explicit discovery and uncovered plugins. Do we have a high-confidence way to reproduce the issue? Not applicable as a functional failure: this is a performance optimization. Source shows selection-keyed preparation, and the PR reports paired component measurements; this read-only review ran no tests or runtime code. Is this the best way to solve the issue? Yes. Extending the existing lease owner avoids a competing cache and preserves the current isolation, discovery, and retirement paths. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 98892be36358. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Merged via squash.
|
…claw#150706) * improve: reuse configured runtimes for Gateway utility completions * test: group Gateway prepared-runtime lease coverage
What Problem This Solves
Recaps and other utility completions can rebuild the same provider runtime for every agent/model selection on a busy Gateway.
User Impact
Utility calls reuse the Gateway's prepared provider when it already covers the requested selection, reducing repeated setup while preserving credential and reload isolation.
Why This Change Was Made
The lease owner now retains the current configured generation for covered static selections. Requests requiring additional plugins or explicit runtime discovery keep their existing preparation path. Existing lease retention keeps an in-flight call valid across reload.
Evidence
5215fe989ff2dd1cab2a331621d24bb669467816: the same 90 focused tests and two existing configured-model-alias cases passed. The nearby alias changes compose correctly; source and private dependency pins remained unchanged.