anomalyco / anomalyco/opencode

V1 migration can lower an existing event watermark

Open
#44,012 0 comments 0 reactions 1 assignee View on GitHub

@nexxeln is already working on this.

Since Aug 21, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

Rebuilding a V1 session projection overwrites event_sequence.seq with the rebuilt message watermark. If that session already has newer durable V2 events, the next event can reuse an existing sequence and violate the aggregate sequence constraint.

Plugins

None

OpenCode version

V2 at 2c8e2a2b2

Steps to reproduce
  1. Create a legacy V1 session row that requires projection rebuild.
  2. Give the same session an existing V2 event at a sequence above the rebuilt message watermark.
  3. Run the V1 migration.
  4. Observe event_sequence.seq is lowered below the durable event sequence.
Screenshot and/or share link

N/A (SQLite migration)

Operating System

Any

Terminal

N/A

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.