Repository navigation
fix: avoid Gateway pauses during host discovery - #149792
Conversation
Read disk capacities in-process and reuse filesystem PATH lookup for binary, Tailscale, and Bash discovery to avoid forks from large Gateways. Keep mount visibility, partial results, and response deadlines in the disk sampler. Bound native work across timeouts and preserve executable lookup semantics and the existing GitHub credential launch boundary.
|
🦞👀 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: blocked before merge. Reviewed September 16, 2026, 2:26 AM ET / 06:26 UTC. ClawSweeper reviewWhat this changesThe PR replaces utility-process disk sampling and binary discovery with filesystem lookups while retaining disk filtering, cached snapshots, and discovery fallbacks. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 4 items remain This remains useful work that current main has not replaced, but the new synchronous PATH scans introduce an availability regression that prevents approval. Priority: P2 Review scores
Verification
How this fits togetherHost discovery supplies disk statistics to the Gateway Host card and locates executables for setup and Tailscale integration. Its filesystem and process operations run within the Gateway or CLI process. flowchart TD
A[Host information requests] --> B[Disk snapshot owner]
C[Mount table and filesystem statistics] --> B
B --> D[Gateway Host card]
E[Setup and Tailscale requests] --> F[Executable lookup owner]
G[PATH and filesystem entries] --> F
F --> H[Executable availability and selection]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +128, Tests +395, Docs 0. Total +523 across 12 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep filesystem-based discovery, but give asynchronous callers bounded nonblocking probes through the existing lookup owner, preserving lookup semantics and tracking native work through timeout. Do we have a high-confidence way to reproduce the issue? Yes, from source: put a blocked filesystem before the executable in PATH and invoke bare-name detection or uncached Tailscale discovery; statSync blocks the calling thread. This review did not execute that fault scenario. Is this the best way to solve the issue? Not yet: reusing filesystem lookup removes forks, but moving asynchronous discovery onto synchronous filesystem calls trades short fork pauses for potentially unbounded stalls. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c82292b17bb9. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Read disk capacities in-process and reuse filesystem PATH lookup for binary, Tailscale, and Bash discovery to avoid forks from large Gateways. Keep mount visibility, partial results, and response deadlines in the disk sampler. Bound native work across timeouts and preserve executable lookup semantics and the existing GitHub credential launch boundary.
Share existing config-path and retired-media traversal owners. Remove speculative rollback, retry, reentry, and diagnostic freshness machinery while preserving security effect checks, ordinary cleanup settlement, resource bounds, and public config, CLI, protocol, and persisted-data shapes. Phase E is untouched. Production delta: 335 net lines removed (+97/-432) across 16 old files. Focused proof: 311 tests in 25 files; final embedding/shutdown proof: 91 tests in 4 files. Independent scoped review found no actionable P0-P2 findings. Published as a branch only under the campaign's below-500 rule, not a PR. Best-effort tradeoffs accepted - Overlapping failed env publications may require reload/restart instead of ordered compensation; #105289/#103736 document synthetic harness proof, not a human actual-use report. - Failed in-process restart preparation/emission requires explicit config reapply or manual restart; #105289/#160375 describe synthetic timing, not a transient transport failure. - A mount changed during sampling may briefly be attributed to its parent filesystem until the next snapshot; #149792 uses forced mount fixtures, without a human incident. - CLI provider cleanup is attempted once; #113471's blocked-close fixtures do not establish a transient failed-close incident, and the CLI exits on cleanup failure. - Requested-head CI details are a snapshot until refresh; #148464's synthetic push/rerun interleavings do not justify rereading the head and check inventory after fetching jobs. - A malformed catalog resolver may repeat rejection until the existing 16-fallback bound instead of an earlier identity bailout; #92175/#89456 are synthetic trust-harness work, and every trust check remains. - Model normalizers must not reenter the same resolver; #156076's callback reentry is synthetic. Measured lookup caches and ordinary callback errors/order remain. - Offline plugin-state imports assume no unsupported same-destination writer after capacity preflight; #109679's ordinary near-capacity import remains fixed, while concurrent eviction compensation came from synthetic sibling seeding. - A delayed update verification reply may repeat a terminal broadcast or briefly show old status; #160592 supplies synthetic ordering proof, while durable effect idempotency, FIFO, repair authority, and shutdown joining remain. - A malformed reply from the fixed inline CA worker may fail instead of using a dedicated invalid-result fallback; #112338/#112336 do not report a human malformed-message incident. Timeout/error/exit handling remains. - Failed Gateway embedding cleanup blocks only its agent/provider scope until restart instead of retaining provider objects and retrying close; #113471 documents synthetic blocked-close proof, not a human failed-close incident. Local FIFO cleanup, remote concurrency, abort handling, authority, and normal shutdown settlement remain.
…#170826) * refactor: simplify older agent and channel execution paths Consolidate duplicate payload and metadata projections under their existing owners. Simplify internal bookkeeping and bounded cache invalidation while retaining public SDK contracts, security-effect authority, ordinary concurrency, and durable user state. * refactor: retain branch cache pending complete old-code cutover Withdraw the branch-cache cluster because completing its unused-export cleanup requires an infra owner touched this week. Preserve the original cache, regression assertions, and docs. The remaining old-code lane removes 424 net production lines and is branch-only under the campaign BELOW-500 rule. * refactor: simplify old gateway, config, and CLI bookkeeping Share existing config-path and retired-media traversal owners. Remove speculative rollback, retry, reentry, and diagnostic freshness machinery while preserving security effect checks, ordinary cleanup settlement, resource bounds, and public config, CLI, protocol, and persisted-data shapes. Phase E is untouched. Production delta: 335 net lines removed (+97/-432) across 16 old files. Focused proof: 311 tests in 25 files; final embedding/shutdown proof: 91 tests in 4 files. Independent scoped review found no actionable P0-P2 findings. Published as a branch only under the campaign's below-500 rule, not a PR. Best-effort tradeoffs accepted - Overlapping failed env publications may require reload/restart instead of ordered compensation; #105289/#103736 document synthetic harness proof, not a human actual-use report. - Failed in-process restart preparation/emission requires explicit config reapply or manual restart; #105289/#160375 describe synthetic timing, not a transient transport failure. - A mount changed during sampling may briefly be attributed to its parent filesystem until the next snapshot; #149792 uses forced mount fixtures, without a human incident. - CLI provider cleanup is attempted once; #113471's blocked-close fixtures do not establish a transient failed-close incident, and the CLI exits on cleanup failure. - Requested-head CI details are a snapshot until refresh; #148464's synthetic push/rerun interleavings do not justify rereading the head and check inventory after fetching jobs. - A malformed catalog resolver may repeat rejection until the existing 16-fallback bound instead of an earlier identity bailout; #92175/#89456 are synthetic trust-harness work, and every trust check remains. - Model normalizers must not reenter the same resolver; #156076's callback reentry is synthetic. Measured lookup caches and ordinary callback errors/order remain. - Offline plugin-state imports assume no unsupported same-destination writer after capacity preflight; #109679's ordinary near-capacity import remains fixed, while concurrent eviction compensation came from synthetic sibling seeding. - A delayed update verification reply may repeat a terminal broadcast or briefly show old status; #160592 supplies synthetic ordering proof, while durable effect idempotency, FIFO, repair authority, and shutdown joining remain. - A malformed reply from the fixed inline CA worker may fail instead of using a dedicated invalid-result fallback; #112338/#112336 do not report a human malformed-message incident. Timeout/error/exit handling remains. - Failed Gateway embedding cleanup blocks only its agent/provider scope until restart instead of retaining provider objects and retrying close; #113471 documents synthetic blocked-close proof, not a human failed-close incident. Local FIFO cleanup, remote concurrency, abort handling, authority, and normal shutdown settlement remain. * refactor: defer pricing cache cleanup touched on main Withdraw the usage-format production and paired test changes after main landed afc559c, keeping the hard seven-day old-code exclusion. Both files match the pre-campaign base, so main retains its interrupted-stream usage repair. The remaining reviewed o05/o06 union removes 713 net production lines across 42 files.
…openclaw#170826) * refactor: simplify older agent and channel execution paths Consolidate duplicate payload and metadata projections under their existing owners. Simplify internal bookkeeping and bounded cache invalidation while retaining public SDK contracts, security-effect authority, ordinary concurrency, and durable user state. * refactor: retain branch cache pending complete old-code cutover Withdraw the branch-cache cluster because completing its unused-export cleanup requires an infra owner touched this week. Preserve the original cache, regression assertions, and docs. The remaining old-code lane removes 424 net production lines and is branch-only under the campaign BELOW-500 rule. * refactor: simplify old gateway, config, and CLI bookkeeping Share existing config-path and retired-media traversal owners. Remove speculative rollback, retry, reentry, and diagnostic freshness machinery while preserving security effect checks, ordinary cleanup settlement, resource bounds, and public config, CLI, protocol, and persisted-data shapes. Phase E is untouched. Production delta: 335 net lines removed (+97/-432) across 16 old files. Focused proof: 311 tests in 25 files; final embedding/shutdown proof: 91 tests in 4 files. Independent scoped review found no actionable P0-P2 findings. Published as a branch only under the campaign's below-500 rule, not a PR. Best-effort tradeoffs accepted - Overlapping failed env publications may require reload/restart instead of ordered compensation; openclaw#105289/openclaw#103736 document synthetic harness proof, not a human actual-use report. - Failed in-process restart preparation/emission requires explicit config reapply or manual restart; openclaw#105289/openclaw#160375 describe synthetic timing, not a transient transport failure. - A mount changed during sampling may briefly be attributed to its parent filesystem until the next snapshot; openclaw#149792 uses forced mount fixtures, without a human incident. - CLI provider cleanup is attempted once; openclaw#113471's blocked-close fixtures do not establish a transient failed-close incident, and the CLI exits on cleanup failure. - Requested-head CI details are a snapshot until refresh; openclaw#148464's synthetic push/rerun interleavings do not justify rereading the head and check inventory after fetching jobs. - A malformed catalog resolver may repeat rejection until the existing 16-fallback bound instead of an earlier identity bailout; openclaw#92175/openclaw#89456 are synthetic trust-harness work, and every trust check remains. - Model normalizers must not reenter the same resolver; openclaw#156076's callback reentry is synthetic. Measured lookup caches and ordinary callback errors/order remain. - Offline plugin-state imports assume no unsupported same-destination writer after capacity preflight; openclaw#109679's ordinary near-capacity import remains fixed, while concurrent eviction compensation came from synthetic sibling seeding. - A delayed update verification reply may repeat a terminal broadcast or briefly show old status; openclaw#160592 supplies synthetic ordering proof, while durable effect idempotency, FIFO, repair authority, and shutdown joining remain. - A malformed reply from the fixed inline CA worker may fail instead of using a dedicated invalid-result fallback; openclaw#112338/openclaw#112336 do not report a human malformed-message incident. Timeout/error/exit handling remains. - Failed Gateway embedding cleanup blocks only its agent/provider scope until restart instead of retaining provider objects and retrying close; openclaw#113471 documents synthetic blocked-close proof, not a human failed-close incident. Local FIFO cleanup, remote concurrency, abort handling, authority, and normal shutdown settlement remain. * refactor: defer pricing cache cleanup touched on main Withdraw the usage-format production and paired test changes after main landed 7a00a9f, keeping the hard seven-day old-code exclusion. Both files match the pre-campaign base, so main retains its interrupted-stream usage repair. The remaining reviewed o05/o06 union removes 713 net production lines across 42 files.
What Problem This Solves
Large Linux Gateway processes incur avoidable main-thread pauses when disk and binary discovery fork utility processes.
User Impact
Host disk snapshots and covered binary checks avoid those forks while preserving their reported values and fallback behavior. No configuration or migration is required.
Why This Change Was Made
Disk capacity sampling uses
statfs, and binary discovery reuses the filesystem PATH resolver. The disk owner retains local-volume filtering, mount identity checks, partial results, and response deadlines. Native filesystem work runs serially and remains tracked after a timeout so refreshes cannot fill the shared I/O pool. If a native request stays blocked, disk discovery becomes unavailable after the normal cached response expires until that request settles.The PATH owner preserves POSIX symlink/parent traversal and existing Windows lookup semantics. Native macOS/Windows mount enumeration remains necessary. The GitHub launch wrapper still resolves credentials only inside the child, preserving its environment-only secret boundary.
Evidence
node scripts/check-changed.mjsandgit diff --checkpassed. Hosted CI is tracked against the exact PR head.The regression fixtures cover zero probe spawns,
dfbyte-value parity, realwhichcomparisons, disappearing and stacked mounts, Btrfs subvolumes, blocked filesystem requests, PATH changes, and Windows suffix lookup. The existing GitHub launcher/credential tests exercise Node and Bun with synthetic credentials.A native macOS check matched
dfcapacity for both sampled volumes and matched or bracketed available space while the filesystem changed. Linux filesystem edge cases and Windows lookup behavior have fixture coverage; no new production CPU profile or native Windows proof was collected.