fix(ui): stop reconnect and polling loops when the host thread is gone

Aperta
#43 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
devtools

Direzione di ricerca

Start with ReconnectLoop.run in src/ui/reconnect.ts (lines 26-37), where retries currently ignore everything except StopReconnectError. Then check how the host_thread_missing error reaches the logs and stream panels (src/ui/logs-panel.ts around 239-243, src/ui/simulator-panel.ts around 518), and the timers in src/ui/plugin-updates.ts:48 and src/ui/simulator-panel.ts:776. Done means that a missing thread stops every timer and shows "Session closed" in the panel, and that the loop no longer calls the host.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Problem

When the Codex thread behind a panel is gone, UI panels keep calling the host forever. Host calls fail with MCP error -32600: thread not found, and the panel retries roughly every 10 s with no end.

Cause

  • ReconnectLoop.run (src/ui/reconnect.ts:26-37) retries every error that is not a StopReconnectError, with backoff capped at 10 s.
  • "thread not found" arrives as a JSON-RPC McpError, not an isError result, so src/ui/logs-panel.ts:239-243 never turns it into a stop.
  • The stream panel starts the same loop at src/ui/simulator-panel.ts:518.
  • These other timers also never check for a dead thread:
    • the plugin-update interval (src/ui/plugin-updates.ts:48)
    • device-apps discovery (src/ui/simulator-panel.ts:776)

Commit 44f1b66 now classifies host_thread_missing as session_closed and stops reporting it, so it disappears from Sentry. The loop still hits the host, and probably adds to the "App server request queue is full" errors.

Evidence (Sentry)

Suggested fix

Treat host_thread_missing as terminal in these places:

  • ReconnectLoop
  • the logs and stream receive paths
  • device-apps discovery
  • the plugin-update interval

Then stop all timers and show "Session closed" in the panel.

Lingua principale
C++
Stelle
243
Fork
21
Merge medio
15h 6m
PR unite (30g)
57

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di callstackincubator/codex-mobile-dev-plugin

Tutte le issue di callstackincubator/codex-mobile-dev-plugin

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.