Repository navigation
feat(host): Cindy 后台服务第一阶段,普通本地任务与桌面一致(个人版迁移 M1,单提交重提 #11536) - #11629
Merged
Merged
Conversation
Adds the Node Host (apps/host) so ordinary local tasks can run without a desktop window and behave as they do on the desktop, using the shared desktop code that the desktop prep PR (#11535) extracted. This is the same change as #11536, carried as one commit. #11536 has 717 commits, more than the DCO app can read (it retrieves 250 and reports that it cannot evaluate the pull request), so the required DCO check could not pass there. All 629 non-merge commits in #11536 are signed off by their author; the 88 merge commits are exempt. The full commit history, review threads and per-commit verification remain on #11536 at 8874aaf. The tree of this commit is identical to merging 8874aaf into main at 3af7adb. Assisted-by: Cindy (https://cindy.app) Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
zqchris
approved these changes
Nov 20, 2026
[High impact] The PR adds a background task service that shares account and task data with the desktop. 建议修复队列重建导致的回复丢失后再合并。 Findings
Fix with agent prompt### Issue 1
apps/host/src/agent/input-queue.mjs:756-761
。助手回复因磁盘已满或 SQLite 写入暂时失败时,`executor.close()` 会因 `history.hasFailedWrites()` 抛错。但这里的 `finally` 仍执行 `runtime = createRuntime()`,丢掉旧队列唯一的写入重试入口。下一次干净扫描会清理这个空的新队列并解除暂停;用户再点恢复,也无法保存旧回复。
请只在旧运行时成功清理后替换它;清理失败时保留未完成写入及其重试入口,并补上“回复写入失败 → 桌面占用 → 解除占用 → 恢复写入”的回归用例。
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
|
DavidShenXD
approved these changes
Nov 20, 2026
Keep SSH Pi endpoint probing and plugin engine switching unavailable on the Node Host while completing the shared port bindings. Assisted-by: Cindy (https://cindy.app) Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
A failed disposal leaves the old executor in place. Closing fences new input but permits another disposal; a later clean scan retries the original owner-scoped history writes and only rebuilds the runtime when disposal succeeds. Reopen from the desktop-written queue snapshot without replaying the old queue. Keep writes paused while storage fails and report the existing persistence error in the queue projection and request refusal. Retry at the existing scan cadence. Account-boundary disposal still retires the old runtime and closes its storage even if draining fails, so old-owner writes never follow a new owner. Cover release failure and recovery through the real input queue, and pin the shared switch handler refusal when Host leaves ACP admission unbound. Assisted-by: Cindy (https://cindy.app) Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
Record the remote Pi probe, the M1 limit for ACP engines, and the scope of the owned Windows reproduction. Assisted-by: Cindy (https://cindy.app) Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
DavidShenXD
approved these changes
Nov 20, 2026
The macOS background stage took 19,885 ms on the final #11536 run, 20,117 ms on the failing first #11629 run, and 12,146 ms after the port fix. The 20-second override was a readiness wait, with no performance assertion. Use the launcher default of 60 seconds. Keep the 90-second suite deadline, the lifecycle assertions and per-stage timings. Assisted-by: Cindy (https://cindy.app) Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
Assisted-by: Cindy (https://cindy.app) Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
…room Document what callers see while failed reply writes are pending and which refusal messages still describe a desktop hold. Clarify that the original 20-second wait from 6e11d2d was a launcher parameter. The first #11629 macOS run used about 82 of the 90 seconds allotted to the whole script before it could reattach. Assisted-by: Cindy (https://cindy.app) Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
The final #11536 macOS run took about 76.7 seconds across all stages. The first #11629 macOS run took 81.6 seconds across four stages before reattachment, leaving about eight seconds under the 90-second suite deadline. Keep the whole-script hang limit above twice the slowest observed run by raising it to 180 seconds. The 60-second readiness wait and Ubuntu performance review threshold are unchanged. The CI job allows 20 minutes. Assisted-by: Cindy (https://cindy.app) Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
…hold Record the slow macOS CI runs and distinguish the 180-second hang limit for the whole script from the 60-second readiness wait and performance review threshold. Assisted-by: Cindy (https://cindy.app) Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
DavidShenXD
approved these changes
Nov 20, 2026
This was referenced Nov 20, 2026
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.
这次改了什么
摘要
这是个人版迁移到 Cindy 后台服务(
apps/host)的第一阶段(M1)。目标是在不开桌面窗口时,普通本地任务也能由后台服务运行,并且和桌面一致:后台服务调用的是桌面准备 PR 拆出来的同一份共用代码,不另写一套。本 PR 依赖的桌面准备 PR #11535 已于 2026-11-19 合入 main(合并提交
ea5e289965)。本 PR 相对 main 的 diff 现在只剩后台服务这一部分。每项能力的现状、与桌面的差异和证据,都在
docs/host/personal-migration-release-table.md。本 PR 不打开迁移,是否开放迁移另行决定。和桌面的关系:
apps/desktop只改了三个测试文件(见下文“只在本 PR 里的三个桌面测试”)。变更类型
feat新功能fix缺陷修复refactor/perf重构或性能优化docs/test/chore文档、测试或工程维护(CI 新增后台服务验收步骤、系统代理对比 workflow)范围
apps/host:apps/web的 shim:读取类型化错误和启动失败码。docs/host下的文档。已知限制(仅限测试期)
迁移前必须解决,在那之前只是登记:
cindy-host login登录原账号。要换账号,先在窗口退出登录,再用cindy-host login登录新账号,然后重启后台服务。host_instance_changed),而且不提示原因。要重新打开 Cindy。089105c276、d9fc65bd15给桌面任务加了任务内搜索与安装,后台服务没有接,同时删掉了原来的兜底引导,所以这是同步 4 带来的退化;窗口里的插件设置装不上,是因为主干a7f5289e84把安装确认的答复委托给后台服务,窗口本地的确认被拒,这是主干原有的问题。另外窗口的官方市场取不到账号访问令牌,需要登录才能看到的插件可能直接看不到。两件都列为迁移前要解决,见放行表第五节。主干同步的合并提交
65619a35d3。它本身不能构建,要和紧随其后的端口补齐提交8bee8af5eb一起用。7f09da233d,准备分支上对应43a545067c,主干af8bd193a3。aafac71097,带进ca1232f084与97af5ce056),没有冲突。679b799da5合入准备分支(准备分支上1db8b978a4合入主干9354a65d1a),本 PR 侧没有冲突。之后eec45e4d65让后台服务和主干对齐:发送和移动只刷新已登记项目(touchRecentWorkdir),任务更新接受共用常量INDEFINITE_SNOOZE_UNTIL表示的无限期稍后处理。3ba205779d合入准备分支(准备分支上b9fa89f919合入主干5a92f62d24),本 PR 侧没有冲突。之后7b068f570a把主干新加的可选端口显式写成不绑定:主干 fix(model-groups): 修复首轮空交接,支持组内故障接替 #11406 的模型组失败恢复需要桌面登记模型组,后台服务没有对应入口(放行表第五节“主干同步 5 的 Host 接线”);Agent-Net 的供应商分享委派继续不绑定。1dd89e2966合入准备分支(准备分支上d76c822a05合入主干3ef44274d6,冲突只在deepLink.ts,见准备 PR),本 PR 侧没有冲突;主干这 61 个提交没有改apps/host。这批提交里后台服务没有对应入口的新功能清单在 PR 开出后补进放行表第五节“主干同步 6 的 Host 接线”。915dcd9847合入主干43fb1df105(已含 refactor(desktop): 为 Cindy 后台服务拆出共用的桌面逻辑(个人版迁移准备) #11535),没有冲突,锁文件与.nvmrc未变。主干e88f240ba6给 Pi 加了getLocalPiHttpsProxy,5feea98573照桌面pi-host.ts的判断顺序接上(有代理环境变量时不介入,否则经共用的 CLI 代理桥配后台服务自己的出站解析),并按改名后的cli-proxy-bridge.ts更新网络模块登记;其余主干提交没有需要补的接线(放行表第五节“主干同步 7 的 Host 接线”)。43fb1df105。readReplyQuoteNote、readBotThreadNote。8bee8af5eb的行为清单:main.ts判断 scoped 来源。入口同时透传options和thinking。supportsRemoteModelWindowRebuild,它在合并提交里被删掉了。agentCommands在异步读完任务后,再复核一次账号和运行时。forceReload;桌面占用期间忽略强制重载。confirmNativeHistoryFallback端口随主干移除。applyPendingPick。这是这次同步在发送路径上唯一的结构变化。同步 3 的后台服务接线:
48f3597f05新增了项目归档与恢复的远程入口,后台服务一并接上:refuseWhileHeld;进入任务锁后依次beforeWrite、assertCurrent、refuseWhileHeld,最后开事务。archiveOnRemoval按主干的共用逻辑不生效。apps/host/src/device-link.test.mjs。桌面占用期间
COEXISTENCE_RESCAN_MS);另外监听登记目录,有变动时去抖 250 毫秒后重扫。[PRECONDITION_FAILED] HOST_PROFILE_IN_USE_BY_DESKTOP: …,窗口提示“这份数据正被单独运行的 Cindy 电脑端使用。请先退出它,再发送。”(logic.errors.hostProfileInUseByDesktop;会改数据的其他操作用hostProfileInUseByDesktopRetry)。PRECONDITION_FAILED。PRECONDITION_FAILED;工具列表和任务历史搜索照常。server.mjs自己应答的入口(逐个登记,根目录源码契约scripts/__tests__/host-server-hold-classification.test.mjs有分类守护,由pnpm test:runner执行,新增入口不登记就失败):/chat为不存在的任务建任务(读完任务、建任务前同步查一次)。/chat的新任务在开流前被拒,返回 500 和chat_failed事件,与任务不存在时一样;已存在任务在开流后被队列拒,返回 200 和同一事件,这是原有行为。device-link-settings.json,与桌面是同一份文件、同一把跨进程锁,正在运行的桌面每 5 秒轮询跟随:关闭会断开桌面当前所有控制链路,撤销会断开对应设备;写之前先走两端共用的分享可用性策略,有登记时向账号区域的服务停用对应分享的可用性,并移除登记。理由:收紧方向的操作,只有本机持后台服务令牌的客户端能触发,占用期间后台服务的远程控制仍在线,撤销正是这时需要的。/control/stop的关停收尾(排空队列、在途用量入库、有条件写错误行)。/control/attachment、/control/platform、/web/pair、/web/session、/events与读接口、IPC 现有只读绑定。Agent-Net 设备身份是后台服务自己的记录,桌面不读写。改到主干已有代码的地方
c9e1fcd68e在后台服务上用固定的 Claude 默认路线做记忆自审,没有读用户的辅助模型设置和停用开关。本 PR 改为接上桌面已有的辅助模型链,以及两层停用判断。占用时不派发;已发出的请求,收据仍记到发起账号。桌面包装保留原来的默认端口和执行顺序。scripts/check-test-hygiene.mjs:文件 URL 的.pathname规则只扫apps/host/下的测试、夹具和脚本。文件 URL 转本地路径一律用fileURLToPath;HTTP URL 仍可以读.pathname。hygiene 基线没有增加。apps/host/scripts/lifecycle.e2e.mjs:ci.yml的 host-regressions 新增 4 步:只加载验收脚本的导入、provider-config、ipc-route、lifecycle。lifecycle 在 Windows 上跳过,那里最后一次 stop 有既有的 ECONNREFUSED 缺口。macos-system-proxy-compare.yml:在 GitHub 托管 runner 上改系统代理设置,比较后台服务和 Electron 的代理判定。只在手动触发时,或改了代理实现的 PR 上运行;脚本拒绝在 GitHub 托管 runner 以外启动。只在本 PR 里的三个桌面测试
apps/desktop/src/main/__tests__/authColdStartRecovery.test.ts、maker-host/__tests__/hostDesktopSourceContracts.guard.test.ts读后台服务的源码;cindy-brain/__tests__/hostToolSlot.test.ts不读,是随本 PR 新增的插件静默端口补桌面测试夹具一行。三个都要配本 PR 的后台服务代码,所以不进准备 PR。hostDesktopSourceContracts.guard.test.ts里一条只查表格式的用例已删除(434ed14264),对照真实依赖图的区域分类守护保留。UI 变化
怎么验证的
本 PR 自己的验证
git merge-tree --write-tree 3af7adb40e 8874aafb21得到4d76ad15ce,与首个提交4b3ae6befe的树相同。efa9a32054:feat(host): Cindy 后台服务第一阶段,普通本地任务与桌面一致(个人版迁移 M1) #11536 最后一次合并树检查用的 main 是ccfe8f3f45,之后进入 main 的f09ceba136给 Pi 加了只用于远程(SSH)路线的probeRemotePiProviderEndpoint,5dbf2a58c3给运行时切换加了插件引擎的admitPluginEngineTarget、describePluginEngine。后台服务没有远程 Pi,也不装配插件引擎,三个都写成不绑定,并登记进 Pi 专读端口组;守护没有改。首轮 CI 中,缺少这三个端口造成后台服务类型检查和端口分组守护失败。这两项在efa9a32054上通过。efa9a32054上这一项通过,首次启动、重复启动检查、替换启动、后台启动和重新接入分别用时 9842、12740、11214、12146、126 ms。profile-coexistence.test.mjs:82、:98)。两条在efa9a32054上均通过,Windows 首轮的失败原因仍未证实。8b829821a7保留历史写入失败的旧运行时。独立桌面退出后,若第一次解除占用遇到未保存的回复,后台服务保持暂停,在后续确认桌面已退出的扫描中重试,成功后才恢复任务执行。回归用例在旧实现上复现回复丢失,在修复后验证原回复只写入一次,输入没有被再次发送。21fc7c6d42将启停验收脚本的就绪等待改为沿用启动器的 60 秒默认值,保留原有断言和五阶段计时。首轮 macOS 在前四阶段已耗时约 82 秒,旧的 90 秒总期限只剩约 8 秒余量。823f2c7ce1按放行表原有规则把全脚本防挂死期限调到 180 秒,高于最慢实测用时的两倍。Ubuntu 的 60 秒耗时复评线仍适用。源码方式的本机启停验收通过。5f71023567上的 Windows 系统代理首次作业 通过五组辅助进程验收断言,随后在清理临时目录时遇到 LevelDB 文件占用并报EBUSY,未执行系统代理对照。仅重跑这一作业一次 后,五组断言及后续的系统代理对照全部通过,后台服务与 Electron 的 72 项代理结果一致。清理临时目录时的文件占用是验收脚本的时序问题,重试清理的修复在合并后单独提交。efa9a32054上的 CI 全部通过。最终提交5f71023567的 38 项检查全部通过。JavaScript/TypeScript 的 CodeQL 分析已结束,PR 合并引用上有 0 条打开的代码扫描告警。.nvmrc与根目录package.json与8874aafb21相同。8160a6ae86上复现了同一现象:100 轮里辅助进程在标准输入上收到 0 行,约 75 ms 后以 0 退出。该环境与用户会话不可比,不单独作为生产缺陷的证据;修复以8874aafb21上的 CI 验收为准。PR 首轮 CI 与评审修复(2026-11-19)
PR 开出后的首轮 CI 和机器人评审暴露了下面几项,都只改
apps/host和本 PR 新加的测试:outbound-path-fact一条用例取不到搜索程序7743e6f406usage-recording清理时数据库句柄未关(EBUSY)a7fa893117d681f5252a79a6e4b526、8160a6ae86/models回包在占用开始后才到,仍写共用的报价缓存和币种文件caf94959b05d0cec971a7ace44b2b7)59ea890ff5/49f68d81efa.example.com, b.example.com时,Host 仍走代理而 Electron 直连4f4e44ab8bb4ca7a687309bafa707dcli-proxy-bridge.tsgetLocalPiHttpsProxy并更新两张表;守护本身没改915dcd9847、5feea98573ef451931bc206bc30b3765a9cbad46、044bf9266e9001d67bf8a6d3182bf67b38ff47e3411cc62dd7b4fc30a9ff、b3cdf74ceamacos-system-proxy.test.mjs的 “a proxy that names a user is unresolved, and the user is in no log or judgement”);CI 的对比工作流在托管 runner 上验证不了这一条。lib/common/init.ts),helper 读到结束就正常退出,从未就绪;CI 上 20 轮都在 1 秒内以退出码 0 退出。后果:没有代理环境变量时,Windows 上的后台服务读不到系统代理(PAC、自动发现、手动代理),出站按直连处理,依赖代理才能联网的请求会失败。不会卡住启动:预热有 8 秒上限,单次解析约 2 秒,之后只在出站请求时按退避重试(最长 60 秒一次)。验收里那次挂到作业超时来自验收脚本本身,已一并修正。改用 IPC 后的第二轮失败同样是验收判据问题:父端断开后 Node 不发聚合 close,验收却在等它;生产按 exit 判断,未改(见上表411cc62dd7)。修法见上表9001d67bf8、a6d3182bf6、7b38ff47e3、411cc62dd7;8874aafb21 上 Windows 验收五组全部通过:20 轮启动全部就绪并返回 PAC 结果,断开到退出 61–136 ms(中位 95 ms),没有强杀;按生产方式启动、崩溃后重启、Host 被杀后不残留三组通过;随后的 Windows 系统代理对照 “All results agree.”。check:dco全部已签,合并提交豁免。8160a6ae86):Windows 的数据库检查跑到并通过;Windows 上的清理顺序与路径守护通过(Host 全量 1044/0);Ubuntu 上 lifecycle 通过,约 40 秒(first/busy/replacement/background/reattach 9959/10206/9841/9898/88 ms),低于 60 秒,这一项已结。自动验证
主干同步 6 之后的自有 macOS 补跑(PR 开出后,2026-11-19)。 文件监听正常的 Apple Silicon macOS,Node 22.22.3,准备分支
d76c822a05、集成分支49b01543ef,对照主干3ef44274d6;测试 HOME 用临时目录、不带登录凭据,除浏览器三项外只放行回环网络。test:lifecycle通过;两个浏览器文件(Chromium 1243)15/0/0,plugin-sandboxe2e 通过。codexHosted风险命令审批、startupProbe原生启动对比),主干同样失败。没有启动图形界面的 Electron。主干这 61 个提交对放行表前提的重验和“主干同步 6 的 Host 接线”清单已补进放行表第五节:唯一不再成立的一条是回复盖章(第五节甲 9),已在下面的首轮修复里对齐桌面。验证中发现的五项主干既有问题已登记为 #11545。
主干同步 4 之后,在文件监听正常的自有 macOS 机器上跑,Node 22.22.3,集成分支
eec45e4d65、主干9354a65d1a:868941897a上也跑过同样的一轮(Host 全量 1055/0/0;lifecycle first/busy/replacement/background/reattach 7993/7985/8030/8030/70 ms;两条文件监听登记用例 codexHosted 6 次、claudeHosted 3 次通过;Pi 18 条通过)。已执行,主干同样失败(都是主干既有项,不在本 PR 处理):
codexHosted.e2e的 “asks on this computer before Codex runs a risky command, and runs only what was approved”:失败方向是已批准的命令没有生效。“被拒命令没有执行”这一点,本轮没有断言出结果,不能当作权限边界已经验证。原因未定位,怀疑和外层隔离下 Codex 自带的命令沙箱不能嵌套有关,未证实。startupProbe.e2e的 “compares native startup with and without shortcuts”:原因未定位。这两条所在的目录,在主干和本分支逐字节相同。按规则字面有疑问、保留并说明理由的 4 项(放行人可以否决):
apps/host/src/agent/input-queue.test.mjs:4343(队列 API 成员都是函数):按静态契约登记。main.ts把无类型的队列对象强转成端口类型,编译器查不出缺成员,缺了要到运行时第一次调用才抛 TypeError。入口是真实队列工厂和startPorts();依据是这处类型强转;最小失败输入是从队列 API 删掉清单里任一成员;tier:guard(静态契约),不算行为覆盖。apps/host/src/device-link.test.mjs:474(入站分发端口的分类与测试里的副本对照):故意保留的副本对照,只起“改动必须两处同改”的提醒作用,保护权限边界:这张表决定桌面占用期间哪些端口放行、哪些拒绝。失效后果:有人把某个端口从“拒绝”或“过闸门”改成“只读放行”,旁边的完整性检查不会报,只有这条会。各类别的实际准入由行为用例覆盖:refused-at-entry(requestPluginOauth)和 service-gate 的dispatchLocalInvoke由第 297–306 行(占用期间发送、新建任务、预热、插件页调用、插件授权都被拒,没有一个到达处理函数)与第 187 行(项目归档执行被拒)覆盖;read 由第 307 行(占用期间读任务照常应答)覆盖一条,其余读端口没有逐个的行为用例;unbound 由第 360 行(未接的平台功能被拒)覆盖;service-gate 的executeTaskTags没有占用期间的行为用例。apps/host/src/startup-account.test.mjs第 38、174、215、284–384、470–508 行:入口是main.ts里的启动阻断、关库、跨区采用、续期排期这几个函数,测试从源码提取后执行,不经过serve装配。装配这一层由 lifecycle e2e 覆盖起停、附着与重连,没有覆盖阻断矩阵和续期回调是否传入。放行表第五节已记待办:M2 之前把这些函数移到可以直接 import 的模块,测试改为导入生产模块。apps/host/src/startup-account.test.mjs:759(测试夹具对子进程的环境隔离):没有生产入口,是保护测试不碰真实数据的守护。失效后果:测试拉起的后台服务子进程带着终端里的真实目录变量启动,可能读写用户的真实数据。故意保留。测试价值(新增 19 个、改写 35 个)
范围
43a545067c..61c00afebb(之后本轮新增的测试见末尾“本轮新增”)。新增 19 个文件(Host 18 个,其余 1 个),改写 35 个文件(Host 31 个,其余 4 个)。文件数包含apps/host/scripts的 6 个脚本式 e2e(新增 2 个,改写 4 个)。脚本中的独立check()或新增 PASS 场景按用例核对,无新增场景的lifecycle.e2e.mjs仍计为改写文件。仅计普通测试文件为新增 17 个、改写 31 个。表中行号均指对应测试文件在本 PR 快照中的位置。「本表」为本次补记。最小失败输入是源码所示的代表条件。已有注释已写明的项保留行号引用。tier 保留文件已有称呼,补记处注明测试实际使用的资源。尚未确认测试价值的个别用例在表后列为待评审。
apps/host/scripts/chromium-proxy-worker.e2e.mjsapps/host/scripts/release-region.e2e.mjsapps/host/src/agent/idle-release.test.mjsapps/host/src/agent/outbound-path-fact.test.mjsapps/host/src/agent/profile-coexistence.test.mjsapps/host/src/agent/usage-pricing.test.mjsapps/host/src/agent/usage-recording.test.mjsapps/host/src/chromium-proxy.test.mjsapps/host/src/macos-system-proxy.test.mjsapps/host/src/outbound-proxy.test.mjsapps/host/src/plugins/gateway-delivery.test.mjsapps/host/src/plugins/profile-pause.test.mjsapps/host/src/project-icon.test.mjsapps/host/src/release-region.test.mjsapps/host/src/server-api.test.mjsapps/host/src/service.test.mjsapps/host/src/test-support/hook-plugin-fixture.test.mjsapps/host/src/ui-text.test.mjsscripts/__tests__/host-skill-projection-owner.test.mjsapps/desktop/src/main/__tests__/authColdStartRecovery.test.tsapps/desktop/src/main/maker-host/__tests__/hostDesktopSourceContracts.guard.test.tsapps/host/scripts/claude-proxy.e2e.mjsapps/host/scripts/codex-runtime.e2e.mjsapps/host/scripts/pi-native.e2e.mjsapps/host/src/agent/codex-system-login.test.mjsapps/host/src/agent/engine-deps.test.mjsapps/host/src/agent/git-snapshot.test.mjsapps/host/src/agent/input-queue.test.mjsapps/host/src/agent/interactions.test.mjsapps/host/src/agent/memory.test.mjsapps/host/src/agent/native-auth.test.mjsapps/host/src/agent/provider-credentials.test.mjsapps/host/src/agent/session-update.test.mjsapps/host/src/auth/login.loopback.test.mjsapps/host/src/auth/refresh.test.mjsapps/host/src/boundary.test.mjsapps/host/src/credentials/store.test.mjsapps/host/src/device-link.test.mjsapps/host/src/host-tools.test.mjsapps/host/src/ipc-route.test.mjsapps/host/src/loaders/raw-hook.test.mjsapps/host/src/plugins.test.mjsapps/host/src/plugins/managed-skills.test.mjsapps/host/src/profile-path.test.mjsapps/host/src/server.test.mjsapps/host/src/sessions.test.mjsapps/host/src/startup-account.test.mjsapps/host/src/web-shim.test.mjsapps/host/src/agent/input-queue.test.mjs用例组按用例起始行与名称归组,覆盖本次新增用例。测试使用生产
createInputQueue与createTurnExecutor,替换引擎或进程外 I/O 的位置由各组标明。apps/desktop/src/main/maker-host/__tests__/hostDesktopSourceContracts.guard.test.ts补记文件头第 1–10 行定义 guard tier。守护的是装配和依赖边界。入口及失效后果见各行对应的
it前注释。无新增用例(6 个)
apps/host/scripts/lifecycle.e2e.mjsapps/host/src/chat.interactions.test.mjsscripts/__tests__/host-agent-deps-contract.test.mjs其余 3 个只跟随生产端口或夹具调整,原测试场景和断言目标保持一致。耗时见耗时表。
apps/desktop/src/main/cindy-brain/__tests__/hostToolSlot.test.tsapps/host/src/agent/learn-send.test.mjsapps/host/src/auth/device-identity.test.mjs已处理的待评审项
hostDesktopSourceContracts.guard.test.ts:1579只检查表的排版和说明文本形状,已删除(434ed14264);对照真实依赖图的区域规则守护在第 1565 行,保留。原清单
apps/host/src/agent/input-queue.test.mjs:4343比较队列接口成员的类型,尚无真实调用结果。apps/host/src/device-link.test.mjs:474比对两份分类表,尚无独立的行为或规则守护证明。apps/host/src/startup-account.test.mjs:38、174、215、284–384、470–508、759中,main 启动、关库、续期定时的接线只通过取出源码重执行来测,测试环境隔离用例只跑测试夹具。文件内另有真实 scanner、续期原语、HTTP 投影和部分真实serve路径的证据。本轮新增(
61c00afebb之后),四项都写在用例旁apps/host/src/device-link.test.mjs「Agent-Net control refuses profile hold…」扩展:经真实/control/remote开启远程控制,占用期间被拒且设置文件字节不变,解除后照常写入。最小失败输入:去掉setEnabled里的占用检查。tier:integration。scripts/__tests__/host-server-hold-classification.test.mjs「every path server.mjs answers itself is classified for a desktop hold」(先加在server.test.mjs,因为普通测试不许读生产源码,移到根目录源码契约并列进test:runner):静态守护,保护权限边界。失效后果:新入口在桌面占用期间写共用数据而没人审。最小失败输入:往server.mjs加一个/control/x。tier:guard。apps/host/src/chat.interactions.test.mjs「a held profile refuses /chat before creating a task…」:经真实createChatHandler走 HTTP,占用期间新任务不建、已存在任务照旧被拒、解除后照常建。最小失败输入:去掉chat.mjs建任务前的占用检查。tier:integration。单独运行耗时(54 个文件,开发机,逐个串行)
每个文件单独运行一次,经同一个排队入口,Node 22.22.3,TMPDIR 不设,临时 HOME,带已批的浏览器夹具;墙钟用
/usr/bin/time -p,不算排队时间;首轮超过 5 秒的再跑一次。5 秒/10 秒是 unit 档的预算,guard、integration、混合档与 e2e 不适用,但能测的都列出读数。49 个有读数,全部通过;apps/host/scripts下 5 个 e2e 脚本本机不跑,lifecycle 引用自有电脑那轮的读数。超过 10 秒的:input-queue.test.mjs、startup-account.test.mjs(混合档)和 lifecycle(e2e),原因见表。命令:Hostnode --import ./src/loaders/test-region.mjs --import tsx --import ./src/loaders/register-raw.mjs --test <文件>(在apps/host下);桌面同准备 PR;根目录脚本node --test <文件>。apps/host/scripts/chromium-proxy-worker.e2e.mjsapps/host/scripts/release-region.e2e.mjsapps/host/src/agent/idle-release.test.mjsapps/host/src/agent/outbound-path-fact.test.mjsapps/host/src/agent/profile-coexistence.test.mjsapps/host/src/agent/usage-pricing.test.mjsapps/host/src/agent/usage-recording.test.mjsapps/host/src/chromium-proxy.test.mjsapps/host/src/macos-system-proxy.test.mjsapps/host/src/outbound-proxy.test.mjsapps/host/src/plugins/gateway-delivery.test.mjsapps/host/src/plugins/profile-pause.test.mjsapps/host/src/project-icon.test.mjsapps/host/src/release-region.test.mjsapps/host/src/server-api.test.mjsapps/host/src/service.test.mjsapps/host/src/test-support/hook-plugin-fixture.test.mjsapps/host/src/ui-text.test.mjsscripts/__tests__/host-skill-projection-owner.test.mjsapps/desktop/src/main/__tests__/authColdStartRecovery.test.tsapps/desktop/src/main/cindy-brain/__tests__/hostToolSlot.test.tsapps/desktop/src/main/maker-host/__tests__/hostDesktopSourceContracts.guard.test.tsapps/host/scripts/claude-proxy.e2e.mjsapps/host/scripts/codex-runtime.e2e.mjsapps/host/scripts/lifecycle.e2e.mjsapps/host/scripts/pi-native.e2e.mjsapps/host/src/agent/codex-system-login.test.mjsapps/host/src/agent/engine-deps.test.mjsapps/host/src/agent/git-snapshot.test.mjsapps/host/src/agent/input-queue.test.mjsapps/host/src/agent/interactions.test.mjsapps/host/src/agent/learn-send.test.mjsapps/host/src/agent/memory.test.mjsapps/host/src/agent/native-auth.test.mjsapps/host/src/agent/provider-credentials.test.mjsapps/host/src/agent/session-update.test.mjsapps/host/src/auth/device-identity.test.mjsapps/host/src/auth/login.loopback.test.mjsapps/host/src/auth/refresh.test.mjsapps/host/src/boundary.test.mjsapps/host/src/chat.interactions.test.mjsapps/host/src/credentials/store.test.mjsapps/host/src/device-link.test.mjsapps/host/src/host-tools.test.mjsapps/host/src/ipc-route.test.mjsapps/host/src/loaders/raw-hook.test.mjsapps/host/src/plugins.test.mjsapps/host/src/plugins/managed-skills.test.mjsapps/host/src/profile-path.test.mjsapps/host/src/server.test.mjsscripts/__tests__/host-server-hold-classification.test.mjstest:runner执行apps/host/src/sessions.test.mjsapps/host/src/startup-account.test.mjsapps/host/src/web-shim.test.mjsscripts/__tests__/host-agent-deps-contract.test.mjs手工验证
不涉及。M1 的“真实验证”一项为无:没有用真实账号、打包产物或带界面运行。
未执行的验证
profile-pause.test.mjs的 6 条真实页面、scripts/plugin-sandbox.e2e.mjs。docs/host/owned-machine-verification.md。风险
风险分类
存量插件影响:无。 本 PR 没有改安装布局、包格式、批准状态和指纹,所以没有新的升级用例。静默只在后台服务里、桌面占用期间生效,批准状态和分区都保留。现有的存量插件用例照常通过:
ghost.test.ts、ghostLocalInstallIdentity.test.ts(结果见准备 PR);plugins/profile-pause.test.mjs,验证静默与恢复后插件照常可用。影响与回滚
apps/host及其文档和 CI 步骤;桌面只动了三个测试文件。默认不启用,用户不主动启动后台服务就没有变化。提交前检查