Skip to content

feat: refactors truncation strategy to always keep the first user message#280

Merged
philipph-askui merged 3 commits into
mainfrom
feat/keep_first_user_message_on_truncation
Jun 2, 2026
Merged

feat: refactors truncation strategy to always keep the first user message#280
philipph-askui merged 3 commits into
mainfrom
feat/keep_first_user_message_on_truncation

Conversation

@philipph-askui
Copy link
Copy Markdown
Contributor

@philipph-askui philipph-askui commented May 29, 2026

the first user message usually contains a lot of critical information. To make sure it is not lost, we should always keep it, even when truncating

Also, this PR updates the truncation trigger threshold from 70k tokens to 112k tokens, increasing the headroom for new messages after truncation by roughly 2x

@philipph-askui philipph-askui marked this pull request as ready for review May 29, 2026 12:52
@philipph-askui philipph-askui changed the title fix: refactors truncation strategy to always keep the first user message feat: refactors truncation strategy to always keep the first user message May 29, 2026
Comment thread src/askui/models/shared/truncation_strategies.py
Comment thread src/askui/models/shared/truncation_strategies.py Outdated
@philipph-askui philipph-askui merged commit 6c5b542 into main Jun 2, 2026
1 check passed
@philipph-askui philipph-askui deleted the feat/keep_first_user_message_on_truncation branch June 2, 2026 08:42
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.

2 participants