Skip to content

fix: isolate an unclaimed RuntimeEvent instead of rejecting the whole session view #1613

Closed

Description

@Astro-Han

What happened

One RuntimeEvent the projection does not claim makes an entire session unreadable, even when every message in it is intact.

projectRuntimeEventsToStoredMessages emits a hard unsupported_event for an unrecognised shape (packages/runtime/src/runtime-event-read-model.ts:239), and RuntimeReadModel.buildView throws on any hard diagnostic (packages/runtime/src/runtime-read-model.ts:295), discarding the whole projection. backfillMissingRuntimeEvents only fires when the ledger is empty, so a complete ledger with one unclaimed event has no fallback path at all.

The blast radius is the whole of getSessionView: getMessages, listTurns, branchFromTurn, branchBeforeTurn, reviseBeforeTurn, requireTurnForAction, requireUserMessageForTurn. The session cannot be read, branched, revised, or acted on.

#1607 was one instance: two sandbox-boundary control facts the projection had not been taught, discarding ten intact messages. #1609 claims those two and adds a compile-time coverage contract, but the amplification itself is unchanged — the next unclaimed event does the same thing.

Expected: an unclaimed event degrades the view it belongs to, not the session.

How to reproduce

  1. Append a RuntimeEvent whose shape the projection does not claim to a completed run's ledger.
  2. Open that session.

Actual: Failed to load conversation. Expected: the session loads, with the unreadable event reported as a diagnostic.

Environment

  • Maka commit: 1f67e0c5d
  • OS: macOS 26.5.2
  • Surface: Desktop
  • Node.js: v26.5.0

Logs, screenshots, or additional context

The hard failure is deliberate — it exists so messages are never silently dropped — so relaxing it is a real trade-off, not an oversight. Worth weighing: whether "unclaimed control fact" and "message we failed to project" should carry the same severity, given only the second risks losing user-visible content. Related: AiSdkFlow's exhaustiveness guard (packages/runtime/src/ai-sdk-flow.ts:507-521) turns an unknown SessionEvent into exactly the shape that triggers this, so its "don't drop the event" fallback currently escalates into "lose the session".

Activity

  1. added
    bug
    on Jul 29, 2026
  2. added a commit that references this issue on Jul 29, 2026
    1f43ea7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions