MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / stop

Function stop

cli/src/utils/send-message-timer.ts:74–97  ·  view source on GitHub ↗
(outcome: SendMessageTimerOutcome)

Source from the content-addressed store, hash-verified

72 }
73
74 const stop = (outcome: SendMessageTimerOutcome) => {
75 if (!timerActive || timerStartedAt == null || !timerMessageId) {
76 return null
77 }
78 timerActive = false
79 mainAgentTimer.stop()
80 const finishedAt = now()
81 const elapsedMs = Math.max(0, finishedAt - timerStartedAt)
82 const stopEvent: SendMessageTimerEvent = {
83 type: 'stop',
84 startedAt: timerStartedAt,
85 finishedAt,
86 elapsedMs,
87 messageId: timerMessageId,
88 outcome,
89 }
90 if (agentId) {
91 stopEvent.agentId = agentId
92 }
93 onTimerEvent(stopEvent)
94 timerStartedAt = null
95 timerMessageId = null
96 return { finishedAt, elapsedMs }
97 }
98
99 const pause = () => {
100 mainAgentTimer.pause()

Callers

nothing calls this directly

Calls 1

stopMethod · 0.80

Tested by

no test coverage detected