Repository navigation
improve: avoid repeated model indexing in chat metadata - #149389
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 16, 2026, 12:54 AM ET / 04:54 UTC (Revision 6). ClawSweeper reviewWhat this changesReuses configured-model indexes while preparing chat metadata, preserves runtime-specific metadata donors, and adds regression coverage for indexing and authorization failures. Merge readiness✅ Ready for maintainer review This PR remains useful: current main still repeats configured-model indexing. No actionable patch defects were found, and the updated Gateway evidence resolves the previous review’s remote-validation blocker. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway combines configured model settings, catalog snapshots, and account availability to prepare model metadata for chats. This change reduces repeated work within that existing projection. flowchart TD
A[Configured model settings] --> D[Lazy configured-model index]
B[Published catalog snapshot] --> C[Account and runtime evaluation]
C --> E[Select runtime metadata donors]
D --> F[Project model metadata]
E --> F
F --> G[Chat metadata response]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +1, Tests +109. Total +110 across 3 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep configured-row indexing within the existing projection owner while preserving runtime donor isolation and live account checks. Do we have a high-confidence way to reproduce the issue? Yes: current-main source rebuilds the lazy configured-row resolver inside each logical-model projection, and the supplied regression records repeated visits. This review did not execute tests. Is this the best way to solve the issue? Yes: reusing the existing projection owner is a narrow repair that preserves authorization ordering, configured overrides, and explicitly empty runtime donor sets. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9c8e425f0197. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
aa69748 to
1d6bdf9
Compare
Preserve the configured-index production change while incorporating main at dc92446. Extend the existing projection regression to verify distinct configured prompt budgets alongside names and context windows.
|
The remote Gateway validation retained by ClawSweeper revision 5 is now complete at The hosting workflow reported |
|
Merged via squash.
|
What Problem This Solves
Opening chats and reading model metadata repeats configured-model indexing for every logical catalog entry.
User Impact
Catalog projection does less repeated work while preserving model availability, configured names and budgets, runtime-specific capabilities, and personal-account authorization freshness.
Why This Change Was Made
Reuse the projection's existing lazy configured-model resolver and pass the selected runtime's donor rows explicitly. The resolver retains its existing projection lifetime and authorization order, including explicit empty donor lists.
Evidence
Tested head:
ed5ab23fd0a7e8bd6214773b00591a527966b314. On pinned maindc92446872809320a460ab01e589ddeffaec474d, the regression reproduced five additional visits to each of 17 configured rows for five logical models. The candidate permits at most one, preserves configured names/context windows/prompt budgets, and retains the exact authorization failure without projecting before rejection. All 119 focused and sibling tests, full changed checks, and independent P2 review passed. Exact-head CI passed.Fresh Blacksmith Testbox proof installed and built that exact source with Node 24.19.0 and pnpm 12.3.4. A real CLI Gateway and device-backed client exercised personal-account connection through
users.authConnect, created shared/personal pinned sessions, and completed all 30 recorded RPCs, including 16 alternatingchat.metadatacalls across 32- and 128-model cohorts. Model IDs, names, context windows, availability, account pins, scopes and build identity matched. Both Gateway children, service units and all state/client lifetimes closed; the export and canonical lease closure were verified independently. Metadata responses took 3.7–23.5 ms at 32 models and 9.5–78.7 ms at 128 models.The hosting workflow ultimately reported
cancelled. Successful application execution, strict export and lease closure are established by their independently verified receipts. The cancellation’s initiating actor is not established.The earlier component benchmark remains attributed to base
1349c4c5420c1f0853f83ad6e0a35ab9db6b8791and candidateaa69748df9caca2a408e4f067d9ef8487e0afda7. With three warmups and 12 fresh projectors per process, two interleaved 128-model observations took 0.2801/0.3000 seconds before and 0.2213/0.2212 seconds after; outputs matched. This measured the real constructor and awaited projection, with GC and scheduling uncontrolled.These are small synthetic samples, not a production-latency, memory-reduction or stall-elimination claim. The historical component baseline is not a matched before/after RPC control. The two earlier queued provisioning attempts produced no product receipts; the fresh Gateway run completes the previously missing remote validation.