Skip to content

fix: 适配 ChatGPT Desktop 26.810 拆分后的 Renderer 请求桥(修复 Harness 全部连接失败 / 适配器一直安装中) - #113

Closed
zleo-ai wants to merge 2 commits into
BytePioneer-AI:mainfrom
zleo-ai:fix/renderer-request-manager-desktop-26810
Closed

zleo-ai wants to merge 2 commits into
BytePioneer-AI:mainfrom
zleo-ai:fix/renderer-request-manager-desktop-26810

Conversation

@zleo-ai

@zleo-ai zleo-ai commented Sep 1, 2026

Copy link
Copy Markdown

改了什么

让 Renderer 请求管理器探测兼容新版 ChatGPT Desktop(Linux deb 26.810.52044 实测)拆分后的桥形状,修复外部 Harness 全部报 Renderer Model request manager is unavailable、Renderer 适配器一直停留在「安装中」的问题(对应 #103,与 #40 的诊断输出一致但根因不同)。

为什么

在 26.810.52044 上通过 desktop-controller 的 inspector endpoint 做只读探测,发现 composer fiber hook 里的桥对象已经拆开:

  • hook state(manager):hostId / getHostId() / sendRequest / 会话状态方法都在,但 onNotification、onRequest、dispatchAppServerResponse、prewarmedThreadManager 属性没有了;
  • manager.requestClient:只剩 { sendRequest, prewarmThreadStart },enqueueRequest 在整棵 fiber 树里都不存在;
  • discardAllPrewarmedThreads 的宿主对象还在,但换了挂载位置(嵌套在 manager 内部若干层)。

现有探测要求这些字段同时出现在单个对象上,因此 FIND_REQUEST_MANAGER_EXPRESSION 永远 0 命中 → installDraftPrewarmPolicy 装不上 → __codexhostDraftPrewarmPolicyV1 始终 undefined → resolveRendererRequestRoute 每个非空分支都要求 policy ready,所以六个 Harness 的连接检查全部失败。

同时审计了这些缺失接口的实际用途:enqueueRequest / onResult / onError / onNotification / onRequest / dispatchAppServerResponse 只在 Remote Control 桥路径使用(均在 isRemoteControlHost 门内),本地 Host 一次都不会调用;prewarmedThreadManager 只在 policy.clear() 用到。

怎么改的

  • renderer-draft-prewarm-policy.ts:探测不再硬性要求 requestClient.enqueueRequest;prewarmedThreadManager 按「manager 自有属性 → 有界嵌套搜索(深度 ≤3、每层前 50 个 key)→ no-op 兜底」解析,结果缓存在 manager 上保证 owns() 身份稳定,避免反复重装。
  • renderer-draft-prewarm-runtime.ts:上述远控专用接口全部改为可选;队列路径在桥不支持 enqueueRequest 时抛出明确的 transport 错误(fail loud),不再假设方法存在;onNotification / dispatchAppServerResponse 只在原函数存在时才包装、dispose 时对称恢复。
  • versioned-renderer-adapter.ts:兜底发现逻辑新增拆分形状分支(manager 带 hostId/getHostId + requestClient 带两个函数),旧的单对象桥匹配保持不变。

怎么验证的

  • npm run check、npm run test:typescript 全绿(1603 个用例),新增 3 个针对拆分形状的回归用例(本地安装、幂等 reconcile、兜底发现)。
  • Linux 实机(Ubuntu,ChatGPT deb 26.810.52044,GNOME/XWayland):打补丁前 __codexhostDraftPrewarmPolicyV1 永远 undefined;打补丁后 policy 安装成功(state: ready, hostId: local),并经该通道对 claude-code / pi / grok / omp / deepseek-harness / opencode 六个 Harness 逐一调用 codexhost/harness/inspect,全部返回 status: "ready" 和完整模型目录(此前该调用 100% 抛 Renderer Model request manager is unavailable)。
  • 旧版单对象桥形状的行为由既有 1600 个用例覆盖,未改动其语义。

已知限制

  • Remote Control 桥依赖 enqueueRequest 等接口,在新版 Desktop 上这些接口不存在;本 PR 让它明确报错而不是静默挂起,完整适配远控路径可能需要按 Desktop 版本做进一步映射。
  • cargo test -p codexhost-platform 的 managed_launch_supervises_the_desktop_executable_directly 在我的环境上失败,但在未改动的 main(dabc767)上同样失败(进程监督类测试的环境问题),与本 PR 无关。

🤖 Generated with Claude Code

https://claude.ai/code/session_019SC8vE7uxiX9LnNkHRrUHM

ChatGPT Desktop 26.810.52044 splits the composer request bridge into a
request client that only exposes sendRequest/prewarmThreadStart and a
manager that owns hostId and conversation state; enqueueRequest and the
prewarmedThreadManager property are no longer reachable from the hook
state. The existing single-object probe therefore never matches, the
draft prewarm policy is never installed, and every external Harness
fails with 'Renderer Model request manager is unavailable' while the
Renderer adapter stays in 'installing'.

- Relax the desktop-control probe: enqueueRequest is no longer required,
  and the prewarmed Thread manager is resolved from the manager's own
  property, a bounded nested search, or a no-op fallback cached on the
  manager for stable owns() identity.
- Treat the remote-control-only bridge surfaces (enqueueRequest,
  onResult/onError, onNotification/onRequest/dispatchAppServerResponse)
  as optional; the queued-request path now fails loudly when the bridge
  cannot queue instead of assuming the method exists.
- Teach the renderer-extension fallback discovery the split manager
  shape while keeping the legacy single-object bridge matching.

Verified on Linux against ChatGPT 26.810.52044: the policy installs
(state ready, hostId local) and codexhost/harness/inspect returns ready
catalogs for all six local Harnesses.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019SC8vE7uxiX9LnNkHRrUHM
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

…wn-command frames

Two follow-up gaps surfaced by verifying against the live connections
panel rather than the transport alone:

- isRendererRequestTarget still validated the policy's requestTarget
  through isCurrentRequestBridge, which requires hostId on the request
  client; the split shape keeps hostId on the manager, so the resolver
  returned null and the panel kept reporting 'Renderer Model request
  manager is unavailable' even with the policy installed. Route
  resolution now also accepts the split manager shape.
- Current Pi builds reply to unknown commands with an error frame that
  omits the request id, so the graceful PiRpcUnsupportedCommandError
  degradation never ran and inspections faulted at the capabilities
  stage. Id-less unknown-command frames are now routed back to the
  unique pending command they name; anything else still faults.

Verified on Linux against ChatGPT 26.810.52044 with Pi 0.73.1: the
Renderer adapter reaches state ready and all six local Harnesses report
availability ready in the binding probe that feeds the connections
panel. (OpenCode additionally required upgrading the local CLI to match
the SDK version pinned by the adapter; that is an environment fix, not
a code change.)

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019SC8vE7uxiX9LnNkHRrUHM
@zleo-ai

zleo-ai commented Sep 1, 2026

Copy link
Copy Markdown
Author

追加第二轮修复(6e85a57):只修 policy 探测还不够——policy 装上后,路由侧 isRendererRequestTarget 仍用 isCurrentRequestBridge 校验 requestTarget()(要求 requestClient 带 hostId),拆分形状下依旧返回 null,面板照样报同一个错。这轮①让 policy 路由接受拆分形状;②顺带修了 Pi 新版(0.73.1 实测)未知命令错误帧不带 id 导致优雅降级分支永远走不到、inspect 在 capabilities 阶段假死的问题。实机验证(Linux + 26.810.52044):binding probe 显示 adapter ready,六个本地 Harness availability 全部 ready——这次验证走的是连接面板自己的数据源,不是旁路 transport。附注:OpenCode 报 Provider list 超时是本机 CLI(1.18.18)低于适配器钉的 SDK(1.18.25),升级 CLI 即好,非代码问题。

@BytePioneer-AI

Copy link
Copy Markdown
Owner

你好,感谢你的贡献。
我想确认一下,这个BUG是否仅在linux系统中复现。因为我手中的mac、windows环境下都是正常的

@zleo-ai

zleo-ai commented Sep 5, 2026

Copy link
Copy Markdown
Author

补充一下这个 PR 里其实叠了两件独立的事:

  1. ChatGPT Desktop 26.810 请求桥拆分(adapter 一直「安装中」/ Renderer Model request manager is unavailable)。你问的「是不是只在 Linux 复现」指的是这一件。我这边只在 Linux + ChatGPT deb 上实机打过,Mac / Windows 没有对拍。
  2. Pi 0.73.1 未知命令错误帧不带 id,导致 Pi inspect 在 capabilities 阶段整段失败、连接面板把 Pi 标红。这和 Desktop / 操作系统无关,用 pi --mode rpc 直接打就能复现。

第二件已经拆成独立 PR,方便和 Desktop 讨论脱钩:#161

#113 可以继续只审 Desktop 请求桥那部分。

@BytePioneer-AI

Copy link
Copy Markdown
Owner

按维护者确认关闭,不合并此旧版 Renderer 请求桥兼容方案。此前审查指出其基于旧桥结构,并存在以 no-op 兜底预热清理的语义问题;关闭本 PR 不代表所有环境下的连接错误已验证修复。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants