Repository navigation
fix(runtime): accept redundant delegation job selectors - #2188
Merged
Merged
Conversation
Models can supply both job and delegationIds for the same subagent. Accept equivalent selectors and ignore single-target wait options without changing Bash controls or allowing conflicting delegation targets. fixes #2173
Owner
Author
|
PR integration validation passed on GitHub merge ref |
This was referenced Nov 8, 2026
2 tasks done
vastsa
pushed a commit
that referenced
this pull request
Nov 21, 2026
#2188 relaxed target() to accept an omitted/empty delegationIds or one containing only job.id. It still threw when a delegation job accompanied a delegationIds array naming other subagents, even though the wrapper already falls through to delegates.wait/stop.execute(id, params) and that path honors the full multi-target list. Strict Responses-style models send both shapes when collecting several completed reports, so every TaskWait failed and the reports never reached the parent. Return undefined instead of throwing for a valid delegationIds array that selects other ids, letting the existing multi-target path handle it. Keep the single-job path for omitted/empty/same-id arrays and keep rejecting malformed selectors (non-array values or non-string entries) with an actionable error that tells the model to drop job and retry with delegationIds. Bash job selectors are unchanged. Also stop TaskList from echoing `job={"kind":"delegation",...}` for each delegation; it now prints the delegationIds form the model should pass. Fixes #2487
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.
Summary
Fixes #2173.
job.kind: "delegation"together with omitted/emptydelegationIds, or IDs that all identify that same job.mode/minCompletedfor an explicit single-delegation job while preserving its wait timeout, cancellation signal and result delivery.Task-candidate validation
275748889e78a1729dc00e2be9b3716312ed9ca6b7678c36cb8fd4bcb1db7173b5e0a6be9e4c07f0background-job-tools.test.tsandsubagent.test.ts.-t 'delegat|subagent|job controls'(313 unrelated tests not selected).node --check scripts/e2e-task-job-selectors.mjsand PR-base/diff checks pass.PI_DESKTOP_HOST_BIN=<rebuilt-base-host> node scripts/e2e-task-job-selectors.mjspasses: seven parent provider rounds, report re-read, matching/empty selectors and cancellation of a real pending delegate provider request. The same E2E fails against the original runtime.Environment: existing host Node/dependencies and Cargo cache, isolated Host data/workspace, deterministic localhost provider. No external model request or running user Desktop instance. Native Windows / the reported real model were not exercised.
Broader local baseline observations
These are outside the changed behavior and were independently reproduced with untouched base source and the same environment:
compacts at the turn boundary rather than ahead of it(compaction mark provider/model fields).failedinstead ofstoppedin its service-stop assertion. This PR changes neither Bash process state handling nor that script.Biome configuration excludes the changed files; the attempted targeted invocation processed no files and is not counted as passing lint. Remote repository checks remain the landing gate.