Skip to content

Ending an unknown Session is rejected instead of creating a ghost row #41

Closed

Description

@possiblyneal

Parent

Part of #31.

Branch: fix/api-bounds

What to build

Calling /agentmemory/session/end with a Session id that was never started answers 404 session_not_found and writes nothing, so the Session list only ever holds Sessions that happened. The Engine's update-creates-missing-key behaviour is unchanged; the PR body reports every other caller that updates a key without first checking it exists.

Acceptance criteria

  • Unknown id → 404 with session_not_found; no row appears in the sessions scope afterwards
  • Known id still ends normally with the same response as today
  • The audit of other update-without-check callers is written into the PR body
  • npm test green

Blocked by

Activity

  1. possiblyneal commented on Sep 22, 2026

    @possiblyneal
    OwnerAuthor

    Done in 3dc4085 on fix/api-bounds: session/end answers 404 session_not_found for an unknown id and writes nothing; known ids unchanged. Audit of other update-without-check callers is in the commit and will be in the PR body.

  2. added a commit that references this issue on Sep 22, 2026
    3dc4085
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

    ready-for-agentFully specified, ready for an AFK agent

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions