Repository navigation
Description
桌面端 Bug 反馈;经用户明确授权提交,使用 AI 协助整理。
关联但不直接等同:#51105 记录正常完成后的子会话延续不重建路由;本报告额外提供新建子会话首次调用前就释放路由的两组现场时序。与 #58419 共享外层错误,但平台、子会话条件和日志证据不同,尚未确认共同根因。
订阅类型:本次未采集。版本来自安装包标识,未读取 About 对话框。
Bug 反馈:Windows Codex 子智能体的内置浏览器路由在首次调用前被释放
摘要
Windows Codex 客户端会为子智能体创建独立的内置浏览器(IAB)路由,但在部分子会话中,路由在首次浏览器调用前就被释放。子智能体随后执行 cua.getBrowser({ id: "iab" }),返回 Browser is not available: iab。同一子会话开始后续回合后仍然失败。主会话在同一调查期间可以连接 IAB。
已确认故障发生在客户端会话路由层。客户端实现还存在一条可复现的风险路径:通用 idle 通知结束浏览器活动,并删除被标记为临时的子路由,后续 active 不重建路由。现场具体是否由该 idle 分支触发,尚未捕获原始通知或调用栈,因此仍属推断。
环境与影响
| 项目 | 观测值 |
|---|---|
| 调查日期 | 2026-11-04 |
| 系统版本 API 返回值 | Windows 10.0.19045.0,未独立核查完整系统版本标签 |
| 客户端安装包 | OpenAI.Codex_26.1029.7803.0_x64,Windows Store 包 |
| 浏览器后端 release | 26.1029.61003 |
| 浏览器工具 | mcp__cua_repl.js,选择器 iab |
| 使用方式 | 主会话通过 collaboration.spawn_agent 创建子智能体 |
| 用户影响 | 委派的浏览器验收无法开始;可能被误报为整个应用的内置浏览器不可用 |
客户端与浏览器后端属于不同组件,两种版本号不一致本身不是版本不兼容的证据。
复现步骤
前置条件:启用 Computer Use,主会话可使用 IAB,并可创建子智能体。无需访问公司内网或业务数据。
-
在主会话中执行以下调用。首次使用时遵守工具的初始化要求,将它作为单独的一次工具调用:
let browser = await cua.getBrowser({ id: "iab" });
-
确认主会话连接成功。后续独立调用可用返回的
browser.browserId列出标签;空标签列表不表示浏览器不可用。 -
创建一个诊断子智能体,要求它只进行以下操作,不使用外部浏览器、不读写业务数据:
先按 CUA 首次调用要求,单独执行: let browser = await cua.getBrowser({ id: "iab" }); 若失败,再执行:await cua.listBrowsers(); 报告结果;不要把子会话失败推断为主会话或整个应用失败。 -
观察子智能体的返回值,同时按子会话 ID 筛选客户端日志中的
IAB_LIFECYCLE事件。 -
向同一个子智能体发起后续诊断回合,沿用 CUA 状态,再次执行
getBrowser与listBrowsers。
以上是已发生故障的最小操作路径,尚未在其他设备或其他版本上确认复现率。
预期与实际结果
预期: 子智能体开始浏览器工作时,它自己的 IAB 路由有效。初始化空闲或回合切换不应让之后的合法调用永久失去路由。若产品不支持此类子会话,应提前返回明确的能力限制,而不是先创建后释放路由并返回泛化的不可用错误。
实际: 子路由在首次调用前被释放。新建诊断子会话中,捕获路由约 29 毫秒后即释放,约 15 秒后的首次 getInfo 失败。getBrowser 返回 Browser is not available: iab,浏览器清单仅有已连接的 Edge 扩展,没有 IAB。开始后续回合后仍失败。
日志证据
以下时间为日志原始 UTC;北京时间为 UTC+08:00。会话标识已一致替换为别名,未更改事件顺序、时间戳或错误类型。
样本 A:原始故障
2026-11-04T07:34:10.371Z info [browser-session-registry] IAB_LIFECYCLE captured session route conversationId=CHILD_A disposeAfterSessionActivity=true ownerWebContentsId=1 windowId=1
2026-11-04T07:34:10.375Z info [browser-session-registry] browser_use_iab_backend_startup_ready backend=iab platform=win32 release=26.1029.61003 sessionId=CHILD_A
2026-11-04T07:34:10.393Z info [browser-session-registry] IAB_LIFECYCLE created browser use host conversationId=CHILD_A routeKey=1:CHILD_A windowId=1
2026-11-04T07:34:10.394Z info [browser-session-registry] IAB_LIFECYCLE disposed browser use route conversationId=CHILD_A windowId=1
2026-11-04T07:34:10.394Z info [browser-session-registry] IAB_LIFECYCLE ended browser use session activity conversationId=CHILD_A disposeAfterSessionActivity=true windowId=1
2026-11-04T07:34:26.135Z warning [browser-use-iab-api] IAB_LIFECYCLE iab backend info request failed conversationId=CHILD_A errorMessage="No ChatGPT browser route is available for browser session CHILD_A" errorName=Error
这组日志证明:后端启动完成后,路由仍可能先被释放;startup_ready 不等于首次调用时仍有有效路由。
样本 B:新建诊断子智能体
2026-11-04T07:46:13.943Z info [browser-session-registry] IAB_LIFECYCLE captured session route conversationId=CHILD_B disposeAfterSessionActivity=true ownerWebContentsId=1 windowId=1
2026-11-04T07:46:13.972Z info [browser-session-registry] IAB_LIFECYCLE disposed browser use route conversationId=CHILD_B windowId=1
2026-11-04T07:46:13.972Z info [browser-session-registry] IAB_LIFECYCLE ended browser use session activity conversationId=CHILD_B disposeAfterSessionActivity=true windowId=1
2026-11-04T07:46:28.659Z warning [browser-use-iab-api] IAB_LIFECYCLE iab backend info request failed conversationId=CHILD_B errorMessage="No ChatGPT browser route is available for browser session CHILD_B" errorName=Error
第二轮复测:沿用同一子会话和 CUA 状态,getBrowser 仍返回相同错误,listBrowsers 仍仅有 Edge。该样本未访问业务页面或修改设置。
样本范围与对照
- 在新建诊断样本之前,检索 2026-11-02 至 2026-11-04 的本地会话,找到 8 个由 CUA 调用实际返回此错误的会话,全部是子智能体。其中 7 个发生于 11 月 4 日;当天有 6 个执行过浏览器清单检查,均仅有 Edge。
- 新建诊断样本 B 额外复现一次,并在同一子会话的后续回合中再次失败。
- 主会话在同一调查期间成功连接 IAB、创建标签、导航、读取页面 AX 树并获取截图。该对照并非与每个失败请求严格同时执行。
- 此样本集合按错误检索得到,没有统计所有成功子会话的分母,不能据此声称“所有子智能体必定失败”。
已确认事实与推断
| 结论 | 证据等级与边界 |
|---|---|
| 子路由在首次浏览器调用前已经释放 | 已确认:样本 A、B 的客户端日志与调用记录 |
| 连接失败的直接原因是会话无可用路由 | 已确认:底层错误明确写出 No ChatGPT browser route is available |
| 客户端包含为子智能体建立独立路由的实现 | 已确认:读取已安装包中的 captureChildSessionRoute |
通用 idle 分支可以删除子路由,后续 active 在该监听器中不重建 |
已确认的代码行为:静态读取及提取函数回放;通知由测试注入 |
现场由初始化 idle 触发了提前清理 |
高可信推断:代码路径和时序吻合;缺少原始通知与调用栈,尚不能排除其他 endSessionActivity 调用方 |
| 故障属于客户端生命周期缺陷,而非产品预期限制 | 高度疑似:子路由创建实现、提前清理及恢复缺口支持此判断;尚无官方确认 |
| 网络代理、业务页面或登录态导致本次错误 | 无支持证据:失败发生在会话路由查找层;未完成全面网络排除,不能扩展为所有网络问题均已排除 |
| 候选修改已经修复客户端 | 未确认:仅在提取副本上验证,未安装、未完成真实子会话修复验收 |
实现定位与原因分析
来源:已安装 app.asar 中的 .vite/build/early-bootstrap-632-62c641245a52ef0e.js。本次仅做读取和本地副本验证。
captureChildSessionRoute(childId, parentId)从父会话继承窗口信息,但使用子会话自己的browserConversationId,并设置disposeAfterSessionActivity=true。- 通用内部通知监听器在
thread/status/changed且status.type=idle时调用endSessionActivity。该分支没有验证此前是否开始过回合,也没有按回合 ID 或代次过滤过期状态。 endSessionActivity既释放会话控制权,也在上述标记为 true 时调用disposeBrowserUseRoute。- 同一个监听器没有处理 active 状态的路由恢复。浏览器连接入口
prepareSessionRoute在canServeSession失败时直接抛错。 - 另有子智能体生命周期监听器,在显式 completed、interrupted 和中断开始时调用清理。归档也有独立清理入口。
原 JavaScript 文件 SHA-256:c16675e64dae86bdb09f7720f038a8c2f2beacf0e85bbadd369f407d38662aa4。
建议修复点
优先在客户端会话生命周期层修复,保持子会话独立身份和窗口归属校验。
- 将控制权释放与路由销毁拆分。 通用 idle 可释放当前控制权;不要仅凭 idle 就销毁仍可能开始或继续运行的子会话路由。以明确的子会话/回合终态、关闭或归档等事件决定销毁,并检查事件代次。
- 明确回合恢复策略。 真正结束后若允许同一子智能体继续运行,应在后续回合开始时重新捕获其合法路由;不要让恢复只能依赖初次
thread/started。缺路由时的重建必须验证父窗口归属,不应借用任意主会话的路由。 - 增加清理原因日志。 记录触发通知、状态前后值、回合 ID/代次及清理调用方,让提前释放可以直接归因。
- 返回更具体的错误。 区分“后端不可用”“该会话无路由”“窗口已销毁”和“子会话能力不支持”,避免将单一会话故障泛化为整个 IAB 不可用。
本地候选修改仅验证第 1 点的一种实现:给 endSessionActivity 增加 retainSessionRoute 参数,通用 idle 调用传 true,显式生命周期清理沿用销毁行为。它是待评审方案,不是可直接部署的补丁。
已执行验证及限制
对从安装包提取的 captureChildSessionRoute、endSessionActivity 和通知监听器做函数级回放;Electron 窗口、通知源与部分依赖使用替身。
- 原版:注入“创建子路由 → idle → active”,确认路由被删除且不重建。
- 候选:同一序列保留原子路由,同时释放控制权。
- 直接调用显式清理仍删除路由;归档通知仍删除路由;父路由、其他子路由和未知会话处理符合断言。
- 共 8 项断言通过,候选 JavaScript 语法检查通过。
限制: “显式完成”和“显式中断”两项回放都直接调用同一个清理方法,没有独立覆盖真实完成/中断通知分发。测试不证明真实 Electron 通知顺序正确,也不证明长期路由回收无泄漏。
建议开发侧补充真实端到端用例:初始化 idle 后首次调用;同一子会话第二回合;完成/中断/归档;父窗口关闭;断线重连;并行子会话隔离;过期 idle 通知晚到;重复清理;长时间运行的路由回收。
当前状态与附件
故障仍存在。未修改已安装客户端,未修改安装目录权限或关闭完整性检查,未完成候选修复的真实端到端验收。
可随此报告提交的本地附件:
evidence.log:两个现场样本的脱敏日志。replay.cjs、extracted-functions.json:提取函数及回放脚本,执行node replay.cjs。replay-results.json:回放结果及验证边界。candidate-replacements.json:候选修改的 3 处精确替换。
附件不包含完整客户端代码、公司业务页面截图、业务日志、账户名称、凭据、浏览器配置或完整会话历史。本报告正文通过 GitHub 提交。上述 ZIP 和独立附件未上传;复现步骤、现场日志、原因分析和验证边界均已包含在正文中。
Activity
github-actions commentedon Nov 4, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
github-actions commentedon Nov 4, 2026
English translation:
Desktop bug report; submitted with the user's explicit authorization and organized with AI assistance.
Related, but not directly equivalent: #51105 documents continuation of a child session after normal completion without rebuilding its route; this report additionally provides two sets of observed event timings in which routes were disposed before the first call in newly created child sessions. It shares the outer error with #58419, but the platform, child-session conditions, and log evidence differ. A common root cause has not been confirmed.
Subscription type: not collected this time. The version comes from the installation package identifier; the About dialog was not read.
Bug report: Windows Codex subagent's built-in browser route is disposed before the first call
Summary
The Windows Codex client creates separate built-in browser (IAB) routes for subagents, but in some child sessions, the route is disposed before the first browser call. When the subagent subsequently executes
cua.getBrowser({ id: "iab" }), it returnsBrowser is not available: iab. It continues to fail when the same child session starts a subsequent turn. The main session could connect to IAB during the same investigation.The failure has been confirmed to occur at the client's session-routing layer. The client implementation also contains a reproducible risk path: a generic
idlenotification ends browser activity and deletes child routes marked as temporary, and a subsequentactivedoes not rebuild the route. Whether this particular incident was triggered by thatidlebranch remains an inference, because the original notification or call stack has not been captured.Environment and impact
10.0.19045.0; the full system version label was not independently verifiedOpenAI.Codex_26.1029.7803.0_x64, Windows Store package26.1029.61003mcp__cua_repl.js, selectoriabcollaboration.spawn_agentThe client and browser backend are different components. Their differing version numbers are not, by themselves, evidence of version incompatibility.
Steps to reproduce
Prerequisites: Computer Use is enabled, the main session can use IAB, and subagents can be created. No access to a company intranet or business data is required.
Execute the following call in the main session. On first use, follow the tool's initialization requirements and make this a separate tool call:
Confirm that the main session connects successfully. A subsequent separate call can use the returned
browser.browserIdto list tabs; an empty tab list does not mean the browser is unavailable.Create a diagnostic subagent and ask it to perform only the following operations, without using an external browser or reading or writing business data:
Observe the subagent's return values while filtering
IAB_LIFECYCLEevents in the client logs by the child-session ID.Start a subsequent diagnostic turn with the same subagent, retain the CUA state, and execute
getBrowserandlistBrowsersagain.The above is the minimal sequence of operations in which the failure has occurred. The reproduction rate has not yet been confirmed on other devices or versions.
Expected and actual results
Expected: When a subagent begins browser work, its own IAB route is valid. Initialization idle states or turn transitions should not permanently deprive subsequent valid calls of their route. If the product does not support this type of child session, it should return a clear capability limitation upfront, instead of creating and then disposing the route and returning a generic unavailable error.
Actual: The child route is disposed before the first call. In a newly created diagnostic child session, the route was disposed approximately 29 milliseconds after capture, and the first
getInfoapproximately 15 seconds later failed.getBrowserreturnsBrowser is not available: iab, and the browser list contains only the connected Edge extension, with no IAB. It continues to fail after a subsequent turn starts.Log evidence
The times below are the original UTC timestamps from the logs; Beijing time is UTC+08:00. Session identifiers have been consistently replaced with aliases. Event order, timestamps, and error types have not been changed.
Sample A: Original failure
These logs demonstrate that even after backend startup completes, the route can still be disposed before use;
startup_readydoes not mean a valid route remains available at the time of the first call.Sample B: Newly created diagnostic subagent
Second test turn: using the same child session and CUA state,
getBrowserstill returned the same error, andlistBrowsersstill contained only Edge. This sample did not access business pages or change settings.Sample scope and control
Confirmed facts and inferences
No ChatGPT browser route is availablecaptureChildSessionRoutein the installed packageidlebranch can delete a child route, and a subsequentactivedoes not rebuild it in that listeneridletriggered premature cleanup in the observed incidentendSessionActivitycannot yet be ruled outImplementation location and cause analysis
Source:
.vite/build/early-bootstrap-632-62c641245a52ef0e.jsin the installedapp.asar. This investigation involved only reading it and testing a local copy.captureChildSessionRoute(childId, parentId)inherits window information from the parent session, but uses the child session's ownbrowserConversationIdand setsdisposeAfterSessionActivity=true.endSessionActivityonthread/status/changedwhenstatus.type=idle. This branch neither checks whether a turn has previously started nor filters stale states by turn ID or generation.endSessionActivityboth releases session control and callsdisposeBrowserUseRoutewhen the flag above is true.prepareSessionRoute, throws an error immediately whencanServeSessionfails.Original JavaScript file SHA-256:
c16675e64dae86bdb09f7720f038a8c2f2beacf0e85bbadd369f407d38662aa4.Suggested fixes
Prioritize a fix at the client session-lifecycle layer, preserving independent child-session identities and window ownership validation.
thread/started. Rebuilding a missing route must validate parent-window ownership and must not borrow an arbitrary main session's route.The local candidate change tested only one implementation of item 1: add a
retainSessionRouteparameter toendSessionActivity, pass true from generic idle calls, and retain destruction behavior for explicit lifecycle cleanup. This is a proposal awaiting review, not a patch ready for direct deployment.Validation performed and limitations
Function-level replay was performed on
captureChildSessionRoute,endSessionActivity, and the notification listener extracted from the installation package; test doubles were used for Electron windows, notification sources, and some dependencies.Limitations: The “explicit completion” and “explicit interruption” replays both directly called the same cleanup method, without independently covering real completion/interruption notification dispatch. The tests do not prove that real Electron notifications occur in the correct order, nor do they prove that long-term route reclamation is leak-free.
Suggested additional real end-to-end cases for developers: first call after initialization idle; second turn in the same child session; completion/interruption/archiving; parent-window closure; reconnection after disconnection; isolation of parallel child sessions; late arrival of stale idle notifications; repeated cleanup; and route reclamation during long-running operation.
Current status and attachments
The failure persists. The installed client has not been modified, installation-directory permissions have not been changed, integrity checks have not been disabled, and real end-to-end acceptance testing of the candidate fix has not been completed.
Local attachments available for submission with this report:
evidence.log: sanitized logs for the two observed samples.replay.cjs,extracted-functions.json: extracted functions and replay script; runnode replay.cjs.replay-results.json: replay results and validation limitations.candidate-replacements.json: 3 exact replacements for the candidate change.The attachments do not contain complete client code, screenshots of company business pages, business logs, account names, credentials, browser profiles, or complete session histories. The body of this report is submitted through GitHub. The ZIP and individual attachments mentioned above have not been uploaded; the reproduction steps, observed logs, cause analysis, and validation limitations are all included in the body.
yifei-ambr commentedon Nov 24, 2026
macOS confirms the fresh-child failure. On desktop 26.1117.41037 (build 29803), the child's in-app browser route was ready at +2 ms and disposed at +7 ms. Its first browser call at ~10 s returned
Browser is not available: iab. The parent opened the same URL. The same child failed again on its next turn.Reproduce in a local desktop chat
https://developers.openai.com/codex/app/browserwith its own hidden in-app browser and report the title.about:blankin its own in-app browser.Triage request. Could the desktop Browser/Subagents owner confirm the tracking issue or name a build to retest? A passing build lets the same child open its own tab on both turns, and ending one child leaves a sibling in the same window usable.
Why initial idle matters, and where to look
The child route was captured with
disposeAfterSessionActivity=true. At its firstgetInfo, the desktop log reportedIAB browser belongs to another task.An independent run of the bundled app-server (0.171.0-alpha.13) emittedidle → active → turn/startedat startup andidle → turn/completedat finish. Replaying initial idle against the installed desktop listener callsendSessionActivityand removes the provisional route in the fixture. The historical log records disposal without identifying the caller.A candidate fix would capture the child's validated route on every authoritative turn start and clean up on a matching terminal event. Keep ownership checks, interruption and archive cleanup. For asynchronous disposal, tie cleanup to the exact route instance so it cannot remove a replacement. Static inspection of 26.1120.41243 (build 30607) found the same idle branch; runtime behavior on that build remains unverified.
Optional regression fixture · Node.js · no dependencies
Save the block as
child-browser-lifecycle.test.cjsand runnode --test child-browser-lifecycle.test.cjs. The startup assertion failed against the installed listener and passed against this synchronous reference policy. All six tests passed. Mutation checks caught eager idle cleanup, skipped recapture, stale starts and completions, omitted archive cleanup, lost capture retries, and window-wide teardown. The desktop acceptance check above covers real browser behavior.