Repository navigation
fix(memory-wiki): reject FIFO synthesis body files - #183435
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesReject 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.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current synthesis-input hang with a focused change; no actionable findings remain. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe 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]
Technical reviewBest 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
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +14, Tests +89, Docs +1. Total +104 across 3 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed October 25, 2026, 7:28 AM ET / 11:28 UTC (Revision 3). |
|
@clawsweeper re-review Updated head: Resolved the import conflict with main while retaining its three ChatGPT file-input regressions. The synthesis refusal now identifies 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. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landed in 690241f. Thanks @Leon-SK668. wiki apply synthesis --body-file no longer hangs on a FIFO. |
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]>
What Problem This Solves
wiki apply synthesis --body-filecould 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.mkfifoand symlinks to them, with no writer.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.