You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes#43066. After context compaction, the session DB flush cursor (_last_flushed_db_idx) could retain a stale offset from the pre-compression history, causing compressed messages to not be written to the new child session. This also fixes merge_text=True in queue-mode busy paths that incorrectly joined separate user messages into a single turn.
The two merge_text=True → merge_text=False changes in gateway/run.py (around lines 6786 and 6806) are the cause. Rapid sequential Telegram messages were previously merged into "part one\npart two" in the pending queue; with merge_text=False, the second message replaces the first, producing only "part two".
The _last_flushed_db_idx = 0 defensive resets look correct and address the compaction flush cursor issue (#43066). However, the merge_text change is a separate behavioral modification — it affects all platform adapters that use the pending-message queue, not just the compaction code path.
Suggestion: Split the merge_text change into a separate commit/PR with a clear justification for why merging is no longer desired. The _last_flushed_db_idx fix can land independently.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
comp/agentCore agent loop, run_agent.py, prompt buildercomp/gatewayGateway runner, session dispatch, deliveryP1High — major feature broken, no workaroundtype/bugSomething isn't working
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #43066. After context compaction, the session DB flush cursor (_last_flushed_db_idx) could retain a stale offset from the pre-compression history, causing compressed messages to not be written to the new child session. This also fixes merge_text=True in queue-mode busy paths that incorrectly joined separate user messages into a single turn.