## 背景 enhance-0819.md item 12 (CC 2.1.198/232): 子代理默认后台化。现 subagent 走 sync foreground 阻塞 turn (toolExecution.ts:1392 await), `getAutoBackgroundMs()` (AgentTool.tsx:161) 仅读 `CLAUDE_AUTO_BACKGROUND_TASKS`/GrowthBook, default 0=off。OSS 构建 GrowthBook 不生效 → subagent 永不自动后台。 ## 缺口 无 fusion 可配阈值。item 4 (PR #94) 已为 MCP 落 `FUSION_MCP_AUTO_BACKGROUND_MS`, 但 subagent 走独立路径 (AgentTool/LocalAgentTask), 不共享代码。 ## 方案 (surgical) 扩 `getAutoBackgroundMs()` 加 `FUSION_SUBAGENT_AUTO_BACKGROUND_MS` env 分支 (并行 item 4 MCP 模式), 解析 ms default 0=off。复用现成 `registerAgentForeground` 定时器→`backgroundSignal`→mid-run 后台化 (:1263) 解阻塞。default off, byte-identical 旧行为。无需 QueryEngine 解耦。 ## 验收 - env 未设/0 → 行为不变 (sync 阻塞) - env=60000 → subagent 60s 后转后台, turn 解锁 - typecheck 0, 全测 pass, build pass ## 跨工程规则 仅改 fusion-code。Commit trailer: Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Activity