-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Enhance chunked log upload UX with progressive event display #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
This commit refactors the chunking logic in `scripts/agent_cli.py` to simplify the process and improve concurrency. The key changes are: - Removed the "Chunk Burst" and "thread_ready_for_chunks" events. The CLI no longer waits for a signal from the backend to send chunks. - Each chunk is now sent in a separate thread, allowing for parallel processing on the backend. - Removed the `agent_aggregation_completed` event and associated logic. The client now treats chunk responses as regular messages. - Simplified the `WebSocketClient` by removing obsolete attributes and methods related to the old chunking strategy.
This commit fixes a bug where agent events for chunked files were not being displayed to the user. The issue was that each chunk was creating a new WebSocketClient instance with its own events list, and these events were not being propagated to the main client responsible for console output. The fix involves creating a shared events list in the AgentCLI class and passing it to all WebSocketClient instances, including those created for each chunk. This ensures that all events are collected in a single place and displayed to the user.
…c\n\n- Reverted timeout change for agent_completed events to 300s based on user feedback.\n- Modified _send_chunks_in_parallel to return all chunk processing results, aiming to prevent unintended higher-level waits.\n- Implemented full, untruncated display of 'issue' details within agent_completed events by adding specific formatting in _get_base_event_format.
…onditional return in run_single_message to terminate execution after processing chunked messages. This prevents the CLI from proceeding to agent execution for non-chunked files when chunked data has been sent.
- Added comprehensive pre-upload summary for chunked executions matching non-chunked UX - Displays provider, total entries, files read, and payload size - Shows detailed file list with hash prefixes and entry counts - Includes payload confirmation with chunk count and timestamp range - Improves user visibility into chunked upload process 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Added live progress tracking showing "⏳ Processing chunk X/Y..." when each chunk starts - Display completion status "✅ Chunk X/Y completed (Z/Y total)" after each chunk finishes - Show final summary "🎉 All chunks processed! X/Y completed successfully" - Removed duplicate agent event aggregation that was causing repetition - Maintained parallel processing with asyncio.gather() for performance - Used nonlocal variable to safely track completion count across async tasks This improves user experience by providing real-time feedback during chunked file uploads, preventing the appearance of the process hanging while chunks are processed in parallel. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Skip initial formatted display for agent_completed events in _receive_events_with_display - Events are still shown in the boxed "Final Agent Result" panel (lines 5866-5874) - Fixes issue where agent_completed events were displayed twice for single-chunk files - Maintains the nice boxed display format for final results 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Multi-chunk files now display agent completion results in boxed panels - Panel title shows "Chunk X/Y Result" for each chunk - Matches the display format used for single-chunk files - Extracts result from completion event data (result/response/final_response) - Falls back to formatted event display if no result found - Provides consistent, professional display across all chunk scenarios 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Added sys.stdout.flush() after "⏳ Processing chunk X/Y..." message - Ensures progress indicators are displayed immediately during parallel execution - Prevents output buffering from hiding start messages - Improves user visibility when multiple chunks process concurrently 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Added agent_started event notification after chunk is sent to backend - Displays "🚀 Agent started processing chunk X/Y" message when backend confirms processing started - Updated final summary message from emoji-based with chunk counts to "All the chunks processed successfully. Look Above" - Added 30s timeout for agent_started event with stdout flush for immediate visibility This improves user feedback by showing three clear stages: 1. ⏳ Processing chunk X/Y... (when sending) 2. 🚀 Agent started processing chunk X/Y (backend confirmation) 3. Chunk result in boxed panel (when complete) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Added tracking set `displayed_agent_results` to prevent duplicate displays - Generate unique key for each result using agent_name + run_id or result hash - Skip displaying result if already shown This fixes the issue where single-chunk executions were showing the same final result twice in boxed panels, likely due to backend emitting multiple agent_completed events with slightly different wrapper structures. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
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.
Summary
This PR significantly improves the user experience for chunked log uploads by adding progressive event display, real-time progress indicators, and preventing duplicate result displays.
Key Improvements
1. Progressive Event Display for Chunks
🚀 Agent started processing chunk X/Y)2. Real-Time Progress Indicators
⏳ Processing chunk X/Y...when chunk sending begins🚀 Agent started processing chunk X/Ywhen backend confirms processing started3. Duplicate Prevention
4. Code Simplification
User-Facing Changes
Before:
After:
⏳ Processing chunk X/Y...(sending)🚀 Agent started processing chunk X/Y(backend confirmation)Technical Details
_send_chunked_logsto display events immediately via callbackdisplayed_agent_resultsset to prevent duplicate displaysasyncio.gather()for parallel chunk processingTesting
Tested with:
Commits Included
Files Changed
scripts/agent_cli.py: Enhanced chunked upload display logic (276 additions, 735 deletions - net simplification while adding features)🤖 Generated with Claude Code