MCPcopy Create free account
hub / github.com/tiann/hapi / cancelByLocalId

Method cancelByLocalId

cli/src/utils/MessageQueue2.ts:264–270  ·  view source on GitHub ↗

* Remove the first queued message that matches the given localId. * Returns true if a message was removed, false if not found. * Best-effort: if the CLI is offline when cancel is issued, the message * may already have been collected for invocation and won't be found here.

(localId: string)

Source from the content-addressed store, hash-verified

262 * may already have been collected for invocation and won't be found here.
263 */
264 cancelByLocalId(localId: string): boolean {
265 if (!localId) return false;
266 const idx = this.queue.findIndex(item => item.localId === localId);
267 if (idx === -1) return false;
268 this.queue.splice(idx, 1);
269 return true;
270 }
271
272 /**
273 * Reset the queue - clears all messages and resets to empty state

Callers 8

runGeminiFunction · 0.95
runCursorFunction · 0.95
runOpencodeFunction · 0.95
runCodexFunction · 0.95
runAgentSessionFunction · 0.95
runClaudeFunction · 0.95
runKimiFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected