docs/plans/2026-07-16-default-background-subagents.md
Implement the approved design in
docs/design/2026-07-16-default-background-subagents.md: top-level one-shot
subagents default to background execution, run_in_background: false opts into
foreground execution, nested and caller-owned working_dir launches stay
foreground, and forks plus named teammates keep their existing behavior.
.qwen/e2e-tests/default-background-subagents.md by launching a normal
subagent without run_in_background and confirming that it returns inline.working_dir
stays foreground.working_dir, and named teammate calls are not misclassified.For ordinary one-shot agents, an explicit tool parameter wins over the agent
definition. When the parameter is omitted, background: true retains its
existing meaning; otherwise a safe top-level launch defaults to background.
Caller-owned working_dir launches default to foreground, while an explicit
background request remains invalid. The final background path is still gated
by the top-level-session check, so nested launches downgrade to foreground.
packages/core/src/tools/agent/agent.test.tspackages/web-shell/client/adapters/toolClassification.test.tspackages/desktop/packages/shared/src/agent/__tests__/tool-matching.test.tspackages/cli/src/ui/commands/forkCommand.test.tsnpm run buildnpm run typecheck