Repository navigation
feat(agent): item 12 子代理自动后台化阈值 FUSION_SUBAGENT_AUTO_BACKGROUND_MS (CC 2.1.198/232) - #103
Merged
Merged
Conversation
…C 2.1.198/232) 扩 getAutoBackgroundMs 加 fusion env 分支 FUSION_SUBAGENT_AUTO_BACKGROUND_MS (并行 item 4 FUSION_MCP_AUTO_BACKGROUND_MS)。设正值 → subagent 运行该毫秒后 转后台, 复用现成 registerAgentForeground 定时器→backgroundSignal→mid-run 后台化解阻塞 turn。default 0=off, byte-identical 旧行为。无需 QueryEngine 解耦。 Closes #102 Co-Authored-By: Claude Fable 5 <[email protected]>
This was referenced Aug 22, 2026
dahai80
added a commit
that referenced
this pull request
Aug 22, 2026
Patch release bundling 17 commits since v0.4.23: - item 15(a) MLX OOM auto-recovery gc+retry (#129) - #7 one-click diagnostic fixAction framework (#131) - 维度5 background-default spawn FUSION_SUBAGENT_DEFAULT_BACKGROUND (#127) - #4 proactive MLX OOM detection via /v1/health (#125) - item 17 fullscreen pre-compact history + :598 synthetic decouple (#123) - item 25B workflow stagger fan-out (#122) - item 21 auto-mode local rule classifier test coverage (#120) - item 23 archive plugin source + SHA-256 lock (#118) - item 24 marketplace command source (#116) - item 6 transcript disk trimming + crash-safe checkpoint (#114) - item 5 normalizeMessages secondary normalize cache (#112) - item 19 screen-reader plaintext render (#110) - item 16 compact retry countdown + stall hint (#108) - item 25A workflow execution runtime docs (#106) - item 25A minimal workflow execution runtime (#105) - item 12 subagent auto-background threshold (#103) - item 20 vimInsertModeRemaps dual-key INSERT sequence (#101) Co-Authored-By: Claude Fable 5 <[email protected]>
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.
背景
Closes #102。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/GrowthBooktengu_auto_background_agents, default 0=off。OSS 构建 GrowthBook 不生效 → subagent 永不自动后台。item 4 (PR #94) 已为 MCP 落FUSION_MCP_AUTO_BACKGROUND_MS, 但 subagent 走独立路径 (AgentTool/LocalAgentTask), 不共享代码。方案 (surgical)
src/tools/AgentTool/autoBackground.ts:getSubagentAutoBackgroundMs()解析FUSION_SUBAGENT_AUTO_BACKGROUND_MSenv (parseInt, default 0=off, 负数/非数 fail-off)。getAutoBackgroundMs()加 fusion env 分支 (在 CLAUDE_AUTO_BACKGROUND_TASKS/GrowthBook 前), 正值即返回。registerAgentForeground定时器 (LocalAgentTask.tsx:590-616) →backgroundSignal→ mid-run 后台化 (AgentTool.tsx:1263) 解阻塞 turn。验证
subagentAutoBackground.test.ts7 pass (env 解析全 edge case)src/__tests__/187 pass, 0 fail跨工程规则
仅改 fusion-code。Commit trailer: Co-Authored-By: Claude Fable 5 [email protected]