MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / isHistoryEntry

Function isHistoryEntry

apps/vis/server/src/lib/context-projector.ts:666–668  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

664 * index-based operations that mirror agent-core (compaction slice, micro-
665 * compaction cutoff) must skip them to stay aligned with agent-core indices. */
666function 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

Callers 1

projectContextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected