Skip to content

fix: clarify folded file context blocks during condensation#12000

Draft
roomote-v0[bot] wants to merge 1 commit intomainfrom
fix/clarify-folded-file-context-11989
Draft

fix: clarify folded file context blocks during condensation#12000
roomote-v0[bot] wants to merge 1 commit intomainfrom
fix/clarify-folded-file-context-11989

Conversation

@roomote-v0
Copy link
Copy Markdown
Contributor

@roomote-v0 roomote-v0 bot commented Mar 26, 2026

Related GitHub Issue

Closes: #11989

Description

This PR attempts to address Issue #11989 where models misinterpret condensed file summaries as "compressed" read_file output, causing them to repeatedly fetch small snippets instead of reading full files.

The fix adds a brief explanatory note to each <system-reminder> block generated during context condensation:

(Structural summary from context condensation - shows signatures only. Use read_file to get full content when needed.)

This note appears between the ## File Context: header and the tree-sitter definitions, making it clear to the model that:

  • This is a structural summary (signatures only), not compressed file content
  • It was generated during context condensation, not by the read_file tool
  • The model should use read_file to get full content when implementation details are needed

Files changed:

  • src/core/condense/foldedFileContext.ts - Added explanatory note to both normal and truncated section templates
  • src/core/condense/__tests__/foldedFileContext.spec.ts - Added test verifying the explanatory note is present and correctly positioned; adjusted budget test threshold

Test Procedure

  • All 123 existing condense tests pass (cd src && npx vitest run core/condense/__tests__/)
  • New test verifies the explanatory note appears between the header and definitions
  • Linting and type checks pass across all packages

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue.
  • Scope: Changes are focused on the linked issue.
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New test added to cover the explanatory note.
  • Documentation Impact: No documentation updates required.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Documentation Updates

  • No documentation updates are required.

Additional Notes

Feedback and guidance are welcome.

Interactively review PR in Roo Code Cloud

…sation

Models were misinterpreting condensed file summaries as "compressed" read_file
output, causing them to repeatedly fetch small snippets. This adds a clear note
to each <system-reminder> block explaining that it is a structural summary from
context condensation (signatures only) and that read_file should be used to get
full content when needed.

Closes #11989
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] File Reads getting compressed

1 participant