Skip to content

List routes return a first page and say how many there are #40

Closed

Description

@possiblyneal

Parent

Part of #31.

Branch: fix/api-bounds

What to build

Asking the daemon for Sessions, semantic records or procedural records returns a first page instead of the whole scope. /agentmemory/sessions, /agentmemory/semantic and /agentmemory/procedural accept limit (default 100) and offset (default 0); limit=all returns everything. The response keeps its existing collection key and adds total, limit, offset. Sessions are ordered newest-first (most recent start first) before the page is taken, after the existing agent filter; today the route has no ordering, so a first page would otherwise be whichever rows SQLite returns first. The recap, handoff and session-history skills read this route through memory_sessions and must keep showing the most recent Sessions. Export/import reads the Engine directly and is unaffected.

Acceptance criteria

  • Each of the three routes with no query returns at most 100 items plus a total equal to the full count
  • limit/offset page correctly; limit=all returns every record
  • The standalone MCP client's existing ?limit= on sessions is now honoured
  • With more Sessions than limit, the first page holds the most recently started ones; memory_sessions { "limit": 20 } as recap, handoff and session-history call it returns the 20 newest
  • Endpoint-count consistency tests still pass (no endpoint added)
  • npm test green

Blocked by

  • None — can start immediately

Activity

  1. possiblyneal commented on Sep 22, 2026

    @possiblyneal
    OwnerAuthor

    Done in e59c7a2 on fix/api-bounds: the three list routes page (limit default 100, limit=all, offset) and return total/limit/offset; sessions sorted newest-first before paging; 12 new tests in test/list-routes-paging.test.ts.

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