Skip to content

V5 migration and memory-system improvements - #114

Draft
Prasanna721 wants to merge 1 commit into
mainfrom
v5-migration
Draft

Prasanna721 wants to merge 1 commit into
mainfrom
v5-migration

Conversation

@Prasanna721

@Prasanna721 Prasanna721 commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Send a session's new messages to the V5 route and let the server build the memory text, for both the v1 and v2 runtimes.

execution end / idle / session end
  └─ services/session.ts   messages added since the last successful send (count + prefix hash)
       └─ addSession  POST /ns/{tag}/document  { id: sessionID, content: <new messages> }
                      header x-sm-session: opencode
server: messages → memory text → appended to the session's document

Before: the plugin batched turns on the client and posted each batch as its own document.
After: the plugin posts new messages unchanged, one document per session, and the server formats them. Metadata and entity context are preserved, so recall is unchanged.

Files

  • src/services/capture.ts (v1), src/v2/runtime.ts (v2): send the new messages; the cursor advances only after a 2xx.
  • src/services/session.ts: per-session cursor; detects a shrunk or rewritten history and restarts.
  • src/services/client.ts: addSession().
  • src/services/capture.test.ts, src/v2/runtime.test.ts: remove the tests for the client-side batching this replaces.

Verified

  • bun run typecheck clean, bun test 25/25.

🤖 Generated with Claude Code

@Prasanna721
Prasanna721 force-pushed the v5-migration branch 2 times, most recently from f26185c to e98560e Compare October 14, 2026 00:56
Send the session to the V5 /ns/{tag}/document route and let the server
derive memory from it, instead of summarizing on the client. Preserves the
existing memory metadata and entity context so recall is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant