MCPcopy Create free account
hub / github.com/anomalyco/opencode / deleteMessageParts

Function deleteMessageParts

packages/app/src/context/server-session.ts:157–166  ·  view source on GitHub ↗
(
    cache: { part: Record<string, Part[] | undefined>; part_text_accum_delta: Record<string, string | undefined> },
    messageID: string,
  )

Source from the content-addressed store, hash-verified

155 const removedMessages = new Map<string, Set<string>>()
156 const deltaBases = new Map<string, { base: string; sessionID: string }>()
157 const deleteMessageParts = (
158 cache: { part: Record<string, Part[] | undefined>; part_text_accum_delta: Record<string, string | undefined> },
159 messageID: string,
160 ) => {
161 for (const part of cache.part[messageID] ?? []) {
162 delete cache.part_text_accum_delta[part.id]
163 deltaBases.delete(part.id)
164 }
165 delete cache.part[messageID]
166 }
167 const seen = new Set<string>()
168 const infoSeen = new Set<string>()
169 const pinned = new Map<string, number>()

Callers 6

replaceMessagesFunction · 0.85
replacePartsFunction · 0.85
applyMessagePageFunction · 0.85
loadMessagesFunction · 0.85
applyFunction · 0.85
removeFunction · 0.85

Calls 1

deleteMethod · 0.45

Tested by

no test coverage detected