Skip to content

Conversation

@canrobins13
Copy link
Contributor

@canrobins13 canrobins13 commented May 28, 2025

Related GitHub Issue

Closes: #3911

Description

Sometimes the context grows rather than shrinking during a context condense. This is an expected edge case under the current implementation: the condense operation preserves the last 3 messages as-is, and tries to summarize the conversation before that point using an LLM call. If the last 3 messages are quite large, and the previous messages are small (or maybe you summarized recently), then you may have reached the threshold, but there's not much that can be done to reduce the context size through summarization while preserving the last 3 messages.
In these cases it's probably best to skip the summary and show the user an error rather than "condensing" the context to a larger size.

Test Procedure

Tried manual and automatic context condenses and observed the error

Type of Change

  • 🐛 Bug Fix: Non-breaking change that fixes an issue.
  • New Feature: Non-breaking change that adds functionality.
  • 💥 Breaking Change: Fix or feature that would cause existing functionality to not work as expected.
  • ♻️ Refactor: Code change that neither fixes a bug nor adds a feature.
  • 💅 Style: Changes that do not affect the meaning of the code (white-space, formatting, etc.).
  • 📚 Documentation: Updates to documentation files.
  • ⚙️ Build/CI: Changes to the build process or CI configuration.
  • 🧹 Chore: Other changes that don't modify src or test files.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Code Quality:
    • My code adheres to the project's style guidelines.
    • There are no new linting errors or warnings (npm run lint).
    • All debug code (e.g., console.log) has been removed.
  • Testing:
    • New and/or updated tests have been added to cover my changes.
    • All tests pass locally (npm test).
    • The application builds successfully with my changes.
  • Branch Hygiene: My branch is up-to-date (rebased) with the main branch.
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Changeset: A changeset has been created using npm run changeset if this PR includes user-facing changes or dependency updates.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

Screenshot 2025-05-28 at 12 34 25 PM

@canrobins13 canrobins13 marked this pull request as ready for review May 28, 2025 04:54
@canrobins13 canrobins13 requested review from cte and mrubens as code owners May 28, 2025 04:54
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working enhancement New feature or request labels May 28, 2025
@hannesrudolph hannesrudolph moved this from Triage to PR [Needs Review] in Roo Code Roadmap May 28, 2025
@samhvw8
Copy link
Contributor

samhvw8 commented May 28, 2025

look good, but can we make it grey or yellow text instead of red one ?

@daniel-lxs
Copy link
Member

LGTM

@mrubens
Copy link
Collaborator

mrubens commented May 28, 2025

look good, but can we make it grey or yellow text instead of red one ?

I agree! Can you model it after how we show diff errors? Excited for this change in general.

@daniel-lxs daniel-lxs moved this from PR [Needs Review] to PR [Changes Requested] in Roo Code Roadmap May 28, 2025
@canrobins13 canrobins13 force-pushed the canyon/context-grew branch from 4ce225e to 221e32d Compare May 28, 2025 16:41
@canrobins13 canrobins13 force-pushed the canyon/context-grew branch from 7693875 to 5e975aa Compare May 28, 2025 19:43
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label May 28, 2025
@mrubens mrubens merged commit 2e5a1a8 into main May 28, 2025
10 checks passed
@mrubens mrubens deleted the canyon/context-grew branch May 28, 2025 19:55
@github-project-automation github-project-automation bot moved this from PR [Changes Requested] to Done in Roo Code Roadmap May 28, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap May 28, 2025
SmartManoj pushed a commit to SmartManoj/Raa-Code that referenced this pull request Jun 13, 2025
The extension doesn't like it when the workspace/workspace config is undefined.
Fix the warning about the name in package.json.
Change some logging in the gRPC server.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request lgtm This PR has been approved by a maintainer PR - Changes Requested 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.

condense threshold not working properly

5 participants