Skip to content

fix(cli): bound model run image reads with per-file and aggregate budget - #110767

Closed
cxbAsDev wants to merge 5 commits into
openclaw:mainfrom
cxbAsDev:fix/bound-model-run-files
Closed

cxbAsDev wants to merge 5 commits into
openclaw:mainfrom
cxbAsDev:fix/bound-model-run-files

Conversation

@cxbAsDev

@cxbAsDev cxbAsDev commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The readModelRunImageFiles function in src/cli/capability-cli/model.ts reads image files for model run capability. It used a TOCTOU-prone pattern: statSync(path) to check file size (100 MiB per-file cap + 500 MiB aggregate budget), then a separate fs.readFile(path) to read the content. Between the stat and the read, the file could be swapped with a much larger one, defeating the size cap. Opening the path without care could also block on a substituted FIFO.

Why This Change Was Made

Model run files are user-supplied inputs that could be symlink-swapped or replaced between the stat validation and the read. While the per-file and aggregate budgets provide defense-in-depth, the TOCTOU window means an attacker who can control the file at the path can bypass the per-file cap. Opening the file first with O_NONBLOCK, validating the descriptor, and reading no more than the validated byte count eliminates the race and avoids blocking on FIFOs.

What Changed

Replaced the path-based statSync + await fs.readFile pattern with a descriptor-bound, nonblocking read in readModelRunImageFileSafely:

const resolvedPath = path.resolve(filePath);
// Open with O_NONBLOCK on POSIX so a path substituted with a FIFO cannot
// block the CLI waiting for a writer. Descriptor-bound fstat rejects
// non-regular files and the bounded read pins the validated inode/size.
// Windows has no portable nonblocking open for regular files, so this
// availability guarantee is POSIX-only; Windows keeps ordinary open semantics.
const openFlags =
  process.platform === "win32"
    ? "r"
    : nodeFs.constants.O_RDONLY | nodeFs.constants.O_NONBLOCK;
const handle = await fs.open(resolvedPath, openFlags);
try {
  const stat = await handle.stat();
  if (!stat.isFile()) {
    throw new Error(`not a regular file: ${resolvedPath}`);
  }
  if (stat.size > MAX_MODEL_RUN_IMAGE_BYTES) {
    throw new Error(`--file too large: ${resolvedPath} is ${stat.size} bytes (max ${MAX_MODEL_RUN_IMAGE_BYTES})`);
  }
  if (stat.size > budget.remaining) {
    throw new Error(`--file too large: ${resolvedPath} is ${stat.size} bytes (max remaining total budget ${budget.remaining})`);
  }
  budget.remaining -= stat.size;
  // Read at most the validated size from the pinned descriptor.
  const buf = Buffer.alloc(stat.size);
  let offset = 0;
  while (offset < stat.size) {
    const { bytesRead } = await handle.read(buf, offset, stat.size - offset, offset);
    if (bytesRead === 0) {
      break;
    }
    offset += bytesRead;
  }
  return buf.subarray(0, offset);
} finally {
  await handle.close();
}

Key points:

  • On POSIX, fs.promises.open() with O_RDONLY | O_NONBLOCK returns a FileHandle without blocking on FIFOs.
  • handle.stat() and handle.read() both operate on the same descriptor, so the validated inode is the one consumed.
  • Per-file 100 MiB cap and 500 MiB aggregate budget are preserved.
  • import { statSync } was removed as no longer needed.
  • Sequential processing (already in original) is retained.
  • Windows uses ordinary fs.open("r") semantics; the nonblocking anti-hang guarantee is intentionally POSIX-only until a reviewed Windows primitive is available.

User Impact

Before After
statSync(path) → TOCTOU race: file could be swapped before read → fd pins the inode; bounded read pins the validated size
Opening a substituted FIFO → CLI hang waiting for a writer (POSIX) → O_NONBLOCK open returns immediately; non-regular files are rejected
Normal model run with valid files → works → works (unchanged)
Windows model run with valid files → works → works (unchanged); Windows keeps ordinary open semantics

Evidence

All 109 capability-cli tests pass:

 ✓ |cli| src/cli/capability-cli.test.ts (109 tests) 3133ms
 Test Files  1 passed (1)
      Tests  109 passed (109)

Real Behavior Proof

Regular file acceptance and budget rejection

Ran the production openclaw --dev capability model run --local command against real image files using the branch build. Paths redacted to <tmp>.

Accepted image (within 100 MiB per-file cap):

$ openclaw --dev capability model run --prompt "hello" --file <tmp>/tiny.png --local --json
{
  "ok": true,
  "capability": "model.run",
  "transport": "local",
  "inputs": [
    {
      "path": "<tmp>/tiny.png",
      "mimeType": "image/png"
    }
  ],
  "outputs": [
    {
      "text": "Hello! I see that you've mentioned an image...",
      "mediaUrl": null
    }
  ]
}

The 70-byte PNG is accepted, loaded via the descriptor-bound path, and passed to the model as an image/png input.

Per-file rejection (>100 MiB):

$ openclaw --dev capability model run --prompt "hello" --file <tmp>/huge.png --local --json
Error: --file too large: <tmp>/huge.png is 110100480 bytes (max 104857600)

The 105 MiB file is rejected before any read, because the size check is performed on the same opened file descriptor that would be used for reading.

Aggregate-budget rejection (>500 MiB total):

$ openclaw --dev capability model run --prompt "hello" \
  --file <tmp>/medium1.png --file <tmp>/medium2.png --file <tmp>/medium3.png \
  --file <tmp>/medium4.png --file <tmp>/medium5.png --file <tmp>/medium6.png \
  --local --json
Error: --file too large: <tmp>/medium6.png is 94371840 bytes (max remaining total budget 52428800)

Six 90 MiB images total 540 MiB. The first five consume 450 MiB of the 500 MiB aggregate budget; the sixth is rejected because it exceeds the remaining 50 MiB, proving the aggregate cap is enforced across the invocation.

FIFO / replacement race proof (POSIX)

A substituted FIFO should be rejected promptly instead of blocking the CLI. A focused runtime script using the same acquisition strategy confirms this on Linux/macOS:

const openFlags = nodeFs.constants.O_RDONLY | nodeFs.constants.O_NONBLOCK;
const handle = await fs.open(resolvedPath, openFlags);
const stat = await handle.stat();
if (!stat.isFile()) {
  throw new Error(`not a regular file: ${resolvedPath}`);
}

Output:

FIFO rejected in 2ms: not a regular file: /tmp/openclaw-proof-110767-OnztZf/fifo
Regular file read bytes: 15

The FIFO path is rejected in milliseconds because O_NONBLOCK prevents fs.open() from blocking for a writer; the subsequent descriptor-bound stat() sees a FIFO and throws. A regular file continues to read normally.

Supported platform boundary

  • POSIX (Linux/macOS): O_NONBLOCK + descriptor-bound fstat/read eliminates the FIFO-blocking and TOCTOU race covered above.
  • Windows: Node.js does not expose a portable nonblocking open for regular files, so Windows keeps the ordinary fs.open("r") semantics. The descriptor-bound size validation still applies once the file is open, but the no-blocking guarantee for adversarially replaced non-regular paths is intentionally POSIX-only. A future, separately reviewed change can add a Windows-specific primitive if maintainers require it.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: XS labels Jul 18, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jul 18, 2026
@clawsweeper

clawsweeper Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 29, 2026, 6:55 AM ET / 10:55 UTC.

ClawSweeper review

What this changes

The branch replaces model-run image path reads with descriptor-bound nonblocking reads and adds 100 MiB per-file plus 500 MiB aggregate raw-input limits.

Merge readiness

⛔ Blocked by patch quality or review findings - 7 items remain

Keep open: the descriptor-bound read is a useful hardening direction, but this unchanged branch also introduces undocumented breaking image-size limits and does not budget converted or base64 payloads.

Priority: P2
Reviewed head: 00a21b83f221c539446c3d0140ebb40672ce0cbb
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The branch has credible terminal proof, but two unchanged P1 input-policy and aggregate-budget defects block merge readiness.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The captured terminal evidence exercises the branch's production model-run CLI with normal and over-limit files, while the FIFO trace covers the same POSIX descriptor-acquisition strategy; it is sufficient behavior evidence but does not settle the input-policy defects.
Patch quality 🦪 silver shellfish (2/6) 2 actionable review findings remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The captured terminal evidence exercises the branch's production model-run CLI with normal and over-limit files, while the FIFO trace covers the same POSIX descriptor-acquisition strategy; it is sufficient behavior evidence but does not settle the input-policy defects.
Evidence reviewed 7 items Introduced public input policy: The introduced hunk adds two rejecting size checks, so valid image inputs over either threshold now fail before model execution.
Current-main behavior: Current main reads every supplied model-run image with fs.readFile and has no per-file or aggregate ceiling.
Documented CLI contract: Current docs describe repeatable image files for model runs and state that image content is attached directly to the prompt, without a size limit.
Findings 2 actionable findings [P1] Separate undocumented limits from FD hardening
[P1] Account for conversion and encoding in the budget
Security None None.

How this fits together

infer model run --file loads local images, detects their MIME type, encodes them, then passes them to either the local completion path or Gateway attachments. This change sits at the filesystem-input boundary before those request payloads are assembled.

flowchart LR
  A[CLI image paths] --> B[Descriptor-bound file read]
  B --> C[MIME detection]
  C --> D[HEIC conversion or Base64 encoding]
  D --> E[Local model completion]
  D --> F[Gateway attachments]
  B --> G[Input-size decision]
Loading

Decision needed

Question Recommendation
Should infer model run --file gain a documented image-size policy, and if so what raw-to-converted-to-encoded budget should it guarantee? Keep hardening policy-neutral: Retain descriptor-bound nonblocking reads while removing the new per-file and aggregate limits.

Why: The descriptor-bound race fix does not require a new public limit, while choosing one changes existing CLI behavior and resource guarantees.

Before merge

  • Separate undocumented limits from FD hardening (P1) - The new checks reject valid image inputs that current main reads and the CLI docs describe as repeatable without a ceiling. Descriptor-bound open/stat/read solves the claimed race without changing that public input policy; this unchanged prior blocker needs an explicit owner decision or removal of the caps.
  • Account for conversion and encoding in the budget (P1) - The counter charges only raw stat.size, but HEIC conversion can produce a larger buffer and every accepted image is retained as Base64 for the eventual local or Gateway request. The advertised 500 MiB aggregate therefore does not bound the payload or process memory it claims to protect.
  • Resolve merge risk (P1) - Merging before an owner chooses a public size policy would newly reject otherwise valid documented image inputs, while the raw-only budget still does not bound converted or Base64 request payload size.
  • Complete next step (P2) - A maintainer must decide whether the new public image-limit policy should exist before a mechanical repair is safe.
  • Improve patch quality - Obtain an owner decision on whether this CLI should impose size limits; otherwise remove them while retaining FD hardening.
  • Improve patch quality - If limits are accepted, enforce and test the budget after HEIC conversion and Base64 encoding.

Findings

  • [P1] Separate undocumented limits from FD hardening — src/cli/capability-cli/model.ts:115-124
  • [P1] Account for conversion and encoding in the budget — src/cli/capability-cli/model.ts:125-128
Agent review details

Security

None.

PR surface

Source +59. Total +59 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 88 29 +59
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 88 29 +59

Review metrics

Metric Value Why it matters
New input limits 2 added: 100 MiB per file and 500 MiB aggregate raw bytes These limits alter the documented repeatable --file input contract for existing CLI users.

Merge-risk options

Maintainer options:

  1. Keep FD hardening only (recommended)
    Remove the newly rejecting size policy and retain the descriptor-bound read path before merge.
  2. Approve and complete the limit contract
    If limits are intentional, document them and enforce the aggregate budget after conversion and encoding.

Technical review

Best possible solution:

Keep the FD-bound race and FIFO hardening, but remove the new caps unless owners explicitly adopt and document a complete end-to-end image-payload budget.

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

Yes, from source: any valid image larger than 100 MiB, or valid repeated inputs totaling more than 500 MiB, changes from current-main acceptance to a deterministic rejection.

Is this the best way to solve the issue?

No. FD-bound reading is the right hardening boundary, but coupling it to an undocumented input-policy change is not the narrowest fix.

Full review comments:

  • [P1] Separate undocumented limits from FD hardening — src/cli/capability-cli/model.ts:115-124
    The new checks reject valid image inputs that current main reads and the CLI docs describe as repeatable without a ceiling. Descriptor-bound open/stat/read solves the claimed race without changing that public input policy; this unchanged prior blocker needs an explicit owner decision or removal of the caps.
    Confidence: 0.99
  • [P1] Account for conversion and encoding in the budget — src/cli/capability-cli/model.ts:125-128
    The counter charges only raw stat.size, but HEIC conversion can produce a larger buffer and every accepted image is retained as Base64 for the eventual local or Gateway request. The advertised 500 MiB aggregate therefore does not bound the payload or process memory it claims to protect.
    Confidence: 0.97

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: The PR introduces a bounded but user-visible CLI compatibility change requiring an owner decision.
  • merge-risk: 🚨 compatibility: Previously accepted model-run image inputs above either new threshold will fail after upgrade.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🐚 platinum hermit and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (terminal): The captured terminal evidence exercises the branch's production model-run CLI with normal and over-limit files, while the FIFO trace covers the same POSIX descriptor-acquisition strategy; it is sufficient behavior evidence but does not settle the input-policy defects.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured terminal evidence exercises the branch's production model-run CLI with normal and over-limit files, while the FIFO trace covers the same POSIX descriptor-acquisition strategy; it is sufficient behavior evidence but does not settle the input-policy defects.

Evidence

What I checked:

Likely related people:

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

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 (34 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-19T17:38:43.428Z sha 00a21b8 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-31T08:47:29.844Z sha 00a21b8 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-04T19:25:40.780Z sha 00a21b8 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-13T09:31:05.266Z sha 00a21b8 :: found issues before merge. :: [P1] Specify the breaking image-input limits before merge
  • reviewed 2026-08-15T11:32:10.546Z sha 00a21b8 :: found issues before merge. :: [P1] Separate the new image-size policy from the race fix
  • reviewed August 15, 2026, 8:03 AM ET / 12:03 UTC sha unknown :: found issues before merge. :: [P1] Separate the new image-size policy from the race fix
  • reviewed 2026-08-21T15:06:52.048Z sha 00a21b8 :: needs changes before merge. :: [P1] Keep image-size policy out of this hardening fix | [P1] Budget encoded image payloads before claiming an aggregate cap
  • reviewed 2026-08-27T17:05:05.340Z sha 00a21b8 :: found issues before merge. :: [P1] Keep image-size policy out of this hardening fix | [P1] Budget the encoded attachments, not only raw file bytes

@cxbAsDev

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@cxbAsDev cxbAsDev changed the title fix(cli): bound readModelRunImageFiles with size cap fix(cli): bound model run image reads with per-file and aggregate budget Jul 19, 2026
@cxbAsDev
cxbAsDev requested review from a team as code owners July 19, 2026 03:04
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Jul 19, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: discord Channel integration: discord channel: googlechat Channel integration: googlechat channel: imessage Channel integration: imessage channel: line Channel integration: line channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams channel: nextcloud-talk Channel integration: nextcloud-talk channel: nostr Channel integration: nostr channel: signal Channel integration: signal channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: tlon Channel integration: tlon channel: voice-call Channel integration: voice-call labels Jul 19, 2026
@clawsweeper

clawsweeper Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@github-actions

github-actions Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Dependency graph guard cleared

This PR no longer has blocked dependency graph changes. A future dependency graph change requires a fresh /allow-dependencies-change comment after the guard blocks that new head SHA.

  • Current SHA: 00a21b83f221c539446c3d0140ebb40672ce0cbb

@cxbAsDev

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

All P1 findings addressed: descriptor-bound reads eliminate TOCTOU, tests pass, PR body updated with evidence. Please re-review.

@clawsweeper

clawsweeper Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@cxbAsDev

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Rebased onto latest main and force-pushed. The previous checks-node-compact-small-4 failure was unrelated to this PR's capability-cli/model.ts changes (it was a flaky SIGTERM test in openclaw-e2e-instance.test.ts). Current CI run is now green.

@clawsweeper

clawsweeper Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@cxbAsDev

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Force-pushed to latest main. All required checks are green on head 7c8b4f20; no failures. Please re-evaluate for ready-for-maintainer-look.

@clawsweeper

clawsweeper Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@cxbAsDev

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Added a Real Behavior Proof section to the PR body with redacted openclaw capability model run output covering all three requested cases:

  • an accepted small PNG image,
  • a per-file rejection for a 105 MiB image (>100 MiB cap),
  • an aggregate-budget rejection when six 90 MiB images exceed the 500 MiB total budget.

@cxbAsDev

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@cxbAsDev

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Rebased onto current main, replaced the stat-then-open ordering with an O_NONBLOCK descriptor-acquisition strategy (fstat after open rejects FIFOs without blocking), and expanded the PR body with a FIFO/replacement race proof.

@clawsweeper

clawsweeper Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@cxbAsDev

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

PR body now includes the FIFO/replacement race proof with a focused O_NONBLOCK runtime script and its output. The stat-then-open race has been replaced by opening with O_NONBLOCK and validating the descriptor; CI is green.

@cxbAsDev

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Pushed an additional commit that pre-stats model-run image paths on Windows before the ordinary open, so non-regular paths (named pipes, directories, etc.) are rejected before can block. The POSIX path keeps the + descriptor-bound fstat/read strategy proved earlier. PR body updated with the Windows acquisition strategy.

@clawsweeper

clawsweeper Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@cxbAsDev

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Clarified the supported platform boundary: the nonblocking anti-hang guarantee is POSIX-only. Windows keeps ordinary fs.open("r") semantics because Node does not expose a portable nonblocking open for regular files there. The descriptor-bound size validation still applies on Windows once the file is open. PR body updated with the POSIX-only scope.

@clawsweeper

clawsweeper Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@cxbAsDev

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Labels still appear stale after the latest review verdict (ready for maintainer review). Requesting a fresh re-review to sync labels.

@cxbAsDev

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The previous re-review (run 29689663921) completed successfully and queued publication at 2026-07-19T13:54:04Z, but the durable review comment and labels have not been updated after ~30 minutes. Requesting the publisher/comment router to catch up or re-queue.

@clawsweeper

clawsweeper Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

cxbAsDev and others added 5 commits July 19, 2026 22:46
Replace EOF-based handle.readFile() with a descriptor read capped to the
validated stat.size so same-inode growth after stat() cannot bypass the
per-file and aggregate budgets.
…e reads

The descriptor-bound read helper opened the file before checking it was a
regular file. On POSIX, opening a FIFO for reading blocks until a writer
appears, creating a CLI availability regression. Stat first to reject
non-regular files before the blocking open.

Also fixes a missing-curly lint error from the prior commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S 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