Repository navigation
fix(models): prepare configless catalogs asynchronously - #152142
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 18, 2026, 6:09 PM ET / 22:09 UTC (Revision 4). ClawSweeper reviewWhat this changesModel-catalog planning and writing load omitted configuration asynchronously while retaining matching source settings, environment, and caller options. Merge readiness✅ Ready for maintainer review This remains useful: current main still performs synchronous config preparation for these callers. No actionable introduced defect was found, and the prior review has no outstanding findings. Priority: P2 Review scores
Verification
How this fits togetherModel-catalog preparation combines configured providers, discovery results, and authored secret markers. It produces planned catalog contents or updates the agent’s models.json and plugin catalog cache. flowchart TD
A[Catalog request] --> B{Explicit config supplied?}
B -->|Yes| C[Existing config projection]
B -->|No| D[Async runtime config preparation]
D --> E[Capture config source and environment]
C --> F[Shared catalog planner]
E --> F
F --> G[Return planned catalogs]
F --> H[Serialized catalog writes]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +58, Tests +241. Total +299 across 8 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep configless catalog preparation on the existing async owner while preserving source markers, consent preparation, and established catalog persistence. Do we have a high-confidence way to reproduce the issue? Yes, from source: a cold catalog call without explicit configuration reaches synchronous loading and snapshot preparation on current main. Runtime reproduction was not executed during this read-only review. Is this the best way to solve the issue? Yes. Reusing the existing async loader and capturing its publication before continuation avoids a competing config owner while preserving the established catalog contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8adb6ebf5f63. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
|
Merged via squash.
|
What Problem This Solves
When model-catalog preparation is called without explicit config, its planner and writer synchronously load runtime configuration. That can inspect Claw consent provenance on the host thread even though the caller is asynchronous.
User Impact
Moves this incidental config and consent preparation onto the existing asynchronous path while preserving generated catalogs, source secret markers, and Claw tool-policy decisions.
Why This Change Was Made
Both entrypoints now share the captured async config reader. Its internal opt-in result retains runtime config, authored source, and effective environment together before the caller resumes. Later publication, reset, or environment changes cannot mix generations or redirect default directory resolution. Explicit config and the synchronous SDK retain their existing paths; no new cache or database owner is introduced.
Evidence
The compiled writer retains the same single Claw lifecycle read as its explicit-config control when catalog persistence opens the agent/root database owners. Other catalog and credential SQLite work remains with its existing owners; this does not claim that the entire model flow performs no host SQL. OAuth, secrets activation, updater behavior, and metadata lookup ordering are outside this change.
The first CI run tested a stale merge against
47c4fbcband failed on three duplicatepromisifydeclarations in shared SQLite tests. This normal main carry includes the canonical repair from #152028 (3fceb860); it preserves the complete feature diff and retired header paths. Successor CI run 35396508084 passed onc734eb623ede2e5f44ca617a2fca1afd941b0380, including the required CI gate (140 successful jobs, 17 skipped).