Skip to content

旧 Feishu 目标选择卡片和断开的 VS Code app-server 会导致无法选择会话 / 回调超时 #684

Description

@chaojidagehu-hub

类型

bug

你遇到的问题 / 你想做什么

问题

使用飞书 /list / /use 选择工作区和会话时,如果 codex-remote daemon 或 VS Code Codex app-server 曾经重启/断开,旧的 target picker card 仍然可点击,但会出现以下问题:

  1. 只能选择工作区,无法稳定选择会话
  2. 飞书提示:目标回调服务超时未响应
  3. 工作区可能显示为 Microsoft VS Code,而不是实际项目目录
  4. 旧卡片仍绑定旧的 daemon/app-server 生命周期,点击后不能正确完成
  5. VS Code Codex 扩展可能保持 broken stdin pipe,导致项目工作区不再自动重新注册

环境

  • OS: Windows 11
  • codex-remote-feishu: v1.8.4
  • VS Code extension: openai.chatgpt-26.602.71036-win32-x64
  • VS Code integration: managed_shim
  • workspace example: C:\Users\<USER>\Desktop\二隧报告

你希望最后变成什么样

希望用户在服务重启、VS Code app-server 断开或旧卡片过期时,不会遇到“无法选择会话”或“目标回调服务超时未响应”。

期望结果:

  • 旧 Feishu picker card 应该快速提示“卡片已过期,请重新发送 /list”
  • 已断开的 app-server instance 不应继续作为可选目标展示
  • VS Code app-server 断线后能自动重连 / 重新注册当前 workspace
  • picker 能明确区分真实项目 workspace、headless workspace、内部安装目录实例
  • Feishu callback 不应阻塞到平台超时

相关证据

观察到的日志 / 现象

旧卡片仍绑定旧进程

点击旧卡片时,relay 日志里仍能看到旧 lifecycle/pid:

surface.target_picker.select_workspace ...
card_lifecycle=2026-06-10T03:02:33.2495389Z|pid:12448

后续飞书侧提示:

目标回调服务超时未响应

workspace instance 已经断开

项目 workspace 曾经注册成功:

relay instance connected:
workspace=C:/Users/<USER>/Desktop/二隧报告
display=二隧报告
source=vscode

随后断开:

relay instance disconnected:
workspace=C:/Users/<USER>/Desktop/二隧报告
display=二隧报告
source=vscode

错误/混淆的 workspace 显示

有时 picker 里出现并可选择:

Microsoft VS Code

对应日志:

workspace=C:/Users/<USER>/AppData/Local/Programs/Microsoft VS Code
display=Microsoft VS Code
source=vscode

这容易让用户选到 VS Code 安装目录,而不是项目目录。

VS Code Codex 扩展保持 broken pipe

VS Code Codex 扩展日志:

[CodexMcpConnection] Attempted to send app-server message but stdin is destroyed
[CodexMcpConnection] Codex process fatal error errorMessage="Codex process errored: Codex process is not available"
[CodexWebviewProvider] Fatal error message="Codex process errored: Codex process is not available"
remote_connections.manager_state_set ... nextState=error

这种状态下,项目 workspace 没有自动重新注册,需要手动重启 app-server 或重载 VS Code/Codex。

已知约束 / 担心点

建议修复方向:

  1. Feishu card 增加 daemon generation/startup id

    • 生成卡片时写入 current generation
    • callback 时如果 generation 不一致,立即返回“卡片已过期,请重新 /list”
  2. Feishu callback fast-ack + async processing

    • HTTP 回调里不要同步等待 app-server/session 查询
    • 先快速 ack,再异步更新卡片/消息,避免平台超时
  3. instance 增加健康状态

    • connected / stale / disconnected / reconnecting
    • 使用 heartbeat/lastSeen 检测
    • /list 默认隐藏 stale/disconnected instance
  4. VS Code app-server 自动重连

    • 检测 stdin destroyed / process not available
    • 自动重启 app-server 并重新注册当前 workspace
  5. 避免把安装目录当普通 workspace 展示

    • 例如 AppData/Local/Programs/Microsoft VS Code 这类路径可以隐藏、降级或标记为 internal

这个问题对新用户影响比较大:安装看起来成功,但后续会在选择会话时卡住或选到错误 workspace。

补充说明

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:needs-investigationNeeds technical investigation before implementation can be scoped safely

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions