Repository navigation
improve: reduce blocking skill checks during agent startup - #146373
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, 9:26 PM ET / September 13, 2026, 01:26 UTC (Revision 11). ClawSweeper reviewWhat this changesThe PR makes agent-startup skill checks asynchronous, shares pending preparations, and preserves current session state across the new waits. Merge readiness✅ Ready for maintainer review This remains useful: current main still performs synchronous skill preparation. No actionable introduced defect was found, and the previous review’s fixture-failure follow-up is resolved by the merged repair. Priority: P2 Review scores
Verification
How this fits togetherSkill preparation combines installed skill metadata, executable availability, and session preferences into the instructions available to an agent. Its snapshots feed agent prompts and sandbox skill preparation. flowchart TD
A[Installed skills and session preferences] --> B[Skill snapshot owner]
B --> C{Reusable snapshot?}
C -->|No| D[Bounded asynchronous executable checks]
D --> E[Recheck source and caller validity]
E --> F[Publish skill snapshot]
C -->|Yes| F
F --> G[Agent prompt and sandbox preparation]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +364, Tests +691. Total +1055 across 53 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep asynchronous preparation within the existing snapshot owner while preserving synchronous inventory contracts, saved prompt bytes, and caller-specific cancellation. Do we have a high-confidence way to reproduce the issue? Not applicable as a functional bug reproduction; current source establishes synchronous checks, and the recorded real-owner comparison measures their scheduling impact. Is this the best way to solve the issue? Yes. The patch extends the existing preparation and snapshot owners, retains shared eligibility rules, and preserves synchronous consumers without adding configuration or changing persisted formats. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b20b093f4dae. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (10 earlier review cycles; latest 8 shown)
|
2fd7d2c to
85953cb
Compare
85953cb to
ba0b96c
Compare
ba0b96c to
5f7b24a
Compare
|
Merged via squash.
|
…146373) * improve: reduce blocking skill checks during agent startup * fix(skills): align async preparation fixtures and lint contracts * test(skills): omit default deferred type arguments
What Problem This Solves
Concurrent agent starts can block Gateway requests while synchronously checking skill executables.
Why This Change Was Made
Prepare executable requirements asynchronously with four workers per preparation, reuse successful lookups, and share pending work through the existing skill snapshot owner. Runtime callers await preparation and recheck current run/session authority before publishing snapshots or preparing a sandbox. Synchronous SDK and inventory contracts remain supported.
User Impact
Other requests can resume much earlier during skill preparation. Session edits, replacement, deletion, reset and caller cancellation remain authoritative across the new waits. This is a responsiveness improvement with additional work in some measurements, not a universal throughput or memory improvement.
Evidence
A real Gateway comparison used immutable
00fc6ceversusba0b96con WSL/Linux, Node24.19, with four fresh O,C,C,O processes. Each completed eight synthetic turns, eight updates, 64 sampler rounds, 256 history requests and 64 requests per control method, with zero recorded failures and clean Gateway exits.The predeclared pairs changed combined completion by +6.2% / -19.0% and CPU by +31.4% / -5.5%. Combined completion joins turns and auxiliary requests; it is not individual-agent latency. Fixed auxiliary counts do not establish identical internal work: mock-provider log counts were 495 / 353 versus 535 / 535. There is no response-body byte-parity, semantic model-output parity or memory-improvement claim. Every readiness sample was degraded. These are synthetic measurements on one host, not production or cross-platform guarantees.
The earlier adaptive comparison also improved responsiveness, but ran roughly three times as many auxiliary probes and had 14–23% longer combined completion with higher raw CPU. It remains retained rather than replaced by the fixed-round result. Historical Windows snapshot-owner measurements (
b405e7fversus85953cb) verified complete snapshot/prompt/consumer parity and 23–29% earlier callbacks, while using 21–33% more CPU and 14% more filesystem probes; same-key preparation was about 8% slower. Differing pre-window RSS prevents an attributable memory claim.Current head
5f7b24ace4ecc9e7e5d27609e3968d70b4723fd9is based on5a4be1f. All three commits remain patch-identical and all 53 async source states match measured ba0. Later canonical integrations are covered by current CI, not relabeled as the measured baseline.9c1b7b4dpreserves all 53 async states. Raw logs verify 131 selected requirement/watcher/snapshot cases, four lifetime cases and 14 upgrade fixture cases.Historical failed CI remains failed: the 859 lifetime timeout was reproduced locally; ba0 later failed a strict upgrade fixture after a main-origin argument change. Canonical #146508 and #146606 are included; no old failed CI was retried. Earlier invalid Gateway comparisons, degraded readiness, the unattributed ENOTEMPTY cleanup failure, the initial candidate build failure followed by successful ordinary recovery, and rejected-review scope limitations remain preserved in campaign/native evidence. None is relabeled as passing final-head proof.
Related: #145679