Answer a policy-refused memory sync with 400 and its reason, not 503 - #709
Merged
davidmckayv merged 3 commits intoOct 2, 2026
Merged
Conversation
sync() saves a PluginRefusedError's message on the source and rethrows, but the memory routes' onError only mapped the memory errors, so the refusal reached the person as "Memory is unavailable. Try again."
Chebaleomkar
requested review from
MikeRyanDev,
davidmckayv,
guidovizoso,
mxmzb and
tylerslaton
as code owners
October 2, 2026 19:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
sync()inserver/src/memory/ingestion.tstreats aPluginRefusedErroras a refusal to show the person: it saves the message as the source'ssyncErrorand rethrows. The memory routes'onErroronly mappedMemoryNotFoundErrorandMemoryRefusedError, so the refusal fell through to503 "Memory is unavailable. Try again."and was logged asmemory-route-error.It now maps to 400 with the refusal's message, as
plugins/routes.tsdoes for the same error.Where it runs
Server:
POST /api/memory/sources/:id/sync, andPOST /api/memory/sources, whose first sync takes the same path.Boundary and audit
None. The refusal is decided and recorded as before; only the status code and body change.
Changelog
Entry under Unreleased.
Proof
New test in
server/tests/memory.test.ts. It fails onmain(expected 400, received 503) and passes with the fix (8/8). Servertscand Biome format and lint are clean.