Skip to content

The agent that grows with you

fmt(js): `npm run fix` on merge (#88818)

hermes-seaeye[bot]41a80d52518c
diff --git a/apps/desktop/src/plugins/kanban/completion-notify.test.ts b/apps/desktop/src/plugins/kanban/completion-notify.test.ts
index 3c1d0f4416b..9eb0ab36bff 100644
--- a/apps/desktop/src/plugins/kanban/completion-notify.test.ts
+++ b/apps/desktop/src/plugins/kanban/completion-notify.test.ts
@@ -42,6 +42,7 @@ type NotifyInput = {
detail?: string
action?: { label: string; onClick: () => void }
}
+
const lastNotify = (): NotifyInput =>
hostMock.notify.mock.calls[hostMock.notify.mock.calls.length - 1][0] as NotifyInput
@@ -489,6 +490,7 @@ describe('native OS door', () => {
throw new Error('no shell')
})
}
+
const m = await loadModule()
m.bindCompletionNotify(makeRest(() => 100) as never, undefined, os)
diff --git a/apps/desktop/src/plugins/kanban/completion-notify.ts b/apps/desktop/src/plugins/kanban/completion-notify.ts
index 6a4acabe326..9d97688d4e1 100644
--- a/apps/desktop/src/plugins/kanban/completion-notify.ts
+++ b/apps/desktop/src/plugins/kanban/completion-notify.ts
@@ -95,12 +95,14 @@ async function ensureBaseline(slug: string): Promise<void> {
if (seenEventIdByBoard.has(slug) || baselinePending.has(slug)) {
return
}
+
baselinePending.add(slug)
try {
const board = (await rest!<{ latest_event_id?: unknown }>(`/board?board=${encodeURIComponent(slug)}`)) as {
latest_event_id?: unknown
}
+
seenEventIdByBoard.set(slug, typeof board.latest_event_id === 'number' ? board.latest_event_id : 0)
} catch {
// Fail-closed: unknown baseline → notifications stay suppressed.
@@ -150,6 +152,7 @@ function notifyOne(kind: string, spec: { titleKey: string; toast: ToastKind }, e
: artifacts.length > 1
? t('notify.artifacts', artifacts.length)
: ''
+
const detail = [taskId, artifactText].filter(Boolean).join(' · ')
const title = t(spec.titleKey)
const message = body || taskId || title
@@ -178,12 +181,14 @@ export async function onKanbanEventsFrame(slug: string, events?: CompletionEvent
if (!events?.length || slug === '' || !rest) {
return false
}
+
await ensureBaseline(slug)
const seen = seenEventIdByBoard.get(slug)
if (seen === undefined) {
return false
} // fail-closed
+
let fired = false
let cursor = seen
@@ -191,6 +196,7 @@ export async function onKanbanEventsFrame(slug: string, events?: CompletionEvent
if (typeof ev.id !== 'number' || ev.id <= cursor) {
continue
}
+
cursor = ev.id
seenEventIdByBoard.set(slug, cursor)
const spec = TERMINAL_NOTIFY.get(ev.kind ?? '')