Skip to content

V5 migration and memory-system improvements - #114

Merged
capy-ai[bot] merged 9 commits into
mainfrom
v5-migration
Nov 23, 2026
Merged

capy-ai[bot] merged 9 commits 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>
MaheshtheDev and others added 3 commits November 16, 2026 02:01
opencode run exits on session idle without waiting for plugin hooks, so the response never arrived and every run resent the whole session from offset 0. The cursor now moves when the send starts and rolls back if the send fails.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@ishaanxgupta
ishaanxgupta marked this pull request as ready for review November 17, 2026 08:23
ishaanxgupta and others added 2 commits November 17, 2026 14:46
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

# Conflicts:
#	src/v2/runtime.ts

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found 4 potential issues (1 high, 3 medium).

Open in Capy

Comment thread src/services/session.ts Resolved
Comment thread src/services/client.ts Resolved
Comment thread src/services/capture.ts Resolved
Comment thread src/services/session.ts Resolved
MaheshtheDev and others added 3 commits November 21, 2026 16:53
… with session capture

Strip <private> blocks and drop fully private turns before the raw session
leaves the machine, honor captureEveryNTurns (flushing before V2 compaction),
keep the client-formatted capture for legacy API servers, and key session
cursors by backend URL and namespace.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Capy review completed with all four issue findings resolved. Commits after the reviewed d7c0e8e were read: 353bafa (private redaction, cadence, legacy path, per-destination cursors), 40d0c85 (capture deleted sessions from the last idle snapshot), 607e6e2 (version 2.2.0). Checks green, no conflicts with main.

@capy-ai
capy-ai Bot merged commit 0d9cbcb into main Nov 23, 2026
2 checks passed
MaheshtheDev added a commit to supermemoryai/supermemory that referenced this pull request Nov 24, 2026
opencode-supermemory 2.2.0 (supermemoryai/opencode-supermemory#114) sends whole sessions on v5 and keeps client capture on legacy; src/config.ts getApiVersion defaults custom baseUrl values to legacy.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.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.

3 participants