Skip to content

fix(pi): bind writes to acknowledged runtime sessions #733

Description

@dnlrsls

Problem

Pi native memory wrappers currently accept model-supplied session IDs, synthesize manual IDs, and cache a runtime session before Engram acknowledges registration. A failed registration can therefore suppress retries or let session-attributed writes proceed with untrusted identity.

Expected behavior

  • Use only ctx.sessionManager.getSessionId() for the four session-attributed writes.
  • Remove model-facing session_id fields from those native tool schemas.
  • Require successful Engram session registration before writing.
  • Cache only acknowledged registration and leave failures retryable.
  • Missing runtime identity fails safely without synthesizing a manual ID.
  • Scope per-case declarations so Pi passes directed Biome lint.

Acceptance criteria

  • Runtime test covers failed acknowledgement, retry, successful cache, model-ID rejection, and missing runtime ID.
  • Pi complete test suite passes.
  • Directed Biome lint reports no errors.
  • No changes to OpenCode, Go core, persisted schema, handles, flags, or fallback policy.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions