feat(tool): wait async result with taskId - #2529
Open
rudy2steiner wants to merge 2 commits into
Open
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Background
The main agent often needs to delegate several independent subtasks to subagents, let them run in parallel, and collect results according to task dependencies. The framework already has
agent_spawn/agent_send, background execution viatimeout_seconds=0,task_output, completion callbacks, and the existingToolkitConfig.paralleltool execution capability. However, async result collection is still too coarse:wait_async_resultscall only waits for any message to arrive in the session inbox. It cannot express “wait until these specific tasks are all done”.task_output, with no explicit wait-all barrier.wait_all, task-id based waiting, automatic delivery, and explicit polling need to be aligned across tool descriptions, middleware prompts, and docs.This PR closes the loop for parallel subagent orchestration: launch async work, wait when a dependency barrier is needed, and collect results without breaking the legacy inbox-based wait behavior.
Main Changes
wait_async_results(task_ids=...)to wait until a specific comma-separated task set is terminal.wait_async_results(wait_all=true)to wait for the current snapshot of non-terminal tasks in the session.TaskRepository.wait_async_results(timeout_seconds)inbox-any behavior when no barrier parameters are provided.agent_spawn,task_output, andwait_async_resultstool descriptions for sync, async, polling, and barrier collection.SubagentsMiddlewareprompt guidance and English/Chinese docs for task decomposition, parallel spawn, short-first/long-later collection, automatic delivery, and wakeup boundaries.