Skip to content

fix(file-transfer): inline small YAML and source files from paired nodes - #128656

Merged
steipete merged 2 commits into
mainfrom
codex/file-transfer-inline-small-text-mime-20260824
Aug 24, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/file-transfer-inline-small-text-mime-20260824

Conversation

@steipete

Copy link
Copy Markdown
Contributor
Additional instructions

MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.

What Problem This Solves

Fixes an issue where users fetching small YAML configuration files, JavaScript source, CSS stylesheets, or tab-separated documents from paired nodes would receive only a saved-file path instead of the file contents promised by file_fetch.

Why This Change Was Made

Classify inline text at the private file-transfer tool boundary using the canonical text/* MIME family plus the existing JSON/XML application types and the canonical YAML type. Remove the incomplete private MIME allowlist instead of adding more format-specific entries. The change deletes 11 net lines of production code and does not change node authorization, file policy, public configuration, storage, or plugin SDK contracts.

User Impact

Agents immediately receive the contents of small .yaml, .yml, .js, .css, and .tsv files after fetching them from a paired node, without an unnecessary follow-up file read. The existing 8 KiB limit, SHA-256 integrity verification, untrusted-content warnings and marker sanitization, image blocks, SVG restrictions, and binary-file fallback remain unchanged.

Evidence

  • Before the fix, real node-host file reads passed their actual canonical MIME detection and SHA-256 payloads into the real file_fetch tool, but six regressions failed: .yaml, .yml, .js, .css, .tsv, and an exactly 8,192-byte JavaScript file all omitted their contents.
  • After the fix, all six cases pass while plain text, JSON, XML, HTML, and existing image delivery remain unchanged. An 8,193-byte JavaScript file, SVG content, and binary content still return only their saved paths. A forged external-content marker remains sanitized, and tampered YAML is rejected before staging.
  • Full file-transfer plugin suite: 20 test files, 204 tests passing.
  • Independent owner, real node-host, private MIME, and shared media-core suites: 225 tests passing.
  • Fresh exact-commit file-transfer tool, node-host, and MIME suites: 41 tests passing.
  • Focused type-aware lint, changed-file TypeScript validation, formatting, and authenticated full-branch review all pass.

@clawsweeper

clawsweeper Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 24, 2026 10:04
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 24, 2026
@clawsweeper

clawsweeper Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 24, 2026, 7:19 AM ET / 11:19 UTC.

ClawSweeper review

What this changes

The PR replaces the file-transfer plugin’s fixed text MIME allowlist with a bounded textual MIME predicate so small YAML, source, and tabular files fetched from paired nodes are inlined for the agent.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No blocking correctness or security findings. This maintainer-owned, protected PR remains necessary because current main still omits canonical YAML and source MIME types; merge only after the exact-head checks finish green.

Priority: P2
Reviewed head: e8afd42a016f40907e8314b4cdafb8c672eb59f1

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative production repair with direct MIME-contract and owner-boundary coverage has no blocking finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body also describes focused owner-boundary validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body also describes focused owner-boundary validation.
Evidence reviewed 8 items Current main misses the requested canonical MIME types: Current main inlines only a fixed set; it excludes application/yaml and text/javascript despite the tool contract promising small text and source files inline.
Patch uses the owning result-format boundary: The branch applies the size-bounded MIME choice immediately before the existing external-content wrapper and result construction.
Canonical MIME contract supports the new cases: Media Core maps .js to text/javascript, .tsv to text/tab-separated-values, and YAML to application/yaml; the plugin facade directly re-exports that implementation.
Findings None None.
Security None None.

Live Verification

Command: pnpm test extensions/file-transfer/src/tools/file-fetch-tool.test.ts

Result: FAIL (partial) — step 2 expect_output file_fetch tool: expected terminal output was not visible within 30 seconds: "file_fetch tool"

pnpm test extensions/file-transfer/src/tools/file-fetch-tool.test.ts
runner@runnervm76f27:/tmp/clawsweeper-live-proof-128656-aeLjbV/target$ pnpm test extensions/file-transfer/src/tools/file-fetch-tool.test.ts
$ node --import tsx scripts/test-projects.mts extensions/file-transfer/src/tools/file-fetch-tool.test.ts
pnpm test extensions/file-transfer/src/tools/file-fetch-tool.test.ts
[test] starting test/vitest/vitest.extensions.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-128656-aeLjbV/target

 ✓  extensions  extensions/file-transfer/src/tools/file-fetch-tool.test.ts (18 tests) 175ms

 Test Files  1 passed (1)
      Tests  18 passed (18)
   Start at  11:19:52
   Duration  4.37s (transform 3.08s, setup 1.06s, import 2.74s, tests 175ms, environment 0ms)

[test] passed 1 Vitest shard in 10.49s
runner@runnervm76f27:/tmp/clawsweeper-live-proof-128656-aeLjbV/target$ pnpm test extensions/file-transfer/src/tools/file-fetch-tool.test.ts
$ node --import tsx scripts/test-projects.mts extensions/file-transfer/src/tools/file-fetch-tool.test.ts
[test] starting test/vitest/vitest.extensions.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-128656-aeLjbV/target

 ✓  extensions  extensions/file-transfer/src/tools/file-fetch-tool.test.ts (18 tests) 119ms

 Test Files  1 passed (1)
      Tests  18 passed (18)
   Start at  11:20:03
   Duration  2.15s (transform 941ms, setup 474ms, import 1.32s, tests 119ms, environment 0ms)

[test] passed 1 Vitest shard in 8.15s
runner@runnervm76f27:/tmp/clawsweeper-live-proof-128656-aeLjbV/target$




















Assertions:

  • FAIL expect_output: file_fetch tool

How this fits together

A paired node returns a MIME-tagged, checksummed file payload to the file-transfer plugin. The plugin verifies and saves the bytes, then selects protected inline text, an image block, or a saved-file reference for the agent.

flowchart LR
A[Paired node] --> B[Checksummed file payload]
B --> C[File fetch tool]
C --> D{MIME and 8 KiB policy}
D --> E[Protected inline text]
D --> F[Image content block]
D --> G[Saved-file reference]
Loading

Before merge

  • Resolve merge risk (P1) - Relevant exact-head checks were still in progress in the supplied PR state; do not merge until they complete green.
  • Complete next step (P2) - This protected maintainer PR needs ordinary exact-head CI completion and maintainer merge handling, not a ClawSweeper repair job.
Agent review details

Security

None.

PR surface

Source -11, Tests +117. Total +106 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 7 18 -11
Tests 2 131 14 +117
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 138 32 +106

Review metrics

Metric Value Why it matters
Production versus test LOC production +7/-18 (net -11); tests +131/-14 (net +117) The bug fix deletes the incomplete production allowlist and adds boundary-focused regressions without growing production code overall.

Stored data model

Persistent data-model change detected: serialized state: extensions/file-transfer/src/tools/file-fetch-tool.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep one bounded textual-MIME decision at the private file-transfer result boundary, retaining checksum verification, untrusted-content isolation, the 8 KiB cap, and image/binary fallbacks.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep one bounded textual-MIME decision at the private file-transfer result boundary, retaining checksum verification, untrusted-content isolation, the 8 KiB cap, and image/binary fallbacks.

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

Yes, source-reproducible: current main’s allowlist excludes application/yaml and text/javascript while the canonical MIME implementation emits those types. This read-only review did not execute the regression suite.

Is this the best way to solve the issue?

Yes. Replacing the incomplete private allowlist at the final result-format boundary is preferable to adding one-off extension entries, and it reuses the canonical Media Core MIME contract.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This repairs a bounded paired-node file-fetch response path without evidence of a security bypass, outage, or data loss.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body also describes focused owner-boundary validation.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Current changed lines blame to this PR head, and history shows repeated work in the file-transfer path. (role: recent file-transfer contributor; confidence: high; commits: e8afd42a016f, 91bb76d8b9de; files: extensions/file-transfer/src/tools/file-fetch-tool.ts, extensions/file-transfer/src/shared/mime.ts)
  • sunlit-deng: Authored the earlier inline file-fetch text/BOM repair on the same tool path. (role: adjacent feature contributor; confidence: medium; commits: 190307137add; files: extensions/file-transfer/src/tools/file-fetch-tool.ts)
  • Vincent Koc: Authored the node-invocation refactor used by the file-fetch tool before it receives and validates paired-node payloads. (role: shared invocation-path contributor; confidence: medium; commits: 0a14f593c395; files: extensions/file-transfer/src/tools/node-tool-invoke.ts)

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 (2 earlier review cycles)
  • reviewed 2026-08-24T10:13:45.638Z sha 1d66220 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-24T10:55:30.603Z sha 1d66220 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 0d840c0 into main Aug 24, 2026
107 checks passed
@steipete
steipete deleted the codex/file-transfer-inline-small-text-mime-20260824 branch August 24, 2026 11:33
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. plugin: file-transfer rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant