Skip to content

perf(agents): keep file edits from blocking other chats - #158443

Merged
joshavant merged 14 commits into
mainfrom
perf/l14-file-tool-compute
Sep 26, 2026
Merged

joshavant merged 14 commits into
mainfrom
perf/l14-file-tool-compute

Conversation

@steipete

@steipete steipete commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes other chats becoming unresponsive while a built-in file tool plans a fuzzy edit or computes a large replacement diff.

User Impact

Edit and write tools keep their existing file contents, no-op behavior, preview output, and receipts while allowing the Gateway event loop to serve other clients during expensive computation. The first operation pays worker startup cost; subsequent operations reuse the worker pool.

Why This Change Was Made

Edit execution previously computed the same Myers diff twice for its numbered display and unified patch. Pure edit planning, fuzzy matching, and both receipt formats now share one prepared patch in the existing bounded WorkerTaskPool with shared compute admission. Write and preview consumers use the same computation owner. The canonical runtime-process registry resolves that worker for normal installations and sealed portable bundles; the bundle artifact list and build entries migrate together.

The file-tool caller retains the file mutation queue, filesystem access, persisted-byte verification, and recovery. It rechecks cancellation and current authority after planning and before mutation. Worker failure does not fall back to expensive synchronous execution. Write's existing byte, line, and edit-distance receipt limits remain intact. No Gateway protocol, configuration, database schema, dependency, or capability changes.

Evidence

Synthetic benchmark of the real edit/write definitions using injected in-memory filesystem operations, Node 26.9.0 on Apple M3 Ultra. Baseline and candidate alternate in one process for four measured operations per row after startup. Every operation verifies the persisted bytes and identical receipts. The measured baseline file-tool sources match the pre-change branch. A queued setImmediate witnesses event-loop availability; process CPU includes worker computation.

Tool Replaced lines Elapsed before → after Event-loop witness before → after Main-thread CPU before → after Process CPU before → after
edit 500 468.46 → 222.52 ms 468.52 → 0.69 ms 64.03 → 0.64 ms 72.79 → 47.92 ms
edit 1,000 1,259.75 → 1,673.36 ms 1,259.79 → 0.30 ms 210.24 → 0.55 ms 213.94 → 116.17 ms
edit 2,000 4,073.95 → 1,271.67 ms 4,074.11 → 0.26 ms 899.53 → 0.60 ms 911.00 → 522.21 ms
edit 5,000 13,098.65 → 7,074.71 ms 13,098.69 → 0.44 ms 6,929.78 → 1.11 ms 7,036.59 → 3,400.11 ms
write 500 242.78 → 108.22 ms 252.96 → 4.31 ms 29.23 → 0.66 ms 33.89 → 36.00 ms
write 1,000 822.43 → 799.97 ms 822.49 → 2.13 ms 109.84 → 0.62 ms 111.82 → 117.27 ms
write 2,000 426.76 → 603.24 ms 426.81 → 0.39 ms 220.63 → 0.70 ms 228.97 → 280.56 ms
write 5,000 263.33 → 281.33 ms 263.37 → 0.51 ms 221.59 → 0.84 ms 229.08 → 245.68 ms

The host was running a parallel development campaign, so elapsed time includes substantial scheduling noise. The 5,000-line edit nevertheless cuts measured process CPU from 7.04 s to 3.40 s, while leaving the event loop available in 0.44 ms. Write already shared its overwrite patch computation; its benefit here is moving CPU work off the caller, not lowering total CPU. The larger write cases still omit receipts at the existing edit-distance limit.

Separate source-mode process snapshots peaked at 449.5 MiB RSS before and 475.2 MiB after; these include source loaders and workers and are not retained-heap measurements. The first worker operation pays startup cost; subsequent operations reuse the existing pool's bounded admission, cancellation, and idle retirement.

Validation:

  • node scripts/run-vitest.mjs src/agents/sessions/tools/{edit.test.ts,edit-formatting.test.ts,edit-diff.test.ts,write.test.ts,file-tool-planning.test.ts,edit.legacy-input.test.ts} --maxWorkers=1: 134 tests passed, 687.40 s wall. Compiled subprocess fixture preparation consumed 450.61 s; most remaining time was transformation/import work.
  • Separate per-file cost runs with node scripts/run-vitest.mjs <file> --maxWorkers=1 also passed: edit.test.ts 84.06 s, write.test.ts 94.53 s, edit-formatting.test.ts 51.83 s. edit-diff.test.ts 10.85 s (24 tests).
  • New file-tool-planning.test.ts alone: 6 tests passed, 184.48 s wall with warmed compiler outputs. Tests defer the real planner result and verify active, revoked, and aborted authority before either mkdir or write, without timers or polling.
  • Independent patch application plus literal numbered-diff assertions protect receipt correctness; existing BOM/CRLF/Unicode, fuzzy no-op, recovery, and write-budget coverage passed. Preview tests now await their invalidation callback instead of polling.
  • Portable tooling tests before the final lint cleanup and main integration: 72 tests passed in the 1,114.14 s tooling shard, including actual write/fuzzy-edit calls from an extracted archive with no installed diff package and missing-planner-artifact rejection. Canonical compiled fixture preparation accounted for 443.17 s; the existing archive-build fixture is shared across its runtime cases. Gateway bundle/bootstrap and final planning/formatting siblings also passed; the complete six-file selection passed 145 tests in 1,642.04 s wall across three routed test groups. The sealed-build test file accounts for 202.13 s of Vitest file time: it must build and execute the relocated package to prove the worker is self-contained; pure planner tests cannot catch a missing deployed artifact.
  • Standalone packaging cost runs: bundle.test.ts passed in 289.00 s, bootstrap.test.ts in 269.19 s, and check-cli-bootstrap-imports.test.ts in 216.06 s. A later worker-deploy-build-plugin.test.ts run hit its existing 180 s beforeAll build timeout (437.49 s wall, 13 passed, 5 runtime cases skipped). Its earlier full-selection run passed all 18 cases; both packaging runs used the same pre-merge head. A bounded diagnosis built only the newly added worker using the canonical configuration: 0.70 s wall / 0.38 s CPU, 61,597 bytes, so that artifact does not explain the aggregate build timeout. The precise aggregate-fixture cause remains uncertain; no timeout or assertion was weakened and the earlier pass is not claimed as a fix.
  • Focused packaged bundle and smoke: passed edit/write worker resolution, receipts, and no-op behavior using repository workspace bundling and SQL-schema inlining. Initial scratch-bundle attempts omitted that packaging policy; those fixture errors were corrected. No full application build or live Gateway was run.
  • Before main integration, node scripts/check-changed.mjs: all selected guards, all typechecks, coercion/deprecation checks, and all three dead-export scans passed. The full invocation was operator-interrupted during lint after lengthy package-boundary preparation (4,984.36 s wall); it did not return zero. Resumed lint passed script and extension shards, then caught a redundant options-object spread (812.91 s wall); the copy was removed. After main integration, core lint ran 701.94 s and found three existing line-limit violations in files unchanged by this PR (src/gateway/server-kernel.test.ts, src/agents/embedded-agent-runner/run/attempt-session-replay.test.ts, and src/config/sessions/session-accessor.sqlite-entry-cache-publication.ts). It also found that our bootstrap assertions crossed that file's line limit; consolidating the repeated assertions preserves every explicit artifact-path check and removes ten lines. Focused type-aware lint for the corrected planner and bootstrap test passed (190.09 s wall); the affected npm-bootstrap contract passed with node scripts/run-vitest.mjs src/gateway/worker-environments/bootstrap.test.ts --maxWorkers=1 -t "installs only the exact npm package without transferring a tarball" (1 passed, 39 intentionally filtered; 670.05 s wall). Its shared compiler preparation took 433.41 s for 13,435 inputs and 17,010 outputs; the Vitest phase reported 98% transformation time. A supplemental post-merge write/planning/bootstrap selection was stopped after 720.04 s without test results; native sampling showed an idle event loop and a filesystem worker blocked inside rename. The precise cause is uncertain, and this interrupted run is not claimed as passing proof. Stylesheet lint passed (53.80 s wall); import-cycle checks passed with 0 runtime cycles (129.42 s wall). The final cleanup and registry conflict resolution pass formatting and diff whitespace checks.
  • Deslop completed. Fresh independent Codex autoreview at P0–P2 for the coordinator-reviewed head 9e8037adfc9ef2c5f2c82044568e7fad9f59bfb5: scoped-clean, no accepted/actionable findings.
  • LOC: production +323 / −268 = +55; build registration +3; tests +297 / −112 = +185; docs +10 / −1 = +9. Production growth is the typed bounded worker boundary, caller-side handoff, and portable-worker packaging after deleting duplicate synchronous computation. No unrelated deletion was used to offset it.

Landing validation: CI run 36210003889 failed at check-dependencies: Knip reported the new sealed worker entry as unused because it is built and launched by path. Commit c3f858ba5529dc5cbe6841b9e78112b52b3919c4 registers that exact entry alongside the existing deployed workers. Independent Codex autoreview of the correction at P0–P2 is scoped-clean; pnpm deadcode:full, formatting, and whitespace checks pass. No failed run was rerun to obtain green.

CI run 36211213334 then exposed the missing planner classification in tsdown-config.test.ts; one assertion expected .js for this deployed .mjs worker and fail-fast cancelled the remaining jobs. Commit 4fd6195dfa37e6132482ad5c6607a7de70839833 adds the planner to the existing worker table, dependency-bundling cases, and sealed-output assertions. pnpm test test/scripts/tsdown-config.test.ts --maxWorkers=1: 45 passed, 272.39 s wall, 215.95 s test time on the loaded local host. The two added bundled-dependency cases took 5.96 s and 7.20 s; this existing suite builds and executes relocated package artifacts, which a config-only assertion cannot prove. Targeted type-aware lint, formatting, whitespace, line-cap ratchet, and independent P0–P2 Codex autoreview pass. This head was superseded by the main-integration repair below.

The coordinator-approved runtime behavior retains explicit pre-mutation failure when worker planning is unavailable or shared admission is exhausted, including optional write-receipt planning; there is no expensive synchronous fallback. ClawSweeper called out this availability tradeoff. The new artifact participates in the existing content-hashed bundle and receipt checks; a live upgrade of an existing deployment was not performed.

CI run 36212490910 exposed an incoming-main regression from a99102804ebab7cc2e99687f7ca8ed34e576a9f1: the new fs-safe quota walker aborted a live rsync when a listed temporary file was renamed before stat. The captured CI test group reproduced the same error locally (64 files / 878 tests passed; the original large Git sync test failed). Main was merged, not rebased, and 586325fb03e8c6ffd2a633710a613bb15a17b106 tolerates missing paths only during periodic active-transfer scans; the final post-transfer quota scan stays strict, and other scan errors still abort and join the transfer.

The deterministic real-rename regression fails on the pre-fix code and passes afterward. pnpm test src/gateway/worker-environments/workspace-sync.test.ts --maxWorkers=1: 13 passed, 48.58 s wall (about 0.2 s test time, with compiled fixture preparation dominating). Replaying the captured original CI group after the repair passed 879 Node tests across 65 files (321.37 s wall) and 124 Bun tests across 16 files (21.80 s wall). Bun printed a non-fatal directory-mismatch diagnostic while returning success. Targeted lint, formatting, whitespace checks, and fresh independent P0–P2 review of the complete candidate pass. Hosted CI will gate this new head.

CI run 36214983604 exposed the remaining schema-inlining assertion omission in tsdown-runtime-config.test.ts. Commit 23c6a99e873c88f1b103ec662352cee076102c1c registers the planner in the existing executable graph set without changing its assertions. The full file passes 32 tests, 59.81 s wall, 0.261 s test time; compiler/fixture preparation dominates. Targeted lint, formatting, whitespace, and independent P0–P2 review pass. Both sibling tsdown graph-classification tests now account for the planner. Superseded by the fixture repair below.

CI run 36216017676 hit Linux spawn ETXTBSY before a copied PR-tooling fixture could launch. Commit a5bd2fffda54688ae678fc341d4ea9f62c59cc75 launches that copied shell entry through the fixture Bash binary and holds a writable descriptor across spawn as a deterministic regression condition. It preserves all freshness, artifact, and lock assertions without retrying. Blacksmith Testbox tbx_01m3dzvrndnn6k7c566zq1rqtj (run) verified the old direct-exec path fails with ETXTBSY, then passed the full 146-test file in 56.53 s wall using pnpm test test/scripts/pr-operation-lock.test.ts --maxWorkers=1. This existing process-lifecycle suite exercises real Git/process/lock ownership; no new test case or process boot was added. The lease stopped successfully; the wrapper returned zero despite a portal-sync timeout warning. An earlier Testbox attempt stopped before tests because the proof command incorrectly compared its carrier commit with the local head; that command precondition was corrected. Formatting, lint, whitespace, and independent P0–P2 review pass. Hosted exact-head CI reached the unrelated main blocker below.

Resolved incoming-main blocker (historical): exact-head CI 36218454003, job 108339678398, failed test/scripts/lint-suppressions.test.ts because incoming main contains src/gateway/server-chat-progress-snapshot.ts|no-implicit-coercion|1, absent from the approved suppression list. Introducing main commit: 2f2ec46dd56c1a3d115bae63c52bd84dcc8b6f79 (#158572); the same failure is independently recorded in #158641. The unary-plus operation deliberately preserves native JSON rejection of custom BigInt coercion, so replacing it with Number() would change behavior. No owning fix or explicit baseline-exception approval was found. No allowlist expansion, gate bypass, or rerun was performed. Native preparation and merge have not started.

The suppression blocker is now resolved on main by 20f3170d3672de0d491c5bb9cf9bf7e22e9658a7 and 66b812f26e725cd709e08860d2cb46ba496cd308: Reflect.apply(Math.max, undefined, [value]) preserves native ToNumber behavior without a suppression. Adding the proposed exact baseline entry now demonstrably fails (77 actual vs 78 expected); unchanged main passes all four guard tests, so no exception change or redundant PR was retained. Merge commit 85446077f9f42ada7650beb353f968e9fcf3456d incorporates main without rebasing. The merged candidate passes 23 tests across suppression, workspace-transfer, and file-planning selections (280.47 s wall, compiled fixture preparation dominates). Fresh independent P0–P2 candidate review is clean. Superseded by the following main-fixture integration.

CI 36227460292, job 108364742434, hit the same archive/Undo fixture race as main CI 36227000289: the fixture used a synchronous reset while asynchronous database resources were still closing. The unchanged local 22-file replay passed, so it is not claimed as a fix. The exact async-drain correction proposed in #158655 passed the captured 273-test group; before a duplicate could be published, main landed the canonical scoped correction as 6c7544adc9826fa637425a2fa967389e0507a800. Merge ffb9401f43a4352fc7a0c873a506d195b0667fd5 incorporates it. The canonical archive fixture passes both cases in the merged candidate (313.36 s wall, compiled preparation and fixture startup dominate). Fresh independent P0–P2 review and whitespace checks pass; no duplicate fixture repair is retained. The final observed CI result is recorded below.

Final outcome: merged at 0042f8a570d48f01e7f4f667e3e4833caa68d80a on 2026-09-26T08:55:55Z from head ffb9401f43a4352fc7a0c873a506d195b0667fd5. Fetching current main and git merge-base --is-ancestor both returned zero. The merge occurred concurrently while this landing task investigated CI 36230265207, job 108372555642: its remaining failure was the incoming-main fs-safe import boundary for three Codex plugin files, introduced by #158613 and also observed in #158598 and #158441. That CI run is not claimed green. No filesystem-boundary exception or further source repair was made by this task.

@clawsweeper

clawsweeper Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: L labels Sep 25, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 26, 2026
@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 26, 2026, 3:47 AM ET / 07:47 UTC (Revision 7).

ClawSweeper review

What this changes

Moves built-in file edit and write planning to a bundled compute worker and adjusts active workspace quota scans to tolerate temporary file renames.

Merge readiness

⛔ Blocked before merge - 8 items remain

The performance fix remains useful because current main still computes file diffs on the caller thread. Two previously reported correctness findings remain on this head, so the PR is not ready to merge.

Priority: P2
Reviewed head: 85446077f9f42ada7650beb353f968e9fcf3456d
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Direct tool measurements and portable-package proof are strong, but the two carried-forward correctness findings limit merge confidence.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The PR body reports before/after event-loop measurements through the built-in edit/write definitions and actual after-fix file calls from an extracted portable bundle, exercising the new planning worker and its package entrypoint. It also reports authority checks before file effects. A published-updater upgrade remains separate merge-risk work; no stored-data contract changes.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body reports before/after event-loop measurements through the built-in edit/write definitions and actual after-fix file calls from an extracted portable bundle, exercising the new planning worker and its package entrypoint. It also reports authority checks before file effects. A published-updater upgrade remains separate merge-risk work; no stored-data contract changes.
Evidence reviewed 11 items Current main still uses caller-thread diff computation: The current-main write tool calculates bounded diff receipts directly, and its tree has no file-tool planning worker module.
Write now depends on receipt planning: For content within the byte limit, the write awaits the planning worker before mkdir or writeFile; worker admission or startup failure therefore prevents the file mutation.
Previous receipt-free write behavior: The current-main implementation returns changed-file details without a patch when bounded overwrite receipt computation cannot produce one.
Findings 2 actionable findings [P1] Preserve writes when optional receipt planning fails
[P2] Complete quota scans after temporary renames
Security Needs attention Active transfer can outlast an incomplete quota check: The new missing-path catch discards a partially completed quota scan. Repeated temporary renames can postpone detection of another over-limit entry while the inbound transfer continues; the strict final scan runs only after transfer completion.

How this fits together

Agent file tools receive requested edits or complete file contents, then plan, write, and verify the result. The Gateway separately scans inbound worker workspace transfers against size and entry limits before accepting them.

flowchart LR
  A[Agent file request] --> B[File mutation queue]
  B --> C[Planning worker]
  C --> D[Current authority check]
  D --> E[File write and verification]
  F[Inbound workspace transfer] --> G[Quota scan]
  G --> H[Accept or abort transfer]
Loading

Decision needed

Question Recommendation
May an otherwise valid small file write fail before mutation solely because optional diff-receipt planning cannot start or shared worker admission is full? Preserve valid writes: Continue the authorized write without a diff receipt when only receipt planning is unavailable, while still rejecting aborts and revoked authority.

Why: The branch intentionally changes an existing write outcome, and the PR body's acceptance claim is not independently confirmed in the discussion.

Before merge

  • Preserve writes when optional receipt planning fails (P1) - This new await runs before mkdir and writeFile even when the worker can produce no receipt. If startup or shared admission fails, a valid write now rejects where the prior path could return receipt-free details. Preserve abort and revoked-authority rejection while allowing a receipt-only failure to continue, unless a maintainer explicitly accepts the changed write contract.
  • Complete quota scans after temporary renames (P2) - This catch drops the whole active scan after a vanished temporary path. If a separate over-limit entry would be visited later, the transfer keeps running; repeated renames can keep defeating active enforcement. Complete a bounded scan after the race and cover a rename and over-limit entry together.
  • Resolve security concern: Active transfer can outlast an incomplete quota check - The new missing-path catch discards a partially completed quota scan. Repeated temporary renames can postpone detection of another over-limit entry while the inbound transfer continues; the strict final scan runs only after transfer completion.
  • Resolve merge risk (P1) - Existing small file writes can now fail before mutation when optional receipt planning cannot start or shared worker admission is exhausted; independent maintainer acceptance of this compatibility change is not recorded.
  • Resolve merge risk (P1) - A temporary rename can end an active quota scan before it reaches a separate over-limit entry, allowing the inbound transfer to continue until a later scan or completion.
  • Resolve merge risk (P1) - The new planner artifact is required by installed file tools, but a published updater installing this candidate into an existing deployment has not been demonstrated.
  • Complete next step (P2) - Resolve both carried-forward findings and the write-outcome decision, then demonstrate that a published-updater installation acquires the planner artifact.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.

Findings

  • [P1] Preserve writes when optional receipt planning fails — src/agents/sessions/tools/write.ts:344-347
  • [P2] Complete quota scans after temporary renames — src/gateway/worker-environments/workspace-sync-helpers.ts:439-443
  • [medium] Active transfer can outlast an incomplete quota check — src/gateway/worker-environments/workspace-sync-helpers.ts:439
Agent review details

Security

Needs attention: The patch adds no dependency or secret access, but its active-transfer rename handling can defer quota enforcement.

PR surface

Source +61, Tests +278, Docs +9, Other +4. Total +352 across 27 files.

View PR surface stats
Area Files Added Removed Net
Source 11 329 268 +61
Tests 13 405 127 +278
Docs 1 10 1 +9
Config 0 0 0 0
Generated 0 0 0 0
Other 2 4 0 +4
Total 27 748 396 +352

Review metrics

Metric Value Why it matters
Required runtime artifact 1 new planning worker Existing installations must acquire this artifact for bounded file edit and write planning.
Net production and test growth production +61, tests +278 lines The PR attributes production growth to the bounded worker handoff and portable packaging.

Merge-risk options

Maintainer options:

  1. Preserve writes and complete quota scans (recommended)
    Keep valid writes independent of optional receipt failures, complete bounded active quota checks after rename races, and prove the installed upgrade acquires the planner.
  2. Accept planner-dependent writes
    A maintainer may explicitly accept the changed write outcome, while still requiring the quota-scan repair and installed-upgrade proof.

Technical review

Best possible solution:

Keep file computation off the Gateway thread while preserving existing write outcomes, enforcing transfer limits throughout active sync, and confirming that upgrades acquire the worker.

Do we have a high-confidence way to reproduce the issue?

Yes. Current main performs edit and write diff computation on the caller thread, and the PR reports before/after measurements through the built-in tool definitions; this read-only review did not run a Gateway.

Is this the best way to solve the issue?

No, as submitted. The existing worker pool is an appropriate compute boundary, but optional receipt failure should not change the write outcome without an explicit maintainer choice, and active quota checks must remain complete.

Full review comments:

  • [P1] Preserve writes when optional receipt planning fails — src/agents/sessions/tools/write.ts:344-347
    This new await runs before mkdir and writeFile even when the worker can produce no receipt. If startup or shared admission fails, a valid write now rejects where the prior path could return receipt-free details. Preserve abort and revoked-authority rejection while allowing a receipt-only failure to continue, unless a maintainer explicitly accepts the changed write contract.
    Confidence: 0.93
  • [P2] Complete quota scans after temporary renames — src/gateway/worker-environments/workspace-sync-helpers.ts:439-443
    This catch drops the whole active scan after a vanished temporary path. If a separate over-limit entry would be visited later, the transfer keeps running; repeated renames can keep defeating active enforcement. Complete a bounded scan after the race and cover a rename and over-limit entry together.
    Confidence: 0.86

Overall correctness: patch is incorrect
Overall confidence: 0.89

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 67adcce7e304.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The event-loop stall affects concurrent chats, but the supplied evidence is a bounded synthetic workload rather than a demonstrated widespread outage.
  • merge-risk: 🚨 compatibility: A valid small write now depends on optional receipt-worker availability, and existing installations need a new artifact.
  • merge-risk: 🚨 security-boundary: Discarding an incomplete active quota scan can defer enforcement of the inbound worker transfer limit.
  • merge-risk: 🚨 availability: Worker startup or shared admission failure can stop file-tool operations that previously proceeded.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (terminal): The PR body reports before/after event-loop measurements through the built-in edit/write definitions and actual after-fix file calls from an extracted portable bundle, exercising the new planning worker and its package entrypoint. It also reports authority checks before file effects. A published-updater upgrade remains separate merge-risk work; no stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body reports before/after event-loop measurements through the built-in edit/write definitions and actual after-fix file calls from an extracted portable bundle, exercising the new planning worker and its package entrypoint. It also reports authority checks before file effects. A published-updater upgrade remains separate merge-risk work; no stored-data contract changes.

Evidence

Security concerns:

  • [medium] Active transfer can outlast an incomplete quota check — src/gateway/worker-environments/workspace-sync-helpers.ts:439
    The new missing-path catch discards a partially completed quota scan. Repeated temporary renames can postpone detection of another over-limit entry while the inbound transfer continues; the strict final scan runs only after transfer completion.
    Confidence: 0.82

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • PollyBot13: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Preserve valid writes on receipt-only worker failures or obtain an independent maintainer decision accepting the changed outcome.
  • Prove an active over-limit transfer aborts despite a concurrent temporary rename.
  • Show an existing installation acquiring the planner through the published updater.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (6 earlier review cycles)
  • reviewed 2026-09-26T00:30:23.265Z sha 74723e4 :: blocked before merge. :: [P1] Preserve writes when optional receipt planning fails
  • reviewed 2026-09-26T02:09:35.413Z sha 9e8037a :: blocked before merge. :: [P1] Preserve writes when optional receipt planning fails
  • reviewed 2026-09-26T02:49:09.077Z sha 4fd6195 :: blocked before merge. :: [P1] Preserve writes when optional receipt planning fails
  • reviewed 2026-09-26T03:59:20.330Z sha 23c6a99 :: blocked before merge. :: [P1] Preserve writes when optional receipt planning fails | [P2] Complete quota scans after temporary renames
  • reviewed 2026-09-26T04:48:17.223Z sha a5bd2ff :: blocked before merge. :: [P1] Preserve writes when optional receipt planning fails | [P2] Complete quota scans after temporary renames
  • reviewed 2026-09-26T05:11:14.553Z sha a5bd2ff :: blocked before merge. :: [P1] Preserve writes when optional receipt planning fails | [P2] Complete quota scans after temporary renames

@steipete
steipete marked this pull request as ready for review September 26, 2026 01:55
Exact-head CI reported the sealed worker entry as unused because it is built and launched by path. Register it alongside the existing deployed workers without excluding it from dependency or export analysis.
The package-output contract treated the newly registered sealed worker as a normal .js package entry. Include it in the existing worker cases and bundled-dependency assertions. All 45 tsdown configuration tests pass in 272.39 seconds wall time; focused lint and independent review pass.
Merge current main and repair the filesystem-walk integration exposed by hosted CI. Ignore vanished paths only during active transfer scans; keep the final quota scan strict and preserve abort-and-join for other scan failures. The original CI group reproduced the ENOENT before this repair and passes afterward (879 Node and 124 Bun tests). A deterministic real-rename regression fails before the fix and all 13 focused tests pass afterward. Independent P0-P2 candidate review is clean.
Register the file planning worker in the existing executable graph assertion. All 32 runtime-config tests pass (59.81 seconds wall, 0.261 seconds test time); targeted lint and independent review are clean.
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. label Sep 26, 2026
Launch the copied PR wrapper through the fixture Bash binary. Hold a writable descriptor across spawn to deterministically exercise Linux ETXTBSY without retries. The old direct-exec variant fails with ETXTBSY; all 146 operation-lock tests pass after the fix on Linux Testbox in 56.53 seconds wall time. Lint and independent P0-P2 review pass.
Incorporate the existing main fixes 20f3170 and 66b812f, which remove the suppression while preserving native JSON ToNumber semantics. Adding the proposed baseline entry now fails the guard, so no exception change is retained. The suppression, workspace-transfer, and file-planning selections pass all 23 tests; fresh candidate review is clean.
Incorporate canonical main fix 6c7544a for the closing-database archive fixture failure seen on main and PR CI. The source repair awaits database resource drainage before resetting and reopening the fixture. The canonical focused two-test file passes in 313.36 seconds wall time; the equivalent repair passed the captured 273-test group. Fresh candidate review is clean.
@joshavant
joshavant merged commit 0042f8a into main Sep 26, 2026
218 of 240 checks passed
@joshavant
joshavant deleted the perf/l14-file-tool-compute branch September 26, 2026 08:55
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 27, 2026
)

* perf(agents): keep file-tool computation off the main thread

* test(agents): check complete file plans and patch receipts

* fix(agents): package file planning for portable workers

* refactor(agents): avoid redundant diff options copy

* test(workers): consolidate portable artifact assertions

* test(workers): distinguish artifact paths from install input

* fix(ci): register deployed file planning worker for Knip

Exact-head CI reported the sealed worker entry as unused because it is built and launched by path. Register it alongside the existing deployed workers without excluding it from dependency or export analysis.

* test(build): classify deployed file planner as a worker

The package-output contract treated the newly registered sealed worker as a normal .js package entry. Include it in the existing worker cases and bundled-dependency assertions. All 45 tsdown configuration tests pass in 272.39 seconds wall time; focused lint and independent review pass.

* test(build): cover planner worker schema inlining

Register the file planning worker in the existing executable graph assertion. All 32 runtime-config tests pass (59.81 seconds wall, 0.261 seconds test time); targeted lint and independent review are clean.

* test(pr): avoid executing a writable fixture inode

Launch the copied PR wrapper through the fixture Bash binary. Hold a writable descriptor across spawn to deterministically exercise Linux ETXTBSY without retries. The old direct-exec variant fails with ETXTBSY; all 146 operation-lock tests pass after the fix on Linux Testbox in 56.53 seconds wall time. Lint and independent P0-P2 review pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants