Repository navigation
Description
Finding (from PR review)
PR #9341 (merged, feat(pm-stack): decision-set event pipeline — Turso sync + Cloudflare Worker/D1/DO (#9335)) adds the decision-events Worker. Codex's P1 finding: pending Durable Object fan-out is lost permanently when ingest fails after the D1 batch commits. The Worker fans out only events whose D1 INSERT OR IGNORE reported changes; if the Durable Object ingest then fails (non-OK response), the handler still returns HTTP 200, the sync client acknowledges the events, and on any retry the D1 inserts report zero changes — so the events are never fanned out to subscribers or the per-set coordination state.
- Source PR: feat(pm-stack): decision-set event pipeline — Turso sync + Cloudflare Worker/D1/DO (#9335) #9341
- Review comment: feat(pm-stack): decision-set event pipeline — Turso sync + Cloudflare Worker/D1/DO (#9335) #9341 (comment)
- Reviewer:
chatgpt-codex-connector[bot], 2026-11-13T05:34:08Z (P1) - Flagged location:
pm-stack/decision-events-worker/src/index.ts:170
"If the Durable Object ingest fails after the D1 batch commits, these events can never reach the object on retry: their next inserts report zero changes, so
insertedEventsexcludes them permanently. A non-OK ingest response is also converted into an HTTP 200 webhook response, causing the sync client to acknowledge the events despite the failed fan-out. Persist pending fan-out separately and retry it, with event-ID deduplication at the Durable Object, so transient failures do not permanently lose subscriber notifications and coordination state."
No-response evidence
- The review thread contains only the Codex comment — no replies (verified 2026-11-14 via the PR comments API and a GraphQL
reviewThreadsread:isResolved=false, 1 comment). - PR feat(pm-stack): decision-set event pipeline — Turso sync + Cloudflare Worker/D1/DO (#9335) #9341's only commit after the comment is
66940fb15f(2026-11-13T05:40:26Z), a merge oforigin/maininto the branch — it does not touch the flagged logic. The PR merged at 2026-11-13T05:45:31Z (merge commitaad1d3602a) with the finding unaddressed; the only later main commit touching these files is a treefmt style pass (d451641c31). - Dedupe: open/closed issue searches by comment id, file path, and keywords (fan-out, pagination cursor, outbox-dir, webhook acknowledgement) found no issue covering this finding; parent issue pm-stack decision sets v2: rich questions, event log, submit API + activity webhook/hook #9335 is closed and does not track it.
Still-live evidence (verified 2026-11-14 on current main)
pm-stack/decision-events-worker/src/index.ts:160-186: the D1 batch runs first;insertedEventsis built only from rows withmeta.changes > 0(lines 161-167); the fan-out loop (line 170) iterates onlyinsertedEvents; a non-OK ingest is recorded as{ error: ... }in thefanoutmap (line 177) and the handler still returnsResponse.json({...})with HTTP 200 (lines 180-186). A retry therefore excludes the already-stored events from fan-out forever.- The Durable Object
/ingesthandler (lines 91-96) incrementsstate.fannedOutand overwrites last-event fields for every event it receives, with no event-ID deduplication — so a retry mechanism also needs the dedup the reviewer asked for.
Acceptance criteria
- A failed Durable Object ingest no longer loses fan-out: pending fan-out is persisted/retried (or the webhook returns a non-200 the sync client will not acknowledge), and the Durable Object deduplicates by event ID.
- A regression test covers: D1 commit succeeds, DO ingest fails, retry delivers the events exactly once.
- Or: a documented decision on this issue that this loss mode is accepted, with the reasoning recorded.
Activity
dezren39 commentedon Nov 14, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 14, 2026
Picked up by
repo-worker-any-a— working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live whilerepo-worker-any-aposts progress markers; after 30 minutes of silence any other worker may pick this up.)98 remaining items
dezren39 commentedon Nov 14, 2026
agent-note:v1
worker: repo-worker-code
lane: code-h
task_id: 16157
state: claimed
note: Picked up small_fix for #9612. Creating worktree and inspecting pm-stack/decision-events-worker.
dezren39 commentedon Nov 14, 2026
agent-note:v1
worker: repo-worker-code
lane: code-h
task_id: 16157
state: done
note: Opened PR #9624 (#9624) fixing DO fan-out loss on ingest failure and adding eventId deduplication. bun test: 8 pass, 0 fail.
Merge pull request #9624 from developing-today/queue/16157-9612-decis…
dezren39 commentedon Nov 17, 2026
state: already_done (re-triage)
lane: any-b, worker: repo-worker-code, task 19057
Re-triage of #9612 (2026-11-17): already fixed and closed. Lane code-h verified the defect live on origin/main on 2026-11-14 (tasks 16156/16157) and landed PR #9624 — DO fan-out no longer lost when /ingest fails after the D1 commit, plus eventId deduplication in the Durable Object (bun test: 8 pass, 0 fail, per the closing note). PR merge state re-verified fresh this shift and recorded in the triage result. No further work.