Skip to content

fix(memory-wiki): reject FIFO synthesis body files - #183435

Merged
obviyus merged 4 commits into
openclaw:mainfrom
Leon-SK668:leon/fix-wiki-body-files-20261025
Oct 25, 2026
Merged

obviyus merged 4 commits into
openclaw:mainfrom
Leon-SK668:leon/fix-wiki-body-files-20261025

Conversation

@Leon-SK668

@Leon-SK668 Leon-SK668 commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

wiki apply synthesis --body-file could hang indefinitely on a FIFO, including a symlink to a FIFO, when no writer was present. It awaited an ordinary file read before validating the body.

Why This Change Was Made

Reuse the existing SDK regular-file reader before decoding or mutating the vault. Resolve source symlinks so regular-file symlinks remain supported. Preserve structured I/O errors and explain how to recover from special-file refusals. Credit to @Leon-SK668 for the report and fix.

User Impact

Special files fail promptly with regular UTF-8 file / inline --body guidance instead of hanging. Existing ordinary-file, symlink, large-body, UTF-8, and blank-body behavior remains intact.

Evidence

Built pinned main beaf18f and the candidate in separate source directories inside a secretless Node 24.22.1 Linux container. Enabled bundled memory-wiki through the shipped CLI, configured disposable vaults, and seeded an existing synthesis through wiki apply synthesis.

  • Created real native FIFOs with mkfifo and symlinks to them, with no writer.
  • Main: direct FIFO twice and symlink twice remained pending until the independent 7-second timeout killed the CLI; stdout and stderr were empty.
  • Candidate: both forms twice exited 1 promptly with one JSON CLI failure and contextual regular-file recovery guidance; no timeout or signal.
  • Complete vault filename/content-hash snapshots were identical before and after every refused invocation.
  • On both versions, inline body, ordinary UTF-8 file, symlink to a regular UTF-8 file, and ordinary/symlinked files exceeding one MiB succeeded. Saved synthesis pages retained the complete expected content.
  • Candidate CLI suite: 36 tests passed. The two FIFO regressions failed on main for the expected admission diagnostic difference. Changed TypeScript formatting check passed.

Simplification: use the existing SDK file-admission owner rather than introducing a separate FIFO detector, timeout, size limit, or SDK surface. Production +15/-1; tests +91/-2. The necessary growth preserves source symlinks and existing structured I/O identity while adding actionable special-file recovery guidance.

Two-way door: reverting restores the old input behavior; no schema or persisted-format changes. Blast radius is synthesis body-file admission before vault mutation.

@clawsweeper

clawsweeper Bot commented Oct 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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 25, 2026
@clawsweeper

clawsweeper Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Reject special synthesis body files before reading them while preserving regular-file symlinks and actionable recovery guidance.

Example: Run openclaw wiki apply synthesis Good --source-id src.manual --body-file body.fifo without a FIFO writer.

  • Before: The command waits indefinitely.
  • After: The command exits with regular UTF-8 file or --body guidance and leaves the vault unchanged.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused repair with applicable shipped-CLI proof, meaningful boundary tests, preserved valid-input behavior, and no actionable findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Supplied secretless Linux/Node built-CLI results exercise writerless direct and symlinked FIFO refusals, unchanged vault hashes, and successful inline, Unicode, regular-file, symlink, and large-file disk readbacks; the subsequent head change is documentation only.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A writerless FIFO supplied as a synthesis body file leaves the CLI waiting indefinitely.
Reason: Prompt rejection with a recovery action fixes an owned failure while preserving valid inputs and existing mutation ownership.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current synthesis-input hang with a focused change; no actionable findings remain.

Priority: P2
Reviewed head: fd8f585d82991f13b568d0078cab2c3b33dfa07f

Before merge

None.

Findings

None.

Agent review details

How this fits together

The memory-wiki CLI resolves synthesis text before synchronizing sources and applying vault mutations.

flowchart TD
 A[Wiki synthesis command] --> B[Body resolver]
 B --> C[SDK regular file reader]
 C --> D[UTF8 and blank validation]
 D --> E[Source synchronization]
 E --> F[Vault mutation]
 C --> G[Actionable refusal]
Loading

Technical review

Best possible solution:

Land the existing SDK-reader repair once normal exact-head CI gates pass.

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

Current-main source exposes the blocking FIFO read, corroborated by supplied native baseline results; this read-only review ran no target code.

Is this the best way to solve the issue?

The smallest complete fix keeps body resolution in the existing CLI owner and delegates file admission to the existing SDK primitive without a timeout, size limit, or parallel reader.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 150134610a43.

Provenance checked

  • Inline precedence and synthesis body resolution keeps the original intent (afb89b4: Add supported CLI synthesis mutations accepting inline or file-backed text.)
  • UTF-8 and blank-body validation keeps the original intent (3f962c1: Prevent malformed or blank body files from corrupting or erasing existing synthesis content.)
  • Existing ChatGPT special-file regressions keeps the original intent (7ab59b2: Reject special import inputs before reading while preserving regular-file symlinks.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Raw commit 5716d83 adds extensions/memory-wiki/src/cli.ts:156 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5716d83336fd; files: extensions/memory-wiki/src/cli.ts)

PR surface

Source +14, Tests +89, Docs +1. Total +104 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 15 1 +14
Tests 1 91 2 +89
Docs 1 3 2 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 109 5 +104

Review metrics

Metric Value Why it matters
Production versus test changes Production +15/-1; tests +91/-2 The production growth reuses file admission and supplies recovery context; tests protect FIFO refusal and distinct compatibility contracts.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Special-file input hangs an advanced optional CLI workflow while regular-file and inline synthesis paths remain usable.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-25T08:35:00.320Z sha 9f9fc74 :: needs changes before merge. :: [P3] Explain how to recover from a rejected body-file input
  • reviewed 2026-10-25T09:20:53.410Z sha 5509db6 :: needs maintainer review before merge. :: none

Reviewed October 25, 2026, 7:28 AM ET / 11:28 UTC (Revision 3).

@Leon-SK668

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated head: 5509db6d372859d33c37ccb2d4136131beb803cc.

Resolved the import conflict with main while retaining its three ChatGPT file-input regressions. The synthesis refusal now identifies --body-file, preserves the original diagnostic and cause, and explains how to retry with a regular UTF-8 file or --body. Structured I/O errors retain their original identity and code.

The updated body records the exact-head proof: 40/40 focused tests, source-backed types, typed lint, format, build, and the unchanged eight-case native CLI driver all pass. Both writerless FIFO inputs exit 1 with the contextual JSON/stderr diagnostic; four successful writes are read back exactly and all four refusals leave the vault unchanged. Independent disk and diagnostic readback also passes.

@clawsweeper

clawsweeper Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 25, 2026
@obviyus

obviyus commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Oct 25, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 25, 2026
@obviyus
obviyus merged commit 690241f into openclaw:main Oct 25, 2026
100 checks passed
@obviyus

obviyus commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

Landed in 690241f. Thanks @Leon-SK668. wiki apply synthesis --body-file no longer hangs on a FIFO.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 26, 2026
fix(wiki): reject a FIFO passed to wiki apply synthesis --body-file instead of hanging

`openclaw wiki apply synthesis --body-file` hung forever when given a named pipe with no writer, or a symlink to one, because opening it blocked before the command could check that the body is a regular file. The command now checks the path first and exits 1 with regular-file guidance (also in JSON output), leaving the wiki unchanged.

Evidence: built CLI with a real FIFO from mkfifo. On main a FIFO and a symlink to it both blocked until an external 7 s timeout (twice each); with this change both exit 1 right away with the guidance (twice each), and the vault files are byte-identical. An inline body, a regular file, a symlink to a regular file and a body over 1 MiB are still applied in full. Production +15/-1.

Thanks @Leon-SK668.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: memory-wiki P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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.

2 participants