Skip to content

Conversation

@uinstinct
Copy link
Contributor

@uinstinct uinstinct commented Oct 31, 2025

Description

Prevent infinite looping when auto compaction happens.
Also prune messages when auto compaction fails and context length is invalid/exceeding, until chat history is within context length.

resolves CON-4681
resolves CON-4455

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-review

Checklist

  • [] I've read the contributing guide
  • [] The relevant docs, if any, have been updated or created
  • [] The relevant tests, if any, have been updated or created

Screen recording or screenshot

(both having context length set as 300 in the config.yaml)

before.mp4
after.mp4

Tests

[ What tests were added or updated to ensure the changes work as expected? ]

@uinstinct uinstinct requested a review from a team as a code owner October 31, 2025 08:06
@uinstinct uinstinct requested review from RomneyDa and removed request for a team October 31, 2025 08:06
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Oct 31, 2025
@uinstinct uinstinct changed the title fix: prevent auto compaction loop and prune messages until valid fix(cli): prevent auto compaction loop and prune messages until valid Oct 31, 2025
@uinstinct
Copy link
Contributor Author

Was looking at countChatHistoryItemTokens. Why do we not count the systemMessage and the tool call results?

From the ticket, it looks like there is some counting mistake that is happening because before getting the 500 error from the server, we should have received our internal Context length validation failed error in the tui.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

@sestinj sestinj merged commit 824e45c into continuedev:main Nov 17, 2025
59 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Issues and PRs Nov 17, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Nov 17, 2025
@uinstinct uinstinct deleted the cli-compaction-and-tokens branch November 18, 2025 04:47
@sestinj
Copy link
Contributor

sestinj commented Nov 18, 2025

🎉 This PR is included in version 1.29.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sestinj
Copy link
Contributor

sestinj commented Nov 19, 2025

🎉 This PR is included in version 1.34.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sestinj
Copy link
Contributor

sestinj commented Nov 19, 2025

🎉 This PR is included in version 1.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sestinj
Copy link
Contributor

sestinj commented Nov 20, 2025

🎉 This PR is included in version 1.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

released size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants