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.
- Issue
- #10073
- Pull request
- #10083
- Commit
- 180bd4503c
- 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
- 01
Focused send-message tests passed 23/23, including red-first regressions for both reported behaviors.
- 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.
- 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
- Local verification
Focused tests 23/23
- Automated triage
No code blockers
- Official CI
Awaiting workflow approval
- Maintainer review
Review required
- Merge
Not merged