MCPcopy Index your code
hub / github.com/Opencode-DCP/opencode-dynamic-context-pruning / resetOnCompaction

Function resetOnCompaction

lib/state/utils.ts:331–345  ·  view source on GitHub ↗
(state: SessionState)

Source from the content-addressed store, hash-verified

329}
330
331export function resetOnCompaction(state: SessionState): void {
332 state.toolParameters.clear()
333 state.prune.tools = new Map<string, number>()
334 state.prune.messages = createPruneMessagesState()
335 state.messageIds = {
336 byRawId: new Map<string, string>(),
337 byRef: new Map<string, string>(),
338 nextRef: 1,
339 }
340 state.nudges = {
341 contextLimitAnchors: new Set<string>(),
342 turnNudgeAnchors: new Set<string>(),
343 iterationNudgeAnchors: new Set<string>(),
344 }
345}

Callers 1

checkSessionFunction · 0.90

Calls 1

createPruneMessagesStateFunction · 0.85

Tested by

no test coverage detected