Skip to content

Postgres rejects event payloads containing U+0000; bridge misclassifies… - #1260

Merged
warren-auto-merge[bot] merged 3 commits into
mainfrom
warren/run_61kgmmjr94p3
Sep 16, 2026
Merged

warren-auto-merge[bot] merged 3 commits into
mainfrom
warren/run_61kgmmjr94p3

Conversation

@warren-run-bot

Copy link
Copy Markdown
Collaborator

Summary

seeds: sync 2026-09-16

Run

  • Warren run: run_61kgmmjr94p3
  • Agent: pi
  • Cost: $0.522 (11.0k in / 11.1k out / 1.1M cache-r)

Seeds

  • warren-fb5e — Postgres rejects event payloads containing U+0000; bridge misclassifies the deterministic insert failure as sandbox_unreachable and kills a healthy run

Commits (3)

  • bce0c8b seeds: sync 2026-09-16
  • 101a60e fix(events): sanitize U+0000 in event payloads; bridge drops single-event append failures (warren-fb5e)
  • 6bccc43 mulch: update expertise

Files changed

src/db/repos/events.test.ts    |  43 +++++++++++++++++
 src/db/repos/events.ts         |  21 +++++++-
 src/runs/stream/bridge.test.ts |  26 ++++++++++
 src/runs/stream/bridge.ts      | 107 ++++++++++++++++++++---------------------
 src/runs/stream/types.ts       |   7 +++
 5 files changed, 149 insertions(+), 55 deletions(-)

Prompt

Show prompt
Work seeds issue warren-fb5e in this repo (warren). First run `sd show warren-fb5e --json` from the repo root: the issue body is the spec and names the exact files, the two-part fix, and the tests to add. Part 1 (sanitize U+0000 to U+FFFD in EventsRepo.append via a recursive value walk, src/db/repos/events.ts) is mandatory. Part 2 (a single failed events.append in the stream loop of src/runs/stream/bridge.ts is logged, counted as dropped, and skipped rather than flipping errored=true) is required but keep it minimal and do not change src/server/bridge-reconnect.ts thresholds. Read docs/design/runtime-and-supervisor.md for the bridge resume semantics before editing. Follow AGENTS.md conventions: kebab-case files, no any, tests named describe(unit) + verb-led test(). Quality gates are terminal: `bun run check:all` must be green before you commit and report done, and every ratchet (coverage, file size, debt markers, duplication) stays binding. When done, close the issue with `sd close warren-fb5e --reason "<what you delivered, citing files>"`, then commit everything including .seeds/ on the current branch. Do not open a PR and do not push; warren handles delivery.

🤖 Opened by warren run run_61kgmmjr94p3

…vent append failures (warren-fb5e)

Postgres jsonb rejects U+0000, and the bridge classified the resulting
deterministic insert failure as a stream error, flipping errored=true so
bridge-reconnect replayed the same poison event until bridge_lost killed
a healthy run.

- EventsRepo.append recursively walks the payload value and replaces
  U+0000 with U+FFFD in every string (both dialects); a literal
  six-character \u0000 escape-sequence text is left untouched.
- bridgeRunStream catches a per-event append failure, logs it at error
  level with runId/kind/sandboxEventSeq, counts it as dropped (new
  optional BridgeRunStreamResult.dropped), and keeps streaming without
  setting errored. Resume/dedup semantics unchanged;
  bridge-reconnect.ts thresholds untouched.
@warren-auto-merge
warren-auto-merge Bot enabled auto-merge (squash) September 16, 2026 15:58
@warren-auto-merge
warren-auto-merge Bot merged commit 6ab1b95 into main Sep 16, 2026
9 checks passed
@warren-auto-merge
warren-auto-merge Bot deleted the warren/run_61kgmmjr94p3 branch September 16, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant