Allow validated TXT/JSON/YAML media sends#79658
Conversation
|
Codex review: needs maintainer review before merge. Reviewed May 31, 2026, 1:50 PM ET / 17:50 UTC. Summary PR surface: Source +27, Tests +55, Docs 0. Total +82 across 7 files. Reproducibility: not applicable. as a feature/security-boundary expansion, but the current behavior is well evidenced: current source/docs block plain text documents and Mantis proof shows main failing while the candidate delivers a TXT document in Telegram. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the focused shared media/docs/tests change after maintainer acceptance of the documented host-read text-document boundary and completed required checks, with the APK follow-up kept separate at #87349. Do we have a high-confidence way to reproduce the issue? Not applicable as a feature/security-boundary expansion, but the current behavior is well evidenced: current source/docs block plain text documents and Mantis proof shows main failing while the candidate delivers a TXT document in Telegram. Is this the best way to solve the issue? Yes, this is the best technical layer if maintainers want the feature: MIME mapping belongs in media-core and host-read gating belongs in the shared media loader, not in a Telegram-specific workaround. The remaining question is policy acceptance of the widened host-read boundary. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 05b3f1c29d73. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +27, Tests +55, Docs 0. Total +82 across 7 files. View PR surface stats
Security concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
21c29cb to
1b0b351
Compare
|
Added the missing Validation run:
|
e6b12f9 to
1681524
Compare
|
Rebased on current New head: Validation after rebase:
|
1681524 to
0a74310
Compare
|
Rebased onto current While checking the current-head CI failure, Validation run after the rebase/fix:
|
0a74310 to
d3d074f
Compare
d3d074f to
9b552b0
Compare
|
Fixed the ClawSweeper P2 finding about Change:
Validation:
New head: |
4f051ca to
c3d8b9f
Compare
|
Rebased on latest Validation:
|
c3d8b9f to
2f800d7
Compare
|
Rebased onto current Validation run locally:
Also included a tiny guardrail test update for the current Bedrock runtime override already present on |
|
Small follow-up split out for the remaining APK case: #87349. This keeps |
ff29a61 to
02eb339
Compare
85b113f to
1ac8c3d
Compare
1ac8c3d to
9a1c673
Compare
|
Heads up: this PR needs to be updated against current |
9a1c673 to
2e72d51
Compare
Mantis Telegram Desktop ProofSummary: Mantis captured native Telegram Desktop before/after GIFs: Main shows the text document send failing, while this PR shows the TXT file delivered as a Telegram document.
Motion-trimmed clips: |
|
Landed via rebase merge in e014145. Thanks @simplyclever914. Proof before landing:
I also added the maintainer docs follow-up so the host-local text document examples explicitly mention Markdown/MD alongside TXT/JSON/YAML/YML. |




Summary
.yaml/.ymlReal behavior proof
Behavior or issue addressed: host-read local media sends can attach validated TXT, JSON, YAML, and YML documents while still rejecting binary data disguised with those text extensions.
Real environment tested: local OpenClaw checkout on Linux 6.11 / Node v22.22.2, PR head
1b0b35121e5df831217c9003a62fc0a25ef0bee8.Exact steps or command run after this patch: ran a live Node/tsx script against
src/media/web-media.tsthat wrote real temporary local files (note.txt,payload.json,config.yaml,config.yml, and binary-disguisedevil.json) and calledloadWebMedia(..., { localRoots: "any", readFile: fs.readFile, hostReadCapability: true })on each file.Evidence after fix: terminal output from the live local-file run:
Observed result after fix: real local TXT/JSON/YAML/YML files loaded as
documentmedia with the expected MIME types; a ZIP-signature binary payload namedevil.jsonwas rejected withpath-not-allowed.What was not tested: no end-to-end delivery to an external chat provider in this proof; this verifies the shared host-read media loader path used before provider send.
Validation
node --import tsx ./.tmp-openclaw-real-media-proof.mjs(temporary local proof script; output included above)corepack pnpm exec node scripts/test-projects.mjs test/vitest/vitest.infra.config.ts test/vitest/vitest.hooks.config.ts test/vitest/vitest.secrets.config.ts— passed 3 Vitest shardscorepack pnpm exec node scripts/test-projects.mjs src/media/web-media.test.ts src/media/mime.test.ts src/infra/outbound/message-action-runner.media.test.ts— passed 3 Vitest shards