Skip to content

fix: show document content in the memory tool's list mode - #121

Open
ishaanxgupta wants to merge 2 commits into
mainfrom
ishaan/audit-fixes
Open

ishaanxgupta wants to merge 2 commits into
mainfrom
ishaan/audit-fixes

Conversation

@ishaanxgupta

@ishaanxgupta ishaanxgupta commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What

The supermemory tool's list mode returned content: null for every memory. There were two causes:

  1. memory-tool.ts mapped memory.summary, which is null for v5 documents.
  2. In v5-client.ts, content hydration fetched each listed document and kept its content only if document.metadata.sm_scope equaled the requested scope. The v5 API leaves reserved sm_* keys out of document reads, so the check never passed and content was always dropped.

Fixes:

  • list maps summary || content || title, the same order compaction and the v2 runtime already use.
  • Hydration rejects a document only when it states a different scope. The list request already filters by sm_scope on the server, which still works because sm_scope is one of the API's searchable reserved keys (SEARCHABLE_RESERVED_METADATA_KEYS). A missing key no longer drops the content.

Release

2.1.1 in package.json and src/version.ts.

Tests

  • bun run test: 36 pass, 0 fail. bun run typecheck is clean.
  • New v5-client.test.ts:
    • content is hydrated when the read has no sm_* keys;
    • content is skipped when the document says sm_scope: personal during a project list.
  • New memory-tool.test.ts case: list shows the content when summary is null.
  • Both new tests fail on main and pass here.

Prod check (sandboxed HOME, fresh OAuth sign-in, 2026-10-29)

I saved one memory with the tool's add mode under the throwaway tag repo_audit_test_opencode_list__0123456789abcdef. That tag matches the scoped-tag pattern, so the sm_scope filter path runs. Then I ran list mode against prod on each version:

main: {"count":1,"memories":[{"id":"LAqDnThmUWm1rNkcwbbzJM","content":null}]}
this: {"count":1,"memories":[{"id":"LAqDnThmUWm1rNkcwbbzJM","content":"Audit test (safe to delete): OpenCode list-mode check, 2026-10-29. This project builds with bun."}]}

Reading the same document directly from prod returns metadata keys ["type","project"] with no sm_scope, even though it was saved with sm_scope: project.

The test blocked the client's startup PATCH /v3/settings so it wouldn't change org settings.

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