Skip to content

fix(retained): do not treat native session updates as runtime identity #824

Description

@drewstone

Production reproduction

A retained Braid run over Tangle Sandbox and OpenCode durably admitted its exact control reference and consumed events through cursor 4. The next frame was session.updated, whose data.sessionId is the native OpenCode session. agent-runtime@0.133.6 rejected it as another retained runtime session and forced recovery.

A direct production provider trace with the provider parser corrected consumed 18/18 frames through result and done. The same trace showed session.updated.data.sessionId as a native OpenCode ID while execution.started.data.sessionId carried the runtime session ID. Both exact Sandboxes were deleted and active resources returned to the starting count.

Cause

src/runtime/retained-run-binding.ts::assertEventBinding checks source.data.sessionId for every event. The canonical session.updated contract uses that field for provider-native continuation identity, not retained runtime addressing.

Required behavior

  • Keep checking run, execution, and runtime-session identity on lifecycle envelopes.
  • Preserve provider-native session.updated.sessionId as event content.
  • Add a positive native-session regression and a negative cross-run lifecycle regression.
  • Prove the packed runtime through the real retained Braid canary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions