Repository navigation
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 28, 2026, 9:38 PM ET / September 29, 2026, 01:38 UTC (Revision 3). ClawSweeper reviewWhat this changesThe branch reuses one captured configuration while preparing Gateway model choices and retained chat metadata, with regression coverage for a configuration reload. Merge readiness✅ Ready for maintainer review Keep this PR open. Current main still has the repeated projection path, and the recorded benchmark and focused regression coverage support the optimization. I found no concrete introduced defect. The PR documents a browser CI timeout that the native landing gate must handle. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway reads an agent's prepared model catalog when clients list models or request chat metadata. Configuration and live authentication feed the catalog decisions, which produce visible choices and availability. flowchart LR
A[Configuration reload] --> B[Runtime and source capture]
B --> C[Prepared model catalog]
D[Live authentication] --> E[Model decisions]
C --> E
E --> F[Gateway model list]
E --> G[Chat metadata]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +5, Tests +207. Total +212 across 4 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep catalog decisions on the existing captured runtime/source pair while preserving live authentication checks and prepared-owner retirement. Do we have a high-confidence way to reproduce the issue? Yes. A managed neutral reload yields an equal but distinct config, and the current-main call path plus the recorded 32-model measurement give a focused reproduction path; I did not execute code in this read-only review. Is this the best way to solve the issue? Yes. Reusing the existing config-capture owner is a narrow way to remove repeated projection work, and the added coverage checks returned models and owner retirement. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f568b1768f5d. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Superseded by the merged model-list repair in #168733 and the remaining chat-metadata fix in #173850 (merge commit The current-source production-boundary regression verifies one full source projection after a neutral reload for both 1 and 32 models (previously 2 and 33), zero on retained reads, unchanged model/account results, and correct withdrawal after owner retirement. The replacement passed 58 focused tests and its exact-head CI. Thanks @steipete for the original report and proposal. Closing this older implementation now that both paths are covered on main. |
What Problem This Solves
After a neutral configuration reload, listing models and reading retained chat metadata can repeatedly copy the whole configuration for every model.
User Impact
Model selection and chat metadata do less allocation work after a reload while retaining the same models, authentication decisions, and readiness checks. No schema change, migration, configuration option, or operator action is required.
Why This Change Was Made
The managed reload publishes an equal-but-distinct runtime config object. Passing the prepared owner's original object into each model decision repeatedly reconstructs its source projection. The existing catalog projector now captures the runtime/source pair once and carries it through catalog preparation and retained metadata reads. This uses the existing capture owner and introduces no additional cache.
The original request stamps, observation identity, current-owner checks, live authentication store, authentication deadlines, and personal model pins retain their existing owners. Tests exercise the registered
models.listhandler and metadata preparation after an actual managed neutral publication.Evidence
For a synthetic 32-model catalog, a single matched measurement produced:
models.listThe clone counts establish the bounded allocation improvement. These are single timing samples on an isolated Node 24.19.0 runner, not a whole-Gateway latency claim. Small-case timings were mixed, and whole-command peak RSS was essentially unchanged. The temporary benchmark is not added to the test suite.
The original regression fails with 4 and 97 projections exceeding the preparation bound for one and 32 models. The candidate passes with one projection per preparation and none during retained reads, while preserving returned values and owner retirement.
The final focused run passed 56 tests across eight files in 62.13 seconds command wall, using
node scripts/run-vitest.mjswith--maxWorkers=1. Coverage includes native readiness and revocation, owner/config stamps, authentication deadlines, personal pins, published results, plugin runtime, and configured runtime choices. The two new regression bodies took 454 ms and 141 ms. The two updated configured-index/authentication cases took 456 ms and 99 ms. Their fixture now observes the actual index owner and live auth store; restoring the original per-row construction still fails the index bound with 5 > 1. Hosted CI measured 0.395 seconds across the two new regression bodies and 1.126 seconds for the updated index/authentication pair; these exclude setup and shard overhead.The full changed gate passed core types, all 27 test type-check groups, four-file lint with zero warnings/errors, formatting, dead exports, schema/legacy-store guards, import cycles, and the remaining structural checks in 1,263.66 seconds. All 31 recorded source/toolchain inputs matched before and after execution. Incorporation onto main
632b150d462fpreserves those inputs and all four reviewed file contents. Fresh independent P0–P2 review is clean.The first hosted CI run passed all Node test shards. Its remaining browser shard exceeded the 25-minute job limit after two chat position-rail tests timed out at 120 seconds each. The required gate is red; the investigation below did not establish a product fix.
A bounded replay of the same merged source passed 81 files / 354 tests in 394.803 seconds command wall (392.55 seconds Vitest) on an isolated Node 24.19.0 runner with four-CPU affinity and three workers. The native Vitest result cache was cleared and all 81 files matched the original cold shard order before execution. The original failing reader-dark and 80-message LTR layout cases passed in 20.114 and 22.352 seconds. Test source, assertions, and the 120-second test limit were unchanged.
Across 155 matching cases, the hosted median non-rail duration was 7.27 times the replay duration. The original job retained no quota, memory, steal-time, or timeout-capture evidence sufficient to explain this broad slowdown; the isolated machine is not fully equivalent to that runner. A passing replay does not prove a fix. No UI repair or hosted rerun was made, and the failed required gate remains unresolved.