This repository was archived by the owner on May 15, 2026. It is now read-only.
Commit 845865e
committed
fix: record truncation event when condensation fails but truncation succeeds
The else-if chain in attemptApiRequest() prevented both error AND truncation
events from being recorded when context condensation fails but sliding window
truncation succeeds as a fallback.
When manageContext() returns both 'error' (condensation failed) and
'truncationId' (truncation happened as fallback), only the error was shown
because of the else-if chain. This meant the sliding_window_truncation
clineMessage was never created, breaking rewind functionality since
MessageManager.collectRemovedContextEventIds() couldn't find the truncation ID
to clean up orphaned truncationParent tags.
Fix: Change 'else if' to separate 'if' statements so both events can be
recorded, allowing rewind to properly restore hidden messages.1 parent 7534e19 commit 845865e
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4012 | 4012 | | |
4013 | 4013 | | |
4014 | 4014 | | |
4015 | | - | |
| 4015 | + | |
| 4016 | + | |
4016 | 4017 | | |
4017 | 4018 | | |
4018 | 4019 | | |
| |||
0 commit comments