Conversation
…tput When a subagent (Task tool) executes tool calls but the LLM produces no textual response (only tool calls), the parent agent previously received an empty response with just metadata. This caused confusion as the subagent appeared to have done nothing. This fix adds a meaningful fallback message when final_content is empty: - If no tools were executed AND no content: indicates potential issue - If tools were executed but no content: provides a summary with success/failure counts and the original task description This ensures the parent agent always receives actionable feedback from subagents, preventing silent failures where tools ran but no report was generated. Fixes the issue where research subagents could complete tool execution (TodoWrite, LS, Read, Batch) but return nothing to the orchestrating agent.
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.
Problem
When a subagent (Task tool) executes tool calls but the LLM produces no textual response (only tool calls), the parent agent previously received an empty response with just metadata. This caused scenarios where:
The user observed this as: "L'agent n'a rien envoyé" (The agent sent nothing)
Root Cause
In
spawn_subagent(), thefinal_contentvariable captures the LLM's text output from each iteration. However:iteration_contentremains emptyfinal_contentis only updated when!iteration_content.is_empty()Solution
Added a fallback mechanism that provides meaningful feedback when
final_contentis empty:This ensures the parent agent always receives actionable feedback from subagents.
Changes
spawn_subagent()incortex-tui/src/runner/event_loop.rseffective_contentvariable with fallback logiceffective_contentinstead offinal_contentTesting
cargo check -p cortex-tuipassescargo test -p cortex-tui event_looppasses (9 passed, 7 ignored)