qwen-code/packages
Dragon d4db5fcfab
feat(core): improve subagent delegation defaults and guardrails (#7048)
* docs(design): define default background subagents

* feat(core): improve subagent delegation defaults

* docs(core): cross-reference the three background-classification sites

Add pointer comments linking the core dispatch source of truth
(AgentTool.execute) and its two UI mirrors (web-shell
isBackgroundSubAgentToolCall, desktop detectBackgroundEvents) so the
replicated top-level-agent background heuristic is not changed in
isolation. Addresses PR review feedback.

* fix(core): align background classification for fork and named-teammate launches

Address review feedback on the background-classification rule so core dispatch
and the two UI classifiers stay consistent:

- core: exclude a name-without-active-team launch from the default-background
  path so it stays foreground, matching both UI classifiers (which exclude
  name). Previously such a launch was backgrounded by core but tracked as
  foreground by the UIs.
- web-shell and desktop classifiers: exclude subagent_type "fork" from the
  default-background heuristic, mirroring core's !isForkRequested guard. A
  top-level fork request with an omitted flag runs foreground in core but was
  classified as background by the UIs.
- add a core dispatch test asserting a working_dir launch with an omitted
  run_in_background flag stays in the foreground.

* test: cover fork/background classification and precedence per review feedback

Address unresolved review threads on PR #7048:
- Add web-shell and desktop UI classifier tests asserting an omitted-flag
  `subagent_type: "fork"` launch stays in the foreground, verifying the
  documented `!isForkRequested` parity with core dispatch.
- Add a core AgentTool test asserting an explicit `run_in_background: false`
  overrides a subagent config with `background: true`, locking in the
  `run_in_background ?? config` precedence against a `||` regression.
- Harden the Explore read-only prompt: pipelines must not send data to a
  network endpoint (no curl/wget/nc), closing the `cat file | curl`
  exfiltration gap.

* fix(core): restore general no-unnecessary-files guard in general-purpose prompt

Address review feedback: the rewritten general-purpose prompt dropped the
broad guard against creating unrequested files, keeping only the
documentation-specific line. Restore a general 'do not create files unless
necessary' guard so speculative utility/config files are not created.

* test(desktop): cover named-teammate foreground guard in detectBackgroundEvents

Add a desktop tool-matching test asserting a top-level Agent with a
`name` set (named teammate) stays foreground and emits no
task_backgrounded event, mirroring the web-shell classifier's
named-teammate coverage and the existing fork-exclusion test.

* test(core): cover named-teammate foreground dispatch when flag omitted

Add a core-dispatch test asserting a top-level Agent launch with `name`
set and `run_in_background` omitted stays foreground when no team is
active, guarding the `this.params.name === undefined` exclusion in
backgroundRequested directly (previously only covered by the UI
classifiers).

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-18 08:52:48 +00:00
..
acp-bridge feat(web-shell): add a workspace Goals page, and stop losing /goal on daemon resume (#6561) 2026-07-18 08:52:07 +00:00
audio-capture chore(release): v0.19.11 (#7042) 2026-07-16 15:23:33 +00:00
channels feat(channels): expose workspace-scoped observed contacts (#7109) 2026-07-18 07:35:45 +00:00
chrome-extension chore(release): v0.19.11 (#7042) 2026-07-16 15:23:33 +00:00
cli feat(web-shell): add a workspace Goals page, and stop losing /goal on daemon resume (#6561) 2026-07-18 08:52:07 +00:00
core feat(core): improve subagent delegation defaults and guardrails (#7048) 2026-07-18 08:52:48 +00:00
cua-driver docs(cua-driver): fix broken relative-coordinate design link (#7130) 2026-07-17 21:57:38 +00:00
desktop feat(core): improve subagent delegation defaults and guardrails (#7048) 2026-07-18 08:52:48 +00:00
mobile-mcp chore(release): v0.19.11 (#7042) 2026-07-16 15:23:33 +00:00
sdk-java chore: fix typos in code comments and a Java SDK example (#7059) 2026-07-17 16:21:47 +00:00
sdk-python fix(config): reject fractional session and tool-call limits (#6920) 2026-07-15 04:56:52 +00:00
sdk-typescript feat(web-shell): add directory autocomplete to the Add Workspace dialog (#7125) 2026-07-17 22:25:22 +00:00
vscode-ide-companion fix: correct typos in comments, a tool description, and docs (#7131) 2026-07-18 07:40:14 +00:00
web-shell feat(core): improve subagent delegation defaults and guardrails (#7048) 2026-07-18 08:52:48 +00:00
web-templates chore(release): v0.19.11 (#7042) 2026-07-16 15:23:33 +00:00
webui feat(web-shell): add a workspace Goals page, and stop losing /goal on daemon resume (#6561) 2026-07-18 08:52:07 +00:00
zed-extension chore(deps): upgrade ink 6.2.3 → 7.0.2 + bump Node engine to 22 (#3860) 2026-05-11 17:29:50 +08:00