Skip to content

fix(worktree): 创建超时配置纳入守护进程生命周期快照 - #3557

Merged
deepcoldy merged 1 commit into
masterfrom
fix/worktree-create-timeout-lifecycle
Nov 18, 2026
Merged

deepcoldy merged 1 commit into
masterfrom
fix/worktree-create-timeout-lifecycle

Conversation

@deepcoldy

Copy link
Copy Markdown
Owner

背景

#3554 新增了 BOTMUX_WORKTREE_CREATE_TIMEOUT_MS(每次 git worktree add 的预算,默认 60000ms)。合入后复核发现该键没有进入 DAEMON_ENV_KEYS 生命周期快照,存在一个重启生效缺口。

问题

该键不在会话 CLI pane 的环境清理名单中,会随旧 daemon 的环境透传进会话子进程。当从一个 botmux 会话内部(或 detached 自升级路径)执行重启时:

  • 新 daemon 经继承环境拿到的是旧值;
  • src/index-daemon.ts 的 dotenv 加载默认不覆盖已存在的变量。

于是在 ~/.botmux/.env 中把 60000 改成 90000 后,会话内重启仍是 60000;从文件里删除该键,也无法恢复文档声明的 60s 默认值。普通 shell 启动/重启、以及从未配置过该键的默认行为均不受影响。

改动

  • 将 BOTMUX_WORKTREE_CREATE_TIMEOUT_MS 加入 src/cli/daemon-lifecycle-env.ts 的 DAEMON_ENV_KEYS,与已有的同类机器级超时 BOTMUX_SENDER_RESOLVE_TIMEOUT_MS 同构:session-origin 重启从持久化文件权威解析,文件缺失时解析为空串,由消费侧 resolveWorktreeCreateTimeoutMs 回退默认。detached 重启的 fallback 快照也从同一名单派生,自动一并覆盖。
  • 在 test/daemon-lifecycle-env.test.ts 补 session-origin 重启的「修改生效、删除恢复默认」回归用例,并端到端校验消费侧解析结果。

影响面

仅守护进程生命周期环境快照这一处共用路径;新增的是非密钥配置项,不涉及 H5 凭证家族(不触发 DASHBOARD_H5_ENV_PREFIX 扫描)。对普通 shell 启动零行为变化(shell 显式 export 仍优先于文件,已有用例覆盖)。

验证

  • bun run test test/daemon-lifecycle-env.test.ts test/runtime-timeout-config.test.ts:33 用例通过;加跑 test-hygiene 共 61 用例通过。
  • 变异复验:临时把该键移出 DAEMON_ENV_KEYS,新回归用例失败、真实组装探针复现「编辑仍为旧值、删除不回默认」;还原后全部转绿。
  • 围栏内端到端探针(resolveFleetDaemonEnv + resolveWorktreeCreateTimeoutMs)四场景:会话重启改 90000 生效、删除回 60000、shell export 120000 优先、shell 仅文件设 90000 生效。
  • bun run build(tsc + 构建审计)通过。

#3554 新增的 BOTMUX_WORKTREE_CREATE_TIMEOUT_MS 未加入
DAEMON_ENV_KEYS。该键不在会话 pane 的清理名单里,会随旧 daemon
环境透传进会话 CLI;从会话内(或 detached 自升级)执行重启时,
新 daemon 继承旧值,而 index-daemon.ts 的 dotenv 不覆盖已存在的
变量,导致修改 ~/.botmux/.env 不生效、删除该键也无法恢复 60s
默认值。普通 shell 启动与未配置时的默认行为不受影响。

将该键加入生命周期快照(与 BOTMUX_SENDER_RESOLVE_TIMEOUT_MS
同构),session-origin 重启从持久化文件解析、缺失回退默认;补
session-origin 重启的修改生效/删除回滚测试,并端到端校验消费侧
resolveWorktreeCreateTimeoutMs。

Co-Authored-By: Claude Fable 5 <[email protected]>
@deepcoldy
deepcoldy merged commit 94e46cd into master Nov 18, 2026
19 checks passed
@github-actions

Copy link
Copy Markdown

@deepcoldy 合入 master 后的 Midscene E2E 失败:Feishu live Midscene 失败。

这次运行覆盖 94e46cd。

用例 跑道 状态 失败信息
Kimi basic bot flow feishu-core-clis failed Feishu Messenger chat list did not load after 4 attempts (URL: https://acn2e4mfbjx2.feishu.cn/next/messenger/, title: 飞书). A login redirect means the saved storage state expired; a skeleton list mean…
Follow-up in the same topic keeps context feishu-core-conversation failed Replanned 20 times, exceeding the limit. Please configure a larger value for replanningCycleLimit (or use MIDSCENE_REPLANNING_CYCLE_LIMIT) to handle more complex tasks.

@github-actions

Copy link
Copy Markdown

🚀 Released in v3.59.20

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.

1 participant