[GH-ISSUE #1277] [Issue]: 429 rate-limit retry storm freezes the UI when the autonomous scheduler runs with multiple tabs open #624

Closed
opened 2026-10-20 17:30:54 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @GetBeholder on GitHub (May 26, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1277

Originally assigned to: @cha1latte on GitHub.

Summary

With the autonomous scheduler running (server-autonomous-scheduler.service)
and Marinara Engine open in two browser tabs, the app gets into a 429 "Too Many
Requests" retry storm: requests such as GET /api/chats and
PATCH /api/chat-folders/{id} repeatedly return 429 and are retried in a tight
loop, rendering the UI unusable in both tabs. Restarting the backend did not
clear it (the open tabs immediately resumed). Triggered twice. The reporter
rates this as non-critical / fringe.

Expected behavior

When the backend returns 429, the client should back off (ideally honoring
Retry-After), avoid a tight retry loop across multiple tabs, and keep the UI
usable rather than freezing. Repeated 429s should not be able to lock the app.

Actual behavior

The clients retry 429 responses repeatedly; with two tabs open (and the
autonomous scheduler also generating traffic) this sustains a 429 storm. The
backend keeps returning 429 and the UI becomes unusable on both tabs. Restarting
the backend kept it in the loop state because the open tabs immediately resumed
hammering the endpoint.

Steps to reproduce

  1. Self-host the ME backend and open the app in two browser tabs.
  2. Start/launch the autonomous scheduler (server-autonomous-scheduler.service).
  3. Observe repeated 429 responses on requests such as GET /api/chats and
    PATCH /api/chat-folders/{id}, retried in a loop; both tabs' UIs become
    unusable.
  4. Restart the backend with the tabs still open → the loop resumes.

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: not provided
  • Run mode: self-hosted HTTP backend on 127.0.0.1:7860, accessed via browser (two tabs). Backend logs are Fastify/pino (Node); hostname "phoenix".
  • OS + version: Linux inferred (systemd .service, SIGINT) — not explicitly stated
  • Node + pnpm versions: not provided
  • Rust version, if relevant: not provided
  • Remote Runtime URL configured? Effectively yes — self-hosted backend at 127.0.0.1:7860
  • Provider, model, or integration, if relevant: not relevant

Logs, screenshots, or video

Browser console:

XHR GET http://127.0.0.1:7860/api/chats
[HTTP/1.1 429 Too Many Requests 0ms]

Backend (pino), looping until SIGINT:

{"level":30,"time":1779686066260,"pid":317234,"hostname":"phoenix","reqId":"req-yry","req":{"method":"PATCH","url":"/api/chat-folders/u75j_6BIBwfw0zv5Ew22x","host":"127.0.0.1:7860","remoteAddress":"127.0.0.1","remotePort":52010},"msg":"incoming request"}
{"level":30,"time":1779686066261,"pid":317234,"hostname":"phoenix","reqId":"req-yry","res":{"statusCode":429},"responseTime":0.0964,"msg":"request completed"}
{"level":30,"time":1779686066263,"pid":317234,"hostname":"phoenix","reqId":"req-yrz","req":{"method":"PATCH","url":"/api/chat-folders/u75j_6BIBwfw0zv5Ew22x","host":"127.0.0.1:7860","remoteAddress":"127.0.0.1","remotePort":52010},"msg":"incoming request"}
{"level":30,"time":1779686066263,"pid":317234,"hostname":"phoenix","reqId":"req-yrz","res":{"statusCode":429},"responseTime":0.0838,"msg":"request completed"}
^C{"level":30,"time":1779686066265,"pid":317234,"hostname":"phoenix","msg":"Received SIGINT; shutting down Marinara Engine"}

Regression notes

Not provided.

Additional context

Source: forum report by Era [GS] (2-Star), ~7:27 AM yesterday. The reporter notes
this is not critical and they couldn't pinpoint where it happens in the code, but
filed it so the team can decide whether to control this fringe behavior.

Triage pointers (from a scan, not from the reporter):

  • Client retry on 429: src/features/catalog/chats/hooks/use-chats.ts (~L112-117)
    explicitly treats 429 as retryable up to 10 attempts with exponential backoff
    capped at 5s, with no cross-tab coordination and no Retry-After handling.
    With multiple tabs and additional autonomous traffic, several queries/mutations
    each retrying on 429 can sustain a request storm.
  • A Marinara autonomous service exists at
    src/engine/modes/chat/autonomous/autonomous.service.ts (and
    src/features/modes/conversation/hooks/autonomous/use-autonomous-messaging.ts).
    Whether server-autonomous-scheduler.service is this feature or the reporter's
    own systemd unit running the server is unconfirmed.
  • Backend mismatch to confirm: the 429 responses and Fastify/pino logs indicate a
    Node backend that implements rate limiting, but the current refactor Rust
    runtime (src-tauri/src/http_server.rs) does not appear to implement 429 rate
    limiting. The reporter may be on an older or different self-hosted backend.
    Maintainers should confirm which backend is in scope; the client-side retry
    behavior above is present in the current refactor regardless.

Template check

Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @GetBeholder on GitHub (May 26, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1277 Originally assigned to: @cha1latte on GitHub. ## Summary With the autonomous scheduler running (`server-autonomous-scheduler.service`) and Marinara Engine open in two browser tabs, the app gets into a 429 "Too Many Requests" retry storm: requests such as `GET /api/chats` and `PATCH /api/chat-folders/{id}` repeatedly return 429 and are retried in a tight loop, rendering the UI unusable in both tabs. Restarting the backend did not clear it (the open tabs immediately resumed). Triggered twice. The reporter rates this as non-critical / fringe. ## Expected behavior When the backend returns 429, the client should back off (ideally honoring `Retry-After`), avoid a tight retry loop across multiple tabs, and keep the UI usable rather than freezing. Repeated 429s should not be able to lock the app. ## Actual behavior The clients retry 429 responses repeatedly; with two tabs open (and the autonomous scheduler also generating traffic) this sustains a 429 storm. The backend keeps returning 429 and the UI becomes unusable on both tabs. Restarting the backend kept it in the loop state because the open tabs immediately resumed hammering the endpoint. ## Steps to reproduce 1. Self-host the ME backend and open the app in two browser tabs. 2. Start/launch the autonomous scheduler (`server-autonomous-scheduler.service`). 3. Observe repeated 429 responses on requests such as `GET /api/chats` and `PATCH /api/chat-folders/{id}`, retried in a loop; both tabs' UIs become unusable. 4. Restart the backend with the tabs still open → the loop resumes. ## Impact area - [ ] App shell, navigation, startup, or providers - [ ] Catalog resources - [ ] Chat mode - [ ] Roleplay mode - [ ] Game mode - [ ] Shared mode UI - [ ] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [ ] React-free engine behavior, contracts, agents, or capability ports - [x] Shared API wrapper or remote runtime routing - [ ] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: not provided - Run mode: self-hosted HTTP backend on `127.0.0.1:7860`, accessed via browser (two tabs). Backend logs are Fastify/pino (Node); hostname "phoenix". - OS + version: Linux inferred (systemd `.service`, SIGINT) — not explicitly stated - Node + pnpm versions: not provided - Rust version, if relevant: not provided - Remote Runtime URL configured? Effectively yes — self-hosted backend at `127.0.0.1:7860` - Provider, model, or integration, if relevant: not relevant ## Logs, screenshots, or video Browser console: ``` XHR GET http://127.0.0.1:7860/api/chats [HTTP/1.1 429 Too Many Requests 0ms] ``` Backend (pino), looping until SIGINT: ``` {"level":30,"time":1779686066260,"pid":317234,"hostname":"phoenix","reqId":"req-yry","req":{"method":"PATCH","url":"/api/chat-folders/u75j_6BIBwfw0zv5Ew22x","host":"127.0.0.1:7860","remoteAddress":"127.0.0.1","remotePort":52010},"msg":"incoming request"} {"level":30,"time":1779686066261,"pid":317234,"hostname":"phoenix","reqId":"req-yry","res":{"statusCode":429},"responseTime":0.0964,"msg":"request completed"} {"level":30,"time":1779686066263,"pid":317234,"hostname":"phoenix","reqId":"req-yrz","req":{"method":"PATCH","url":"/api/chat-folders/u75j_6BIBwfw0zv5Ew22x","host":"127.0.0.1:7860","remoteAddress":"127.0.0.1","remotePort":52010},"msg":"incoming request"} {"level":30,"time":1779686066263,"pid":317234,"hostname":"phoenix","reqId":"req-yrz","res":{"statusCode":429},"responseTime":0.0838,"msg":"request completed"} ^C{"level":30,"time":1779686066265,"pid":317234,"hostname":"phoenix","msg":"Received SIGINT; shutting down Marinara Engine"} ``` ## Regression notes Not provided. ## Additional context Source: forum report by Era [GS] (2-Star), ~7:27 AM yesterday. The reporter notes this is not critical and they couldn't pinpoint where it happens in the code, but filed it so the team can decide whether to control this fringe behavior. Triage pointers (from a scan, not from the reporter): - Client retry on 429: `src/features/catalog/chats/hooks/use-chats.ts` (~L112-117) explicitly treats 429 as retryable up to 10 attempts with exponential backoff capped at 5s, with no cross-tab coordination and no `Retry-After` handling. With multiple tabs and additional autonomous traffic, several queries/mutations each retrying on 429 can sustain a request storm. - A Marinara autonomous service exists at `src/engine/modes/chat/autonomous/autonomous.service.ts` (and `src/features/modes/conversation/hooks/autonomous/use-autonomous-messaging.ts`). Whether `server-autonomous-scheduler.service` is this feature or the reporter's own systemd unit running the server is unconfirmed. - Backend mismatch to confirm: the 429 responses and Fastify/pino logs indicate a Node backend that implements rate limiting, but the current refactor Rust runtime (`src-tauri/src/http_server.rs`) does not appear to implement 429 rate limiting. The reporter may be on an older or different self-hosted backend. Maintainers should confirm which backend is in scope; the client-side retry behavior above is present in the current refactor regardless. ## Template check Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:30:54 +07:00
Author
Owner

@cha1latte commented on GitHub (May 26, 2026):

fixed in #1318

<!-- gh-comment-id:4549496164 --> @cha1latte commented on GitHub (May 26, 2026): fixed in #1318
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#624
No description provided.