Fix/streaming output tracking#343
Closed
chrisnestrud wants to merge 11 commits intocecli-dev:mainfrom
Closed
Conversation
Problem: -------- When using models that return tool calls without any text content (e.g., DeepSeek models in non-streaming mode), aider incorrectly displayed the warning: "Empty response received from LLM. Check your provider account?" This was misleading because the model had actually returned valid tool calls - it just didn't return any text content to display. Root Cause: ----------- The empty response warning logic only checked if text content was received, but didn't account for other valid response types: - Tool calls (function invocations) - Function calls (legacy format) - Reasoning content (for reasoning models) In non-streaming mode, the code called assistant_output() with an empty string when there were only tool calls, which triggered the warning in the TUI's assistant_output() method. Solution: --------- 1. Added partial response tracking system with flags for: - content: Regular text content - reasoning: Reasoning/thinking content - tool_calls: Tool/function call invocations - function_call: Legacy function call format 2. Modified show_send_output() to detect and register all response types in non-streaming mode before calling assistant_output() 3. Updated the empty response check to only show the warning when NO response type was received (truly empty response) 4. Added comprehensive test coverage for: - Flag initialization and registration - Response type detection in both streaming and non-streaming modes - Edge cases (tool calls only, reasoning only, etc.) Changes: -------- - aider/coders/base_coder.py: - Added _reset_partial_response_flags() - Added _register_partial_response() - Added _received_any_partial_response() - Enhanced show_send_output() to detect all response types - Updated empty response warning logic - tests/basic/test_coder.py: - Added 20+ new tests covering partial response tracking Impact: ------- - Users will no longer see misleading "Empty response" warnings when models return valid tool calls without text content - The warning will still be shown for truly empty responses (no content, no tool calls, no reasoning) - No breaking changes to existing functionality Co-authored-by: aider-ce (synthetic/hf:zai-org/GLM-4.7)
Co-authored-by: aider-ce (synthetic/hf:Qwen/Qwen3-Coder-480B-A35B-Instruct)
Co-authored-by: aider-ce (openai/gpt-5-codex)
Co-authored-by: aider-ce (openai/gpt-5-codex)
Co-authored-by: aider-ce (openai/gpt-5-codex)
|
Hey @chrisnestrud are you able to update the pr so that it passes CI? |
Resolved merge conflicts by accepting HEAD's version for: - cecli/coders/base_coder.py - cecli/io.py - cecli/tui/io.py - tests/basic/test_coder.py
Collaborator
|
This should also be addressed in v0.96.0 |
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.
fix: avoid empty response warning when only tool calls are present