Repository navigation
improve(gateway): avoid redundant startup preflight work - #147285
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 13, 2026, 3:18 PM ET / 19:18 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR reduces Gateway startup work by avoiding early plugin discovery, sharing SQLite schema inspection within one snapshot, and updating CLI and test-routing expectations. Merge readiness✅ Ready for maintainer review Keep open as a useful, bounded optimization with no blocking findings. Current main still performs the redundant work, and the maintainer explicitly accepted the earlier measurement limitation. Priority: P3 Review scores
Verification
How this fits togetherGateway startup reads configuration and checks stored databases before admitting the runtime. This change reduces repeated preparation while preserving full plugin validation and database compatibility checks. flowchart TD
A[Gateway command] --> B[Early core configuration read]
B --> C[Proxy and diagnostics setup]
C --> D[Full startup validation]
E[Private database snapshot] --> F[Shared table inspection]
F --> D
D --> G[Gateway ready or startup error]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +5, Tests +1. Total +6 across 4 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Reuse existing validation and snapshot-local inspection contracts while keeping full startup admission and fresh checks on later opens. Do we have a high-confidence way to reproduce the issue? Not applicable as a functional bug reproduction: this is a performance optimization, supported by source-visible duplicate work and reported before/after Gateway readiness measurements. Is this the best way to solve the issue? Yes. The patch reuses existing owners, keeps caching within an unchanged snapshot, and leaves full plugin admission and persisted formats unchanged. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 38a482832a67. 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)
|
400e0c3 to
9e11778
Compare
|
Reviewed the remaining measurement-risk note. The PR claims only the observed warm-filesystem result from three samples per version; it retains the failed warmup and the 38.257-second discarded warmup in its evidence and makes no cold-start guarantee. The optimization removes source-visible duplicate work through existing core-only config and snapshot-local schema-reader contracts. Full plugin admission and fresh checks on subsequent database opens remain intact. This limitation is acceptable for landing the bounded change. The refreshed head also corrects the inherited QA workflow routing assertion exposed by CI. All 639 routing/QA tests and the complete selected static checks pass, and a fresh four-file independent review found no blocking issues. Required hosted CI for the repaired head is still pending. |
|
Merged via squash.
|
* commit 'ac59d5e09eb468dc23cf95e447608b57e71b52af': (176 commits) improve(gateway): avoid redundant startup preflight work (#147285) test(macos): observe readiness cancellation and deadline ownership (#145056) fix(ci): route QA Profile Evidence to its run-status owner test (#147293) fix(install): preserve runtime links when Node validation fails (#147221) test(auto-reply): reuse memory session fixtures (#147262) fix: hide subagent sessions from Activity (#147253) ci: record resources for slow runtime test commands (#147254) fix(update): recognize FreeBSD boot identities in triage leases (#147243) refactor(active-memory): share closing tag line scan (#147031) fix: resume Settings autosave after Reload Config (#147136) fix(cli): keep conversation context after cancellation (#147139) fix(channels): make system-agent approval cards actionable (#147152) refactor: retain shared database handles until their last worker closes (#147246) refactor(slack): share workspace-qualified target resolution (#147024) refactor(msteams): remove duplicate quoted-table test (#147270) fix(qa): bind coverage IDs to producer assertions (#144000) fix(linux): explain FreeBSD desktop setup prerequisites (#147211) fix(memory): split embedding batches rejected for an input array item cap (#139541) test: isolate timing metadata persistence from inherited settings (#147112) refactor(status): retire test-only helper publication (#147071) ...
…7285) * improve(gateway): avoid redundant startup preflight work * test(ci): include QA profile status in workflow routing
Related: #147165
What Problem This Solves
Gateway startup repeats plugin discovery and SQLite schema inspection before it can become ready.
User Impact
The measured warm-filesystem readiness median fell from 11.37 to 10.32 seconds (about 9%) on Windows with an isolated synthetic configuration. These are small-sample measurements, not a cold-start guarantee. No configuration or database migration is required.
Why This Change Was Made
Early proxy/diagnostics config reads now use the existing core-only policy; full plugin validation still runs during startup admission. The two schema policies reuse the existing table reader within the same private or immutable snapshot, while later admissions continue to read fresh facts.
Evidence
qa-profile-run-statustest. The expected target list now includes that test; routing and exact assertions are unchanged. The original failure reproduced locally before the correction; all 639 routing/QA tests and the complete selected static checks passed afterward. A fresh four-file independent review found no blocking issues.