Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Oct 6, 2025

Description

This PR fixes an issue where messages sent during manual context condensation were not being processed after condensation completed, causing them to get stuck in the queue.

Problem

When users manually condense context and simultaneously attempt to send a message, the message gets queued but is never dispatched after condensation completes. This forces users to re-enter their message.

Solution

Added a call to processQueuedMessages() after context condensation completes in ClineProvider.condenseTaskContext(). This ensures any messages that were queued during the condensation process are properly processed and sent.

Changes

  • Modified src/core/webview/ClineProvider.ts to process queued messages after condensation
  • Added comprehensive tests in src/core/webview/__tests__/ClineProvider.spec.ts

Testing

  • ✅ All existing tests pass
  • ✅ Added new tests specifically for this scenario
  • ✅ Tests cover both cases: with queued messages and empty queue

Related Issue

Fixes #8477

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)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective
  • New and existing unit tests pass locally with my changes
  • I have made corresponding changes to the documentation (if applicable)

Important

Fixes message queue processing issue in ClineProvider.condenseTaskContext() by adding processQueuedMessages() call post-condensation.

  • Behavior:
    • Fixes issue where messages queued during context condensation were not processed in ClineProvider.condenseTaskContext().
    • Adds call to processQueuedMessages() after condenseContext() to ensure queued messages are processed.
  • Testing:
    • Adds tests in ClineProvider.spec.ts to verify processing of queued messages post-condensation.
    • Tests include scenarios with queued messages, empty queue, and non-existent tasks.

This description was created by Ellipsis for f49fd8e. You can customize this summary. It will automatically update as commits are pushed.

- Added processQueuedMessages() call after condenseContext completes
- Ensures messages sent during condensation are not lost
- Added comprehensive tests for the fix

Fixes #8526
@roomote roomote bot requested review from cte, jr and mrubens as code owners October 6, 2025 09:13
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Oct 6, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Oct 6, 2025
Copy link
Contributor Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewing my own code feels like arguing with the mirror about whose bugs these are while we both know it's me.

@roomote
Copy link
Contributor Author

roomote bot commented Oct 17, 2025

Review Summary

This PR addresses issue #8526 by adding a call to processQueuedMessages() after context condensation completes.

Analysis

After reviewing the implementation, the existing concern about only processing a single queued message is not accurate. The implementation correctly processes all queued messages through a natural loop:

  1. processQueuedMessages() dequeues one message and calls submitUserMessage()
  2. This triggers the webview to send the message back
  3. The ask() method (lines 843-863 in Task.ts) automatically checks for more queued messages when called
  4. This creates a loop that continues until all queued messages are processed

Testing

The PR includes comprehensive tests that verify:

  • Processing queued messages after condensation
  • Handling empty message queues
  • Error handling for non-existent tasks

Recommendation

This PR is ready to merge. The fix correctly addresses the reported issue without introducing new problems.

@roomote
Copy link
Contributor Author

roomote bot commented Oct 17, 2025

Starting my review of your PR—comments incoming soon! 🚀

Copy link
Contributor Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

After thorough analysis of the implementation, I can confirm this PR correctly fixes issue #8526.

Analysis of Existing Concern

The existing review comment suggested that processQueuedMessages() might only process a single queued message. However, after deep code analysis, I found this concern is not accurate:

How the implementation works:

  1. processQueuedMessages() dequeues one message and calls submitUserMessage()
  2. This triggers the webview to send the message back to the task
  3. The ask() method (lines 843-863 in Task.ts) has built-in logic that checks isMessageQueued and automatically processes queued messages
  4. This creates a natural loop that continues until all queued messages are processed

This pattern is used consistently throughout the codebase (in applyDiffTool.ts, writeToFileTool.ts, etc.), confirming it's the intended design.

Review Findings

No new issues found
Implementation correctly fixes the reported issue
Comprehensive tests included
Code follows existing patterns

Recommendation: This PR should be approved and merged.

Note: Unable to formally approve due to bot account limitations (cannot approve own PR), but the code review is complete and positive.

@hannesrudolph hannesrudolph moved this from Triage to PR [Needs Review] in Roo Code Roadmap Oct 17, 2025
@hannesrudolph hannesrudolph added PR - Needs Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Oct 17, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Oct 17, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Oct 17, 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 Review size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[BUG] Messages queued during context condensing don't get sent when context condensing is done.

3 participants