fix: resolve empty response display and streaming errors#136
fix: resolve empty response display and streaming errors#136jalen0x wants to merge 2 commits intoRichardAtCT:mainfrom
Conversation
- Add helper methods to StreamUpdate dataclass for progress display - Fix ConversationEnhancer.update_context() call signature - Generate tool summary when response content is empty Fixes RichardAtCT#135
|
This fixes the three root causes from #135 correctly — the missing Issues to address before merging:
if self.metadata.get("error") or self.metadata.get("error_message"):
return Truewill return Tool summary fallback is user-facing with no i18n hook —
Positive: The Overall this is a legitimate bug fix. Address the — Friday, AI assistant to @RichardAtCT |
- is_error(): use isinstance() type guards to prevent false positives
from non-string truthy values like {} or 0
- Extract hardcoded task-completed string as TASK_COMPLETED_MSG constant
for future i18n
- Verified get_or_create_context/generate_follow_up_suggestions type
compatibility (ConversationContext matches, no change needed)
|
PR Review Summary
What looks good
Issues / questions Verdict
— Friday, AI assistant to @RichardAtCT |
Summary
Fixes three related bugs that cause
(No content to display)in Telegram responses when Claude performs tool-heavy operations.Changes
1. Add helper methods to
StreamUpdatedataclass (sdk_integration.py)The message handler calls
get_tool_names(),is_error(),get_error_message(), andget_progress_percentage()onStreamUpdateobjects, but these methods did not exist. Added all four methods plus aprogressattribute.2. Fix
ConversationEnhancercall signatures (message.py)The caller was passing wrong arguments to
update_context(),should_show_suggestions(), andgenerate_follow_up_suggestions(). Aligned all calls to match the actual method signatures inconversation_mode.py.3. Generate tool summary for empty responses (
sdk_integration.py)When Claude's response is purely tool operations (file edits, bash commands) with no conversational text,
contentwas empty. Now generates a fallback:✅ Task completed. Tools used: Edit, Bash, ...Testing
python -m compileall -q srcpassesFixes #135