Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jan 7, 2026

Related GitHub Issue

Closes: #9334

Description

This PR attempts to address Issue #9334, which requests creating visible checkpoints before each context-management event.

Background: A previous implementation (PR #9335) was closed because it used suppressMessage=true, which hid the checkpoints from users. This new implementation fixes that by using suppressMessage=false to make checkpoints visible in the chat.

Key implementation details:

  • Added visible checkpoint (checkpointSave(true, false)) before context condensation in three locations:
    1. condenseContext() - Manual context compression triggered by the user
    2. attemptApiRequest() - Automatic context management when contextManagementWillRun && autoCondenseContext
    3. handleContextWindowExceededError() - Context compression triggered by context window exceeded errors

Design choice: Using suppressMessage=false (the second parameter to checkpointSave) ensures the checkpoint notification appears in the chat, allowing users to see when a checkpoint was created and enabling them to revert to it if needed.

Feedback and guidance are welcome.

Test Procedure

  1. Type checking passed via pnpm run check-types
  2. All tests passed via pnpm run test -- core/task (366 test files, 5122 tests)
  3. Linting passed via pnpm run lint

Manual testing approach:

  • Enable auto-condense context in settings
  • Start a long conversation that triggers context compression
  • Verify that a checkpoint notification appears in the chat before compression occurs
  • Verify that you can revert to the checkpoint if desired

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.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Documentation Updates

  • No documentation updates are required.

Additional Notes

This implementation follows the same pattern as other checkpointSave calls in the codebase. The force=true parameter ensures a checkpoint is created even if one was recently made, while suppressMessage=false makes the checkpoint visible to users.

Add visible checkpoints (suppressMessage=false) before each context
compression operation to allow users to revert if needed:

1. Before manual context condensation in condenseContext()
2. Before automatic context management in attemptApiRequest()
3. Before context window exceeded handling

This addresses Issue #9334 by ensuring checkpoints are visible in the
chat, unlike the previous implementation in PR #9335 which used
suppressMessage=true and hid the checkpoints from users.
@roomote
Copy link
Contributor Author

roomote bot commented Jan 7, 2026

Rooviewer Clock   See task on Roo Cloud

Review complete. No issues found.

The implementation correctly adds visible checkpoints before context compression in all three locations (manual condensation, automatic condensation, and context window exceeded handling). The code follows existing patterns, uses proper async/await, and includes clear documentation referencing issue #9334.

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Create checkpoints before compressing the context

3 participants