supermemory icon indicating copy to clipboard operation
supermemory copied to clipboard

PATCH /v3/settings: filterPrompt is accepted but stored and returned empty (shouldLLMFilter persists)

Open johnmarktaylor91 opened this issue 2 months ago • 2 comments

Summary

PATCH /v3/settings accepts a filterPrompt but it is not stored. The response's updated.filterPrompt comes back empty, and a following GET /v3/settings also returns an empty filterPrompt. shouldLLMFilter: true in the same request is stored, so the org ends up with LLM filtering enabled and no filter instructions.

Steps to reproduce

  1. PATCH https://api.supermemory.ai/v3/settings with a JSON body such as:
    { "shouldLLMFilter": true, "filterPrompt": "<plain-English instructions, ~450 characters, no special characters beyond punctuation>" }
    
  2. Inspect the response.
  3. GET https://api.supermemory.ai/v3/settings.

Sending filterPrompt on its own (without shouldLLMFilter) behaves the same way.

Expected

updated.filterPrompt and the subsequent GET return the submitted prompt, as in the examples in the Customization and Update settings docs.

Actual

  • The PATCH returns 200 with orgId, orgSlug and updated, where updated.shouldLLMFilter is true and updated.filterPrompt is an empty string.
  • The GET returns shouldLLMFilter: true and an empty filterPrompt.
  • There is no error or validation message explaining why the prompt was dropped.

Questions

  • Is filterPrompt restricted by plan tier, length, or some other precondition that isn't documented? If so, could the API return an error rather than silently dropping it?
  • With shouldLLMFilter: true and an empty prompt, what does the filter do: pass everything, or apply a default?

Environment

  • REST API called directly (Python, JSON body, bearer API key), 2026-09-23.
  • Reproduced twice, with identical results.

johnmarktaylor91 avatar Sep 23 '26 04:09 johnmarktaylor91

ENG-1278

linear-code[bot] avatar Sep 23 '26 04:09 linear-code[bot]

One adjacent contract boundary seems worth pinning in the regression: the current customization guide documents filterPrompt as 1–750 characters, but the shared OrganizationSettingsSchema currently declares it as z.string().nullable().optional() with no min/max constraint (while workspacePrompt does carry an explicit max).

So a persistence-only fix could make the reported ~450-character prompt round-trip while still leaving the documented input contract unenforced or silently coercing/dropping boundary values. I’d pair the main regression with boundary validation through the same public settings path: a valid prompt round-trips exactly (including 1 and 750 chars), while empty / >750 input follows the documented rejection contract rather than returning 200 with a different stored value.

That also gives a clean invariant for the original bug: any 2xx PATCH response should reflect the value that will subsequently be returned by GET, unless the API explicitly documents a normalization.

84dnnvbdvp-debug avatar Sep 23 '26 07:09 84dnnvbdvp-debug