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

未关闭
#43 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
devtools

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
C++
星标
243
派生
21
平均合并
15 小时 6 分钟
30 天内合并 PR
57

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

callstackincubator/codex-mobile-dev-plugin 的其他 Issue

查看 callstackincubator/codex-mobile-dev-plugin 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。