MCPcopy Create free account
hub / github.com/codeaashu/claude-code / keep

Function keep

src/services/PromptSuggestion/speculation.ts:233–253  ·  view source on GitHub ↗
(b: {
    type: string
    id?: string
    tool_use_id?: string
    text?: string
  })

Source from the content-addressed store, hash-verified

231 )
232
233 const keep = (b: {
234 type: string
235 id?: string
236 tool_use_id?: string
237 text?: string
238 }) =>
239 b.type !== 'thinking' &&
240 b.type !== 'redacted_thinking' &&
241 !(b.type === 'tool_use' && !toolIdsWithSuccessfulResults.has(b.id!)) &&
242 !(
243 b.type === 'tool_result' &&
244 !toolIdsWithSuccessfulResults.has(b.tool_use_id!)
245 ) &&
246 // Abort during speculation yields a standalone interrupt user message
247 // (query.ts createUserInterruptionMessage). Strip it so it isn't surfaced
248 // to the model as real user input.
249 !(
250 b.type === 'text' &&
251 (b.text === INTERRUPT_MESSAGE ||
252 b.text === INTERRUPT_MESSAGE_FOR_TOOL_USE)
253 )
254
255 return messages
256 .map(msg => {

Callers

nothing calls this directly

Calls 1

hasMethod · 0.45

Tested by

no test coverage detected