You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
未替换本机已安装服务,未修改真实 CC Switch 配置。未做 macOS/Linux 实机验证或全仓库测试。原始运行日志、账号配置、本地探针脚本与内部计划均未提交。
CI diagnosis
此前 PR 检查的两项失败已逐项查看,不能将整套 CI 表述为通过:
Static checks 的 21 个 ESLint 错误均位于本 PR 未修改的 7 个文件。上游 v0.28.0 基线 CI run 45862964126 出现完全相同的 21 项错误(逐行规范化比较一致)。这些文件包括 desktop-mcp-bridge.test.ts、renderer-handoff-control.test.ts 和 Web Server 的来源文件/测试。
Check windows-latest 失败在 packages/adapters/antigravity/test/background-lifecycle.real.test.ts 的 does not detach an ordinary tool for a pending Approval,报 Timed out: ordinary tool completed。本 PR 未改动该适配器及测试;Windows 本机针对整个文件复跑 6 项通过,上游上述 0.28 基线的 Windows 检查也通过。尚未在本地复现该超时,不通过放宽等待或删除断言掩盖它。
这些基线问题未混入来源透传修复;本 PR 的代码差异仍限于原先 6 个文件。更新分支后的整套 CI 结果另以 GitHub 检查为准。
This change passes the Desktop-provided originator variable through to the official Codex process, so requests sent through the shared Host keep their Desktop origin. The variable follows the connected Desktop's lifecycle, and idle backends are rebuilt when it changes. No actionable merge-blocking risk was found. macOS and Linux were not verified on real machines.
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
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.
Summary
共享 Host 过滤掉了 Codex Desktop 自带的
CODEX_INTERNAL_ORIGINATOR_OVERRIDE。管理连接先初始化官方 app-server 时,原生 HTTP 请求因此带上 Host 管理来源;Windows 上实测同一 AgentRouter 配置从原生 Codex 可用,经 Host 返回401 unauthorized_client_error。将该变量纳入唯一的 Desktop 连接上下文白名单,原值传给官方 Codex,让官方实现继续生成
originator和 User-Agent。已有的上下文更新、空闲后端重建、活动任务保护、断开回退及 Remote Control 分支统一覆盖来源变量;变量缺失或没有在线 Desktop 时,清除服务中失效的 Desktop 来源,不持久化它。不修改管理连接的
clientInfo,不设置固定 UA,不引入供应商特例,不扩大为透传全部CODEX_*。User-Agent 尾部附加信息仍由官方多连接实现管理,本改动只恢复真实来源和 UA 来源前缀。Related issues
Closes #1251
UI Demo
No visual changes: 仅修改共享 Host 的原生进程上下文传递、对应测试与官方流量归属文档。
Test plan
v0.28.0基线d0b08922;补丁本身未改变,在该基线上两个相关文件的 59 项测试和定向 ESLint 均通过。node node_modules/vitest/vitest.mjs run --config tests/vitest.config.js packages/host-runtime/test/local-shared-host.test.ts packages/host-runtime/test/native-account-host.test.ts。node node_modules/typescript/bin/tsc -b packages/host-runtime --pretty false通过;干净检出时先构建其使用的harness-discovery依赖。git diff --check。26.1120.6357.0、Codex CLI0.171.0-alpha.13.2、CC Switch4.0.42):在独立数据目录中启动修复版共享 Host 和真实 Desktop bridge,使用官方codex.exe。本地 HTTP 捕获确认originator=Codex Desktop,UA 来源前缀来自 Desktop,尾部仍保留 Host 的真实管理客户端名称。turn/completed,status=completed,回复OK,没有请求头覆写。使用已有本地模型目录,不依赖上游模型拉取接口。测试覆盖来源原值/缺失、排除其他不相关环境变量、空闲更新、活动任务保护、恢复、多个 Desktop 断开后的上下文回退与清除,以及 Remote Control 保持原调用参数时的上下文更新。
实机验证以原生请求完成通知和 HTTP 捕获为依据。隔离 Desktop bridge 正常退出后,测试 Host 收尾超过探针的 8 秒限时;清理脚本终止了该测试服务,并确认没有测试进程残留,不能把该探针退出码视为完整服务启停检查通过。
未替换本机已安装服务,未修改真实 CC Switch 配置。未做 macOS/Linux 实机验证或全仓库测试。原始运行日志、账号配置、本地探针脚本与内部计划均未提交。
CI diagnosis
此前 PR 检查的两项失败已逐项查看,不能将整套 CI 表述为通过:
Static checks的 21 个 ESLint 错误均位于本 PR 未修改的 7 个文件。上游v0.28.0基线 CI run 45862964126 出现完全相同的 21 项错误(逐行规范化比较一致)。这些文件包括desktop-mcp-bridge.test.ts、renderer-handoff-control.test.ts和 Web Server 的来源文件/测试。Check windows-latest失败在packages/adapters/antigravity/test/background-lifecycle.real.test.ts的does not detach an ordinary tool for a pending Approval,报Timed out: ordinary tool completed。本 PR 未改动该适配器及测试;Windows 本机针对整个文件复跑 6 项通过,上游上述 0.28 基线的 Windows 检查也通过。尚未在本地复现该超时,不通过放宽等待或删除断言掩盖它。这些基线问题未混入来源透传修复;本 PR 的代码差异仍限于原先 6 个文件。更新分支后的整套 CI 结果另以 GitHub 检查为准。