MCPcopy Create free account
hub / github.com/Noumena-Network/code / keep

Function keep

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

hasMethod · 0.45

Tested by

no test coverage detected