xiaonan.dev / open-source / qwen-code

Qwen Code contributions

An open-source AI coding agent with subagents, agent teams, and dynamic workflows.

Issue and pull-request links are the public record. Statuses are snapshots, not release claims.

View contribution records

packages/core · multi-agent coordination

Disambiguating send_message destinations

Fixed a routing ambiguity in Qwen Code’s multi-agent message tool so an instruction cannot silently target the wrong agent namespace, and a mistaken teammate destination receives an actionable correction.

Upstream progressOpen and awaiting upstream CI authorization and maintainer review. GitHub reports the change as mergeable, but it is not approved or merged.
Issue
#10073
Pull request
#10083
Module
packages/core · multi-agent coordination

The technical problem

send_message addresses teammates with `to` and background agents with `task_id`. Both fields were optional, and the execution path silently preferred `task_id` when both appeared. A teammate name placed in `task_id` also produced only a generic background-task error.

The solution

Added runtime mutual-exclusion validation before invocation creation, then reused Qwen Code’s existing teammate-name matcher after a background-task miss to suggest the canonical `to` destination. The provider-facing schema and machine-readable error contract stay unchanged.

Why this boundary

Runtime validation was chosen over JSON Schema `oneOf` because the project already documents provider incompatibilities with top-level schema composition. Failing before either dispatch path also proves the ambiguous request has zero delivery side effects.

Verification

  1. 01

    Focused send-message tests passed 23/23, including red-first regressions for both reported behaviors.

  2. 02

    The ambiguous-input test asserts INVALID_TOOL_PARAMS, an empty background queue, and no teammate send call — it verifies zero side effects, not only error copy.

  3. 03

    Target lint, formatting, diff checks, install, build, and typecheck passed. The full Windows preflight had unrelated platform and timeout failures, so no full-suite claim is made.

Upstream progress

  1. Local verification

    Focused tests 23/23

  2. Automated triage

    No code blockers

  3. Official CI

    Awaiting workflow approval

  4. Maintainer review

    Review required

  5. Merge

    Not merged