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

Method emitMessagesConsumed

cli/src/api/apiSession.ts:588–604  ·  view source on GitHub ↗
(localIds: string[], options?: { clearQueuedThinkingGrace?: boolean })

Source from the content-addressed store, hash-verified

586 }
587
588 emitMessagesConsumed(localIds: string[], options?: { clearQueuedThinkingGrace?: boolean }): void {
589 if (localIds.length === 0) return
590 // `clearQueuedThinkingGrace` is an opt-in signal for the hub to drop
591 // the 15s queued-thinking grace immediately. Only synchronous handlers
592 // that will never call `onThinkingChange(true)` (slash commands handled
593 // inside `onUserMessage`) should set it — normal queue drains still
594 // need the grace so the spinner doesn't flicker between drain and
595 // backend.prompt start.
596 const payload: { sid: string; localIds: string[]; clearQueuedThinkingGrace?: boolean } = {
597 sid: this.sessionId,
598 localIds
599 }
600 if (options?.clearQueuedThinkingGrace) {
601 payload.clearQueuedThinkingGrace = true
602 }
603 this.socket.emit('messages-consumed', payload)
604 }
605
606 sendSessionDeath(reason?: SessionEndReason): void {
607 void cleanupUploadDir(this.sessionId)

Callers 4

runOpencodeFunction · 0.80
runCodexFunction · 0.80
constructorMethod · 0.80
runClaudeFunction · 0.80

Calls 1

emitMethod · 0.45

Tested by

no test coverage detected