True for messages that correspond to a real agent-core `_history` entry — * i.e. `append_message` and `compaction_summary` (the summary IS in `_history`). * The synthetic UI-only markers (`undo` / `clear`) are NOT in `_history`, so * index-based operations that mirror agent-core (compaction sl
(pm: ProjectedMessage)
| 664 | * index-based operations that mirror agent-core (compaction slice, micro- |
| 665 | * compaction cutoff) must skip them to stay aligned with agent-core indices. */ |
| 666 | function isHistoryEntry(pm: ProjectedMessage): boolean { |
| 667 | return pm.source !== 'undo' && pm.source !== 'clear'; |
| 668 | } |
| 669 | |
| 670 | /** Single source of truth for the `context.undo` backward walk, shared by both |
| 671 | * projection modes. Mirrors agent-core `undo` (`agent/context/index.ts`): walk |