Repository navigation
fix: avoid rebuilding provider metadata during usage reads - #146488
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 12, 2026, 5:53 PM ET / 21:53 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch reuses prepared plugin metadata during provider usage discovery, adds warm and cold discovery regression coverage, and corrects TLS renewal shutdown registration. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix: current main still rebuilds metadata during usage discovery. No actionable introduced defect was found, and the already-merged TLS prerequisite does not supersede the provider change. Priority: P2 Review scores
Verification
How this fits togetherProvider usage discovery identifies eligible plugins before OpenClaw resolves credentials and fetches usage summaries. It consumes the plugin inventory and current activation settings to produce provider descriptors. flowchart TD
A[Usage summary request] --> B[Plugin registry owner]
B --> C{Compatible inventory available?}
C -->|Yes| D[Prepared plugin metadata]
C -->|No| E[Cold metadata discovery]
D --> F[Apply aliases and activation rules]
E --> F
F --> G[Provider descriptors]
G --> H[Resolve credentials and fetch usage]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +4, Tests +143. Total +147 across 3 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep usage discovery on the existing lifecycle-owned inventory while preserving current activation policy and cold-process fallback. Do we have a high-confidence way to reproduce the issue? Yes, from source: warm usage discovery on current main discards prepared manifests and rebuilds them during discovery and alias normalization. The PR reports a failing base regression; this review did not execute it. Is this the best way to solve the issue? Yes. Passing the existing owner's prepared manifests through both consumers removes redundant work without adding another cache, public API, or configuration path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5270db64d8d0. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
…146488) * fix(gateway): stop TLS renewal through the shutdown owner * fix: avoid rebuilding provider metadata during usage reads
TLS prerequisite: #146412 (landed on main).
Related: #130741
What Problem This Solves
Provider usage discovery rebuilds plugin manifest metadata even when the Gateway already holds a complete inventory.
User Impact
Usage reads reuse the active plugin inventory while preserving current activation rules, aliases, and bundled-provider compatibility.
Why This Change Was Made
Carry the manifest metadata already returned by the registry owner through usage discovery and plugin-id normalization. Cold discovery remains available when no compatible operation snapshot exists.
Evidence
The regression fails on the base because two warm usage lookups rebuild manifests four times. All 176 scoped tests pass on the candidate, covering usage discovery, provider runtime, cold fallback, and plugin usage loading. The normal build, representative OpenAI plugin import profile, and isolated P1 review passed.
The full canonical changed gate passed on the published head. Exact-head CI remains required before landing.