Skip to content

Conversation

@roomote
Copy link
Collaborator

@roomote roomote commented Jun 19, 2025

Summary

This PR fixes the intermittent state management bug where spinners remained visible on completed task items in the task history/activity panel.

Problem

The issue was in the ChatRow component's spinner logic. The conditions for showing spinners (, , and API request states) didn't properly detect when operations had completed, causing spinners to persist even after tasks finished.

Solution

Key Changes:

  1. Enhanced Command Execution Detection: Updated to check for completion indicators:

    • messages
    • messages
    • Non-partial messages
  2. Improved MCP Server Response Detection: Updated to check for messages that indicate completion.

  3. Better API Request State Management: Refactored the API request spinner logic to properly detect finished, cancelled, and failed states.

  4. Added Prop: Extended ChatRow and BrowserSessionRow components to receive the full message array for completion detection.

  5. Comprehensive Test Coverage: Added test suite covering all spinner scenarios to prevent regressions.

Testing

  • Added comprehensive unit tests for all spinner logic scenarios
  • Verified spinners are properly cleared when operations complete
  • Tested command execution, MCP server requests, and API request completion states

Fixes

Closes #4888

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

- Fixed intermittent state management bug where spinners remained visible on completed task items
- Updated ChatRow component to properly detect when operations have completed:
  - Command execution: Check for api_req_finished, completion_result, or non-partial command_output messages
  - MCP server requests: Check for mcp_server_response messages
  - API requests: Improved logic to properly detect finished/cancelled/failed states
- Added modifiedMessages prop to ChatRow and BrowserSessionRow components for completion detection
- Added comprehensive test suite for spinner logic scenarios
- Ensures spinners are cleared when read/edit activities complete as expected
@roomote roomote requested review from cte, jr and mrubens as code owners June 19, 2025 16:18
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Jun 19, 2025
@ellipsis-dev
Copy link
Contributor

ellipsis-dev bot commented Jun 19, 2025

⚠️ This PR is too big for Ellipsis, but support for larger PRs is coming soon. If you want us to prioritize this feature, let us know at [email protected]


Generated with ❤️ by ellipsis.dev

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jun 19, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Jun 19, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Jun 20, 2025
@daniel-lxs
Copy link
Member

The solution on this PR seems to be fragile since it's checking the messages types to see if the task is completed, it seems that the actual issue is related to the cost of the last message being undefined.

I'm preparing a PR to fix this issue properly.

@daniel-lxs daniel-lxs closed this Jun 22, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jun 22, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Prelim Review] to Done in Roo Code Roadmap Jun 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working PR - Needs Preliminary Review size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Spinner persists in completed tasks UI - intermittent state management bug

4 participants