[codex] 修复 Host Bridge 失联恢复、执行租约与慢文件阻塞 - #778
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题与结果
一次 Host Bridge Probe 超时会结束 Core 的关键任务、关闭已有聊天连接;旧客户端也把一次心跳失败永久记为 lease 失效。恢复连接若继续隐式创建 manager,还可能把旧执行句柄接到空执行表。
本 PR 将运行期 UNAVAILABLE / DEADLINE_EXCEEDED 限定为宿主执行能力降级,Core 保持运行并继续探测。健康探测不持有执行租约;业务首次调用显式 OpenManager,后续续期和业务 RPC 只能使用已存在的 manager。Exec/stdin/文件请求不自动重放。
文件读写、编辑、目录遍历在有界线程中执行;RPC 取消仍等实际磁盘操作结束后才释放文件锁和 manager operation。聊天页读取 AppRuntime 的短命状态,区分宿主降级、状态未知和恢复。
本 PR 只提交评审,未合并、未部署。按维护者要求,评审后再决定合并与部署。
Change intent
change_type: fixsemantic_delta: breaking(RUN-013 运行期失败范围 + 同 release 私有 OpenManager RPC)capability_owner: mixed(Core 监督、Bridge lease、ShellProcessManager 执行、Web 状态展示)consumer_scope: Host Bridge Shell/File consumers 与 Web 聊天;Native Mobile 本次不增加状态 UI。runtime_patch: required;仅浏览器重连无法阻止 Core 退出,也不能保证执行句柄仍属原 manager。authoritative_state_owner: 既有 MessageLog、ShellProcessManager、Bridge boot/manager lease;AppRuntime monitor 唯一更新连接状态。client_only_alternative: 不可行。concept_gate: required;改变运行监督、lease 生命周期与私有协议。protected_state: 正式 workspace、Session/Message、项目、记忆、插件持久状态与原执行 owner。改动与恢复
agent/host_bridge: typed RPC error、首次 manager 登记、existing-only 续期、运行监控恢复、文件 I/O 排空。bootstrap: AppRuntime 状态、精确只读 HTTP 路由及公开 Web Shell 代理。frontend/chat/src: 实际挂载状态提示,5 秒轮询/超时,恢复清除。docker/debug: 可重跑的真实 UDS/磁盘/进程故障实验与 Chromium 组件实验。db215d872d56c35cff15129f458d89535ad0cad8;恢复点为该提交及本地 baseline archive。e52e95395496d274c8a1cd572c679e888d3bb2303befff137372a40e64479d80。本地验证
pytest -q tests:44 passed。--check。npm run typecheck。.venv/bin/python docker/debug/host_bridge_reliability.py:8 组通过。node docker/debug/host_bridge_notice.mjs:真实 React/Chromium 验证降级提示、恢复清除、HTTP 错误显示未知、local mode 无提示。证据边界与已知风险
正交性与概念完整性
gpt-5.6-terra,reasoningxhigh。c4bf90a6043b28e0608fbd9746c3d88c7402e92d;最终结论:pass,0 must-fix。HostBridgeStatus,由 AppRuntime monitor 独占;不进入 Root/Fiber health,不写持久化 readiness。工作手册