Repository navigation
fix(core,harness): separate subagent waits from ordinary tool timeouts - #3879
Merged
Merged
Conversation
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
jujn
approved these changes
Oct 31, 2026
xzxiaoshan
pushed a commit
that referenced
this pull request
Nov 20, 2026
#4278) ## Summary - Mark `task_output` and `wait_async_results` as `timeoutManaged`. - Keep each tool's existing self-bounded wait budget authoritative, instead of allowing the ordinary tool execution timeout to interrupt the wait first. - Add focused regression coverage for a short Toolkit-level timeout that must not cut short a longer managed wait. - Update the English and Chinese subagent documentation. Fixes #1451. ## Background `task_output(block=true)` accepts a wait timeout up to 600 seconds, while the default ordinary tool timeout is 5 minutes. As a result, a valid `task_output` wait could be interrupted by the outer `ExecutionConfig.TOOL_DEFAULTS` timeout before its own deadline. `agent_spawn` and `agent_send` already use the existing `timeoutManaged` mechanism introduced by #3879. This change applies the same semantics to the two SubAgent result-waiting tools: - `task_output(block=true)` owns its bounded wait timeout. - `wait_async_results` owns its existing 60-second default / 120-second maximum wait budget. `wait_async_results` is not affected by the default 5-minute ordinary timeout, but a shorter application-configured tool timeout can currently interrupt its own bounded wait. Marking it as timeout-managed makes the behavior consistent. ## Behavior - `task_output(block=true)` continues to use its existing timeout parameter, default, and 600-second cap. - `wait_async_results` continues to use its existing timeout parameter, default, 120-second cap, and consecutive-empty-wait guardrails. - Non-blocking operations such as `task_output(block=false)`, `task_cancel`, and `task_list` are unchanged. - Ordinary tools continue to use the normal `ExecutionConfig` timeout.
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.
AgentScope-Java Version
2.1.0-SNAPSHOT; based on upstream
mainate190a8d1b.Description
A synchronous
agent_spawnoragent_sendcan be cancelled by the ordinary-tool timeout before its own wait finishes. Raising the application override alone also leaves it silently capped at 600 seconds.Fixes #3878.
Summary
Add an opt-in
timeoutManagedtool flag, defaulting to false, and enable it onagent_spawn/agent_send. Ordinary tools, including tools called inside the child, retain their configured timeout. The LLM-facing 600-second cap and parent-cancellation propagation are preserved. Update the existing English and Chinese subagent guides.Related: #3166 and #1451. This PR focuses on spawn/send and does not change
task_outputor add a separate application-ceiling policy. It overlaps #2749 inAgentSpawnTooland the subagent guides; it does not depend on that PR.Evidence
Tool execution failed: Tool execution timeout after PT10Minterrupts the whole delegation; an application override of 1800 is also clamped to 600.Validation completed on Windows with Java 21:
npm run broken-linksreports 2,222 broken links across 328 files. This patch changes no links or anchors; the repository's documentation source check and strict build validation pass.Merge Danger
Door: Two-way; revert the commit to restore the previous timeout behavior.
Blast Radius: Tools. The new flag defaults to false; only the two delegation tools opt in. Applications own the positive force-sync wait budget.
Checklist
mvn spotless:applyclean verify