Persistence route answers 5xx (503 on PUT/PATCH/DELETE) with no server-side trace: log them with a request id
What happens
On a deployment behind a reverse proxy, the browser saw PUT /api/persistence/documents/:id/stage, PATCH /api/persistence/runtime/sessions/:id/status and DELETE /api/persistence/runtime/sessions/:id answer 503 while GET/POST on the same route answered 200/201. The chat autosave then looped (new :generation:N session per attempt, see #1558).
Why it could not be diagnosed
app/api/persistence/[...path]/route.ts has exactly one 503 (PERSISTENCE_DEV_TOKEN_MISSING) and it does not depend on the method; the storage package never answers 503; and the route logs nothing for a 5xx. From the server side there was no way to tell whether those 503s left the app at all or were produced in front of it — the only evidence was the browser's network tab, with no id to correlate.
Ask
Log every 5xx leaving the persistence route with method, path, status, error code and a request id, and echo the id (x-request-id) on the response, so a failing save can be matched between browser and server log. A 5xx with no matching server line then provably did not come from the app.
Source: THU-MAIC/OpenMAIC