MCPcopy Create free account
hub / github.com/anomalyco/opencode / handleSessionIdle

Function handleSessionIdle

packages/app/src/context/notification.tsx:328–352  ·  view source on GitHub ↗
(directory: string, event: { properties: { sessionID?: string } }, time: number)

Source from the content-addressed store, hash-verified

326 }
327
328 const handleSessionIdle = (directory: string, event: { properties: { sessionID?: string } }, time: number) => {
329 const sessionID = event.properties.sessionID
330 void lookup(directory, sessionID).then((session) => {
331 if (meta.disposed) return
332 if (!session) return
333 if (session.parentID) return
334
335 if (settings.sounds.agentEnabled()) {
336 void playSoundById(settings.sounds.agent())
337 }
338
339 append({
340 directory,
341 time,
342 viewed: viewedInCurrentSession(directory, sessionID),
343 type: "turn-complete",
344 session: sessionID,
345 })
346
347 const href = `/${base64Encode(directory)}/session/${sessionID}`
348 if (settings.notifications.agent()) {
349 void platform.notify(language.t("notification.session.responseReady.title"), session.title ?? sessionID, href)
350 }
351 })
352 }
353
354 const handleSessionError = (
355 directory: string,

Callers 1

Calls 6

playSoundByIdFunction · 0.90
base64EncodeFunction · 0.90
viewedInCurrentSessionFunction · 0.85
agentMethod · 0.80
lookupFunction · 0.70
appendFunction · 0.70

Tested by

no test coverage detected