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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: blocked before merge. What this changesThe PR makes bundled MCP directory preparation asynchronous and awaits readiness in both CLI and Codex consumers. Example: Preparing the weather plugin directory takes 100 ms.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 3 items remain Keep this PR open: current main still blocks directory preparation synchronously, and the production repair preserves the existing ownership and failure behavior. Priority: P2 Decision needed
Before merge
Findings
Tests
Agent review detailsHow this fits togetherBundled plugin declarations enter the shared directory-preparation owner, which creates required directories and returns surviving MCP servers plus diagnostics to CLI and Codex configuration adapters. flowchart LR
A[Bundle declarations] --> B[Server selection]
B --> C[Directory preparation]
C --> D[Filesystem]
C --> E[CLI configuration]
C --> F[Codex configuration]
C --> G[Failure diagnostics]
Technical reviewBest possible solution: Keep the existing owner's async conversion and both awaits, retain the deferred-readiness regression, and separate the dependency benchmark from this focused repair. Do we have a high-confidence way to reproduce the issue? Current-main source directly shows blocking mkdirSync on the setup path, and the PR reports a parent-failing deferred-I/O regression; no target code was executed during this read-only review. Is this the best way to solve the issue? Converting the existing owner and awaiting both consumers is the smallest complete production fix, preserving directory ownership, server selection, and failure isolation. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f7d677435070. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource 0, Tests +26, Other +348. Total +374 across 7 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 1, 2026, 5:39 AM ET / 10:39 UTC. |
|
Merged via squash.
|
(cherry picked from commit 4ec943f) Release adaptation: retain the production owner and both await sites exactly; omit standalone performance measurement scripts. Extend the existing real MCP projection regression with delayed async filesystem I/O. Companions: 8cd7d87 only retires the allocation record; 0c1481f and 573fd8c only refactor omitted performance measurement scripts. Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Fixes Gateway event-loop stalls when bundled MCP setup prepares a plugin data directory on slow storage.
User Impact
Agent setup waits for directory creation without blocking other Gateway requests. A server whose directory cannot be prepared is still omitted with the existing diagnostic. Configuration and directory ownership are unchanged.
Why This Change Was Made
The directory owner called mkdirSync once per active bundled server; both CLI and Codex consumers were already asynchronous. The owner now awaits mkdir and both consumers await readiness before projecting server configuration. Production LOC delta is zero, with no cache, runtime setting, schema, dependency or version change.
The associated root-traversal investigation found that both fs-safe 0.27.0 and prepared 0.27.1 still perform synchronous component lookup inside Promise-returning APIs. The separate owner repair is openclaw/fs-safe#1054. This PR commits reproducible workloads for both repairs but does not adopt or publish the dependency. Synchronous identity fences and diagnostic flushes remain separate residuals; this is not a Gateway-wide zero-sync claim.
Evidence
The existing real MCP directory/projection test now injects delayed IO and verifies that an independent event-loop turn runs while configuration remains pending. It fails on parent e460144 and passes with the fix. Existing readiness and per-server failure diagnostics assertions remain. The justified regression adds 26 test lines with its own budget allocation record.
62 distinct focused tests passed across nine files. Two commands took 57.04 and 62.64 seconds including wrapper/compilation; the changed seven-test file completed in 2.46 seconds, with the delayed-IO test taking 5 ms on the fix. No touched module is imported by Control UI. Codex integration source was checked against codex-rs/core/src/config/mod.rs:2192–2225; downstream MCP configuration shape is unchanged.
Independent Codex autoreview of the final diff against the parent above was scoped-clean at P0–P2. The simplification pass retained only the owner conversion, both required awaits, the regression and reproducible owner benchmarks. pnpm check:changed completed all phases; its only failure was benchmark-script lint. Braces, the Promise executor and the timer-array annotation were corrected, and the exact failed lint command passed on rerun. All remaining phases were green, including typechecks and both dead-export scans. Exact-head CI run 41297289166 completed successfully at 93b6e88, including openclaw/ci-gate; security and dependency gates are green. No inherited-failure exception is used.
Five interleaved A1/B/A2 batches used an existing plugin directory alongside 62,000 synthetic 18,000-byte files (1.116 GB), with 1,000 preparations per timing batch. Allocation and 100 ms latency injection ran separately. Node 26.12.1, local APFS; host load is recorded. No production data, live Gateway or agent database was used: this owner does not read them. Acceptance is event-loop progress while filesystem IO remains pending, unchanged output/failure behavior, and an explicit decision on the measured warm cost.
This trades approximately 6 µs main CPU, 14 µs total CPU and 1.7 KB allocation per preparation for responsiveness under slow IO. These relative warm regressions exceed 20%; the lead explicitly accepted them before merge (see below). The benchmark is scripts/perf/bundle-mcp-mkdir-measure.mjs; root-owner comparison is scripts/perf/fs-safe-root-read-measure.mjs. Both retain A/A controls and report CPU/allocation separately from injected-latency passes.
Lead accepted
The lead explicitly accepted the measured tradeoff on 2026-11-01: with an injected 100 ms lookup, Root.read event-loop delay fell from 106.55 ms to 1.33 ms (2.29 ms maximum). The additional 18–33 µs main-thread CPU and approximately 8 KB sampled allocation per read are accepted for removing this class of blocking lookup. The associated MCP setup cost of approximately 6 µs main-thread CPU and 1.7 KB allocation per server is also accepted. Landing both source fixes is authorized; package publication and adoption remain separate.
Named follow-ups