Skip to content

Stop writing org settings on startup; apply filterPrompt to the project namespace - #120

Draft
MaheshtheDev wants to merge 2 commits into
mainfrom
capy/stop-writing-org-settings
Draft

MaheshtheDev wants to merge 2 commits into
mainfrom
capy/stop-writing-org-settings

Conversation

@MaheshtheDev

@MaheshtheDev MaheshtheDev commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Every plugin start called PATCH /v3/settings with { shouldLLMFilter: true, filterPrompt }, in both v5 and legacy mode. That overwrote the organization's context (/organization reads and writes the same filterPrompt column). Sentry puts about 47.7K calls/30d from 799 users on this path (Supermemory/JS 4.0.0). Spec: SCR-306.

No org settings write

  • getClient() no longer calls settings.update, and V5Client no longer takes the legacy settings client.
  • filterPrompt has no built-in default anymore. Unset, empty, or over 1500 characters means "not configured".

A configured filterPrompt goes to the project namespace

  • On v5, the plugin calls PATCH /ns/{namespace} with supportingContext once per namespace at startup (V1 init and OpenCode 2 session tag resolution). It's best-effort with a 3s timeout and no retries, and failures are logged.
  • Captures, compaction summaries and memory-tool writes now send the configured prompt as their per-document supportingContext instead of the built-in coding-agent context. The API upserts document supportingContext onto the namespace, so without this the next capture would overwrite the PATCH. It also covers the cases where the PATCH can't land: a namespace that doesn't exist yet (404), a non-admin key (403) and the legacy protocol, which has no /ns route.
  • Without a configured prompt, nothing changes for captures and no settings call is made.

Other

  • supermemory-legacy (supermemory@4.0.0) stays, because it's still the content client for custom servers on the legacy protocol.
  • README: rewrote the 2.0.16 paragraph about the legacy settings update and added filterPrompt to the config sample. CHANGELOG entry added, version bumped to 2.1.1 (on top of main's 2.1.0). Merging publishes through release.yml.

Verification

  • bun run typecheck, bun test (37 pass) and bun run build all pass.
  • The new src/services/client.test.ts runs the real client in a subprocess against a local request recorder with a temp HOME config. It checks four cases: v5 with no prompt (no settings call and no PATCH), v5 with a prompt (one PATCH /ns/{ns} with the trimmed prompt and no org call), a prompt over the limit (ignored), and legacy with a prompt (no settings call and no PATCH). On main, the same recorder shows PATCH /v3/settings in both v5 and legacy mode.
  • Live check against api.supermemory.ai on a throwaway namespace: the startup PATCH got a 404 on the new namespace and logged it, the first capture set supportingContext to the prompt, a later startup PATCH restored it after a manual overwrite, and GET /organization still returned organizationalContext: null. The namespace was deleted afterwards.

Open in Capy

…ct namespace

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@MaheshtheDev
MaheshtheDev force-pushed the capy/stop-writing-org-settings branch from b4ba528 to 57f55b8 Compare October 29, 2026 06:52
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.

1 participant