#460·openwiki

X bookmarks synthesis unreliably reads the just-written raw dump (ENOENT race): captures silently dropped or run crashes

Author: rstover-foCreated Jul 24, 2026Updated Sep 24, 2026

Summary

In personal mode with the X connector (bookmarks stream), the synthesis step's read of the raw dump the connector just wrote fails intermittently — and depending on where it fails, the run either exits 0 having captured nothing, captures a partial subset silently, or crashes with an unhandled error. Bookmark loss is invisible to the user: the raw pull succeeds, the run "completes," and the wiki simply never learns about new bookmarks.

Observed across a week of daily scheduled runs plus manual runs, on 0.1.2 and still on 0.2.3.

Symptoms observed

  1. Zero captures, exit 0 (0.1.2, two consecutive scheduled morning runs): fresh bookmarks present in the raw dump; synthesis produced no page changes, no error output, .last-update.json behavior normal.
  2. Partial captures, exit 0 (0.2.3, scheduled run): 12 new-to-window bookmarks in the dump; 6 captured into pages, 6 silently dropped — no error, no record of the misses.
  3. Crash, exit 1 (0.2.3, manual openwiki ingest x): connector prints Fetched 1 X stream dump(s). Raw files: ~/.openwiki/connectors/x/raw/<run-id>/bookmarks.json, then the agent's read of that same path throws:
Error: ENOENT: no such file or directory, open '~/.openwiki/connectors/x/raw/<run-id>/bookmarks.json'
    at Object.process (.../langchain/dist/agents/transformers/tool-call.js:152)  // pending.rejectOutput(new Error(message))
    at StreamMux.push (.../@langchain/langgraph/dist/stream/mux.js:173)
    at pump (.../@langchain/langgraph/dist/stream/mux.js:321)

The file exists on disk immediately after the crash. Also relevant: scheduled/windowed runs write the bookmarks dump in a different shape than the seed path (raw API pages + windowHours), so the agent is doing more file navigation on exactly the runs that fail most.

Root-cause hypothesis

The agent's file tool reads the just-written dump path before it is visible to it (write/rename flush race, or a sandboxed read root where the new run directory isn't mounted yet). A failed read is sometimes fatal (the rejection propagates unhandled through the stream mux and kills the process) and sometimes swallowed (agent shrugs, synthesizes from whatever it did read → zero/partial captures with exit 0).

Asks

  1. Make tool read errors non-fatal and retried — an ENOENT on a path the connector reported writing milliseconds earlier is the definition of retryable; it should never take down the whole run (same fragility class: any ENOENT from a bad relative path also crashes the mux rather than returning an error to the model).
  2. Deterministic post-run reconciliation for the bookmarks stream — diff captured IDs against the dump's IDs after synthesis and surface uncaptured items (log/summary/next-run carryover). Users currently have no way to know bookmarks were dropped; we only caught it by git-versioning the wiki and diffing raw dumps by hand.

Environment: macOS, Node 26.3.0, personal mode, provider anthropic/claude-sonnet-5, bookmarks-only X config (maxPagesPerStream: 2). Happy to share full logs and the dump/capture diffs.

Related: #372 (post-generation consistency pass) — same family: silent failure modes that a cheap deterministic check would surface.