Skip to content

T-1242 T-1239① Cry Bot InstaBox 云电脑:核心客户端、开机/挂起、后端切换接线 - #63

Merged
crysound-it merged 6 commits into
mainfrom
T-1242-instabox-core
Nov 15, 2026
Merged

crysound-it merged 6 commits into
mainfrom
T-1242-instabox-core

Conversation

@crysound-it

Copy link
Copy Markdown
Contributor

台账任务

台账任务:T-1242

改了什么

  1. 改了什么

第 2、3 轮实际改动文件(历史记录):

 M docs/tasks/T-1200/T-1242-instabox-core/report.md
 M docs/tasks/T-1200/T-1242-instabox-core/verification.txt
 M server/index.ts
 M server/instabox/core.e2e.test.ts

server/index.ts 当前 15449 行。本轮 beginTurn 的云策略判定改用已解析的 cloudBackend,因此 run_on=cloud 的 instabox 按 box 策略检查;instabox 删除失败改为抛出 503,外层 catch 仍会执行 browser cleanup abort。新增 index 层 e2e 回归覆盖 run_on=cloud、切换后删除、Boat 侧 5xx/网络错误降级、instabox 删除失败保留智能体。

  1. 为什么

确保实际使用的云电脑类型与管理策略一致,避免 run_on=cloud 绕过 box 禁止策略;删除时保留 Boat/VPS 清理流程,并让 失败只在 instabox 智能体上阻止最终删除,同时保持浏览器清理回滚。

  1. 测试命令与结果摘要

依赖准备脚本 已运行。仓库未提供 docs/verification/README.md;本轮使用临时目录、假引擎和 loopback 假 服务,未连接真实服务。

  • pnpm exec vitest run server/instabox/core.e2e.test.ts --maxWorkers=1:7 项通过,连续 3 次通过。
  • pnpm exec vitest run server/cloud-backend.test.ts --maxWorkers=1:12 项通过。
  • pnpm exec vitest run server/index.test.ts --maxWorkers=1:338 项通过。
  • pnpm exec tsc -p tsconfig.server.json:通过。
  • pnpm exec oxlint --deny-warnings server/index.ts server/instabox/core.e2e.test.ts:通过。
  • git diff --check:通过。

完整输出见 verification.txt。

第 4 轮

  1. 改了什么

本轮最终 git status --short 文件清单:

 M docs/tasks/T-1200/T-1242-instabox-core/report.md
 M docs/tasks/T-1200/T-1242-instabox-core/verification.txt
 M scripts/control-cry.ts
 M server/instabox/core.e2e.test.ts
 M server/instabox/machines.test.ts
 M server/instabox/machines.ts
 M server/instabox/power.test.ts
 M server/instabox/power.ts
 M server/testing/desktop-parent.mjs

模板未指定时复用已有 机器的模板,新建机器仍默认 Linux;补充 Android 普通回合、Boat/VPS 归属机器删除、策略拒绝和 删除失败保留智能体的真实回合回归。server/index.ts 本轮净增 0 行,当前及基线均为 15449 行。instaboxMachinesFor 签名为 function instaboxMachinesFor(cfg: AppConfig): InstaboxMachines | null。

仍在用的文案键及中英文:

键 中文 English
serverError.instabox.keyMissing 钥匙未配置 API key is not configured
serverError.instabox.template 模板必须是 linux 或 android template must be linux or android
serverError.instabox.unavailable 电脑访问不可用 computer access is unavailable

autoSuspendAfterSeconds: 600 是 自动挂起兜底,本轮没有另写定时器。

  1. 为什么

让 Android 机器在普通回合未传模板时继续可用,并保持群聊调用所需的未指定模板语义;让策略判断真正覆盖 beginTurn 的后端选择,删除时按机器归属清理 Boat/VPS,删除网络错误返回 503 并保留智能体。

  1. 测试命令与结果摘要

依赖准备脚本 已运行。旧策略判断临时恢复后,VPS 策略回合测试按预期失败,随后恢复正确实现。使用 loopback 假服务和临时目录,未连接真实服务。

  • pnpm exec vitest run server/instabox/core.e2e.test.ts --maxWorkers=1:13 项通过,最终连续 3 次通过。
  • pnpm exec vitest run server/instabox/machines.test.ts --maxWorkers=1:13 项通过。
  • pnpm exec vitest run server/instabox/power.test.ts --maxWorkers=1:7 项通过。
  • pnpm exec vitest run scripts/control-cry.test.ts --maxWorkers=1:9 项通过。
  • pnpm exec vitest run server/cloud-backend.test.ts --maxWorkers=1:12 项通过。
  • pnpm exec vitest run server/index.test.ts --maxWorkers=1:338 项通过。
  • pnpm exec tsc -p tsconfig.server.json:通过。
  • pnpm exec oxlint --deny-warnings(本轮改动文件):通过。
  • git diff --check:通过。

完整输出见 verification.txt。

验收证据

审核、安全审查和测试结论见本 PR 检查状态及评论。

风险与回退

待补充风险;合并后可通过 revert 压缩提交回退。

🤖 Generated with Claude Code

@crysound-it

Copy link
Copy Markdown
Contributor Author

操作者通过 --allow-credential-hit 放行以下凭据扫描命中(仅列位置):

  • scripts/control-cry.test.ts:49 (commit 9c68a99)
  • scripts/control-cry.test.ts:49 (commit ae77d89)
  • server/instabox/core.e2e.test.ts:59 (commit 9c68a99)
  • server/instabox/core.e2e.test.ts:59 (commit ae77d89)

@crysound-it

Copy link
Copy Markdown
Contributor Author

操作者通过 --allow-credential-hit 放行以下凭据扫描命中(仅列位置):

  • scripts/control-cry.test.ts:49 (commit b76930e)
  • server/instabox/core.e2e.test.ts:59 (commit b76930e)

@crysound-it
crysound-it marked this pull request as ready for review November 15, 2026 08:36
@crysound-it
crysound-it merged commit 1dd5822 into main Nov 15, 2026
23 of 29 checks passed
@crysound-it
crysound-it deleted the T-1242-instabox-core branch November 15, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants