Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ Completed conversations are captured automatically:
- Synthetic plugin context is excluded and `<private>` content is redacted.
- Stable capture IDs retain batch identity across repeated lifecycle events; they do not guarantee exactly-once processing or billing after an ambiguous response.

On OpenCode 2, each directory keeps its own tools and hooks, and only handles events for its sessions. Accepted capture batches and fully submitted turn fingerprints are recorded in host plugin storage, scoped to the API destination, namespace, directory and session. Reloads and restarts suppress those confirmed uploads; a storage read error defers capture rather than treating history as unsaved. Failed writes remain retryable without a permanent attempt cap.

Older versions kept acceptance only in memory, so the first resume after upgrading has no durable evidence of earlier uploads and may retry historical content. Original host transcripts and configuration are retained; no historical batch is invented as accepted. A timed-out request may also have reached the server: neither stable IDs nor a queued acceptance proves exactly-once processing. If an ACK cannot be persisted, it is retained across same-process replacement, but a process exit before storage recovers still leaves that uncertainty. The existing 100,000-character upload limit remains; truncated turns are not recorded as fully submitted.

### Keyword Detection

Say "remember", "save this", "don't forget" etc. and the agent auto-saves to memory.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opencode-supermemory",
"version": "2.0.17",
"version": "2.0.18",
"description": "OpenCode plugin that gives coding agents persistent memory using Supermemory",
"type": "module",
"main": "dist/index.js",
Expand Down
9 changes: 9 additions & 0 deletions src/services/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,14 @@ export class SupermemoryClient {
rawContent.length > MAX_CONVERSATION_CHARS
? `${rawContent.slice(0, MAX_CONVERSATION_CHARS)}\n...[truncated]`
: rawContent;
let submittedMessageCount = 0;
let submittedLength = `[Conversation ${conversationId}]\n`.length;
for (const [index, message] of messages.entries()) {
submittedLength += `${index + 1}. ${this.formatConversationMessage(message)}`.length;
if (submittedLength > MAX_CONVERSATION_CHARS) break;
submittedMessageCount += 1;
submittedLength += 1;
}

const ingestMetadata = {
type: "conversation" as const,
Expand Down Expand Up @@ -734,6 +742,7 @@ export class SupermemoryClient {
success: true as const,
...response,
storedMemoryIds: savedIds,
submittedMessageCount,
};
}
}
Expand Down
Loading
Loading