Skip to content

The agent that grows with you

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

hermes-seaeye[bot]c7c2df1a536d
diff --git a/apps/desktop/electron/command-screenshot-monitor.test.ts b/apps/desktop/electron/command-screenshot-monitor.test.ts
index 44c8cc398e0..2442eeae212 100644
--- a/apps/desktop/electron/command-screenshot-monitor.test.ts
+++ b/apps/desktop/electron/command-screenshot-monitor.test.ts
@@ -245,10 +245,12 @@ test.skipIf(process.platform !== 'darwin')(
const script = resolve(import.meta.dirname, '../scripts/build-command-screenshot-monitor.mjs')
execFileSync(process.execPath, [script, '--out-dir', resolve(dir, 'dist')], { timeout: 60_000 })
const binary = resolveCommandScreenshotMonitorPath(dir)
+
const architectures = execFileSync('xcrun', ['lipo', '-archs', binary], { encoding: 'utf8' })
.trim()
.split(/\s+/)
.sort()
+
assert.deepEqual(architectures, ['arm64', 'x86_64'])
const result = spawnSync(binary, ['--check'], { encoding: 'utf8', timeout: 5_000 })
assert.equal(result.error, undefined)
@@ -281,6 +283,7 @@ test.skipIf(process.platform !== 'darwin')(
monitor.stop()
reject(new Error('real monitor did not settle'))
}, 10_000)
+
monitor.start(
() => {},
status => {
diff --git a/apps/desktop/electron/command-screenshot.test.ts b/apps/desktop/electron/command-screenshot.test.ts
index 85bd1a6bba0..64acadb495e 100644
--- a/apps/desktop/electron/command-screenshot.test.ts
+++ b/apps/desktop/electron/command-screenshot.test.ts
@@ -6,6 +6,7 @@ import path from 'node:path'
import { afterEach, describe, expect, it, vi } from 'vitest'
const native = vi.hoisted(() => ({ start: vi.fn(), stop: vi.fn() }))
+
const electron = vi.hoisted(() => ({
handlers: new Map(),
windows: [] as any[],
@@ -13,6 +14,7 @@ const electron = vi.hoisted(() => ({
screenPermission: 'granted',
directory: ''
}))
+
vi.mock('./command-screenshot-monitor', () => ({
CommandScreenshotMonitor: class {
start = native.start
@@ -59,6 +61,7 @@ afterEach(async () => {
function window(id: number, url = 'http://127.0.0.1:5174/') {
const frame = { url }
+
const wc = Object.assign(new EventEmitter(), {
id,
mainFrame: frame,
@@ -66,6 +69,7 @@ function window(id: number, url = 'http://127.0.0.1:5174/') {
isDestroyed: () => false,
send: vi.fn()
})
+
const win = { webContents: wc, isDestroyed: () => false }
electron.windows.push(win)
diff --git a/apps/desktop/electron/command-screenshot.ts b/apps/desktop/electron/command-screenshot.ts
index 782eaa50e41..6b67e6a93bd 100644
--- a/apps/desktop/electron/command-screenshot.ts
+++ b/apps/desktop/electron/command-screenshot.ts
@@ -18,10 +18,12 @@ export function installCommandScreenshot({ rendererUrl }: { rendererUrl: string
const expectedUrl = new URL(rendererUrl)
const monitor = new CommandScreenshotMonitor({ appPath: app.getAppPath() })
const hasScreenPermission = () => systemPreferences.getMediaAccessStatus('screen') === 'granted'
+
const capture = createScreenshotCapture({
hasScreenPermission,
getSources: options => desktopCapturer.getSources(options)
})
+
const recipients = new Map<number, () => void>()
let lastRecipient: BrowserWindow | null = null
let enabled = false
diff --git a/apps/desktop/electron/github-api-auth.test.ts b/apps/desktop/electron/github-api-auth.test.ts
index 50987721754..ffc67e2c2a4 100644
--- a/apps/desktop/electron/github-api-auth.test.ts
+++ b/apps/desktop/electron/github-api-auth.test.ts
@@ -87,6 +87,7 @@ test('gh is found in the GUI-safe install locations a minimal launch PATH omits'
assert.equal(macos, brewGh)
const winGh = 'C:\\Program Files\\GitHub CLI\\gh.exe'
+
const windows = findGhCli(
{ Path: 'C:\\Windows\\System32', ProgramFiles: 'C:\\Program Files' },
'win32',
diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts
index 38dd6293d9f..c80a0388290 100644
--- a/apps/desktop/electron/main.ts
+++ b/apps/desktop/electron/main.ts
@@ -11420,7 +11420,11 @@ function profileRouteOptions(profile, request?) {
// primary, so legacy callers are unchanged.
async function ensureBackend(
profile,
- opts: { passive?: boolean; request?: { method?: string; path?: string }; spawnPriority?: LocalBackendSpawnPriority } = {}
+ opts: {
+ passive?: boolean
+ request?: { method?: string; path?: string }
+ spawnPriority?: LocalBackendSpawnPriority
+ } = {}
) {
localBackendLifecycle.assertCanStart()
const key = profile && String(profile).trim() ? String(profile).trim() : primaryProfileKey()
diff --git a/apps/desktop/electron/notification-ipc.test.ts b/apps/desktop/electron/notification-ipc.test.ts
index e72173704a7..e695a1741f7 100644
--- a/apps/desktop/electron/notification-ipc.test.ts
+++ b/apps/desktop/electron/notification-ipc.test.ts
@@ -50,6 +50,7 @@ it('returns native clicks and approval actions to the emitting window, not the p
focusWindow,
platform: 'darwin'
})
+
const notify = host.handle.mock.calls[0][1] as (
event: IpcMainInvokeEvent,
payload: HermesNotification
@@ -97,10 +98,12 @@ it('delivers plugin callbacks to their source and falls back only for navigation
focusWindow,
platform: 'darwin'
})
+
const notify = host.handle.mock.calls[0][1] as (
event: IpcMainInvokeEvent,
payload: HermesNotification
) => Promise<boolean>
+
await notify({ sender: source.webContents } as unknown as IpcMainInvokeEvent, {
kind: 'plugin',
notifyId: 'source-callback',
diff --git a/apps/desktop/electron/pool-retirement-live-fixture/main.ts b/apps/desktop/electron/pool-retirement-live-fixture/main.ts
index 238500b9dc4..d14152806d7 100644
--- a/apps/desktop/electron/pool-retirement-live-fixture/main.ts
+++ b/apps/desktop/electron/pool-retirement-live-fixture/main.ts
@@ -79,6 +79,7 @@ const alive = (pid: number) => {
if ((error as NodeJS.ErrnoException).code === 'ESRCH') {
return false
}
+
throw error
}
}
@@ -201,6 +202,7 @@ async function spawnResident(key: string, release: () => void): Promise<Resident
if (child.exitCode !== null || child.signalCode !== null) {
throw new Error(`${key} exited before ready:\n${entry.output}`)
}
+
const match = entry.output.match(/HERMES_BACKEND_READY[^\n]*port=(\d+)/)
if (match) {
@@ -353,6 +355,7 @@ async function run() {
]) {
const index = (event: string, key: string) =>
receipts.findIndex(receipt => receipt.event === event && receipt.key === key)
+
assert.ok(index('committed', oldKey) < index('park', oldKey))
assert.ok(index('park', oldKey) < index('signal', oldKey))
assert.ok(index('signal', oldKey) < index('shutdown-held', oldKey))
@@ -393,12 +396,14 @@ async function finish(error?: unknown) {
if (finishing) {
return
}
+
finishing = true
retirer?.dispose()
for (const ticket of tickets) {
ticket.cancel()
}
+
let cleanupError: unknown
try {
diff --git a/apps/desktop/electron/portal-session-live-fixture/main.ts b/apps/desktop/electron/portal-session-live-fixture/main.ts
index 930ae2fc2ff..8e198a67153 100644
--- a/apps/desktop/electron/portal-session-live-fixture/main.ts
+++ b/apps/desktop/electron/portal-session-live-fixture/main.ts
@@ -122,10 +122,12 @@ async function run() {
await jar.cookies.remove(base, accessName())
mode = 'renew'
const before = refreshes
+
const [first, second] = await Promise.all([
portal.renewPortalAccessSilently(),
portal.renewPortalAccessSilently()
])
+
assert.equal(first, true)
assert.equal(second, true)
assert.equal(refreshes, before + 1)
@@ -198,6 +200,7 @@ async function run() {
for (const window of BrowserWindow.getAllWindows()) {
window.destroy()
}
+
server.closeAllConnections()
await new Promise<void>(resolve => server.close(() => resolve()))
}
diff --git a/apps/desktop/electron/renderer-heap-flags.test.ts b/apps/desktop/electron/renderer-heap-flags.test.ts
index 85e0dfbd315..0963cb9bafb 100644
--- a/apps/desktop/electron/renderer-heap-flags.test.ts
+++ b/apps/desktop/electron/renderer-heap-flags.test.ts
@@ -38,6 +38,7 @@ describe('renderer heap flags', () => {
const cfg = readDesktopLaunchConfig(
'desktop:\n electron_flags: [--disable-gpu]\n renderer_max_old_space_mb: 1536\n'
)
+
const planned = planLaunchSwitches(cfg, ['/app/hermes', '--js-flags=--expose-gc', '--disable-gpu'])
// --disable-gpu is already on the launcher's argv: not re-applied.
diff --git a/apps/desktop/electron/update-api-check.ts b/apps/desktop/electron/update-api-check.ts
index 84f9f561a4c..2ba882971c9 100644
--- a/apps/desktop/electron/update-api-check.ts
+++ b/apps/desktop/electron/update-api-check.ts
@@ -157,6 +157,7 @@ export function describeUpdateCheckFailure(error: UpdateCheckFailure | null | un
if ((status === 403 || status === 429) && error?.rateLimitRemaining === 0) {
const resetMs = typeof error.rateLimitReset === 'number' ? error.rateLimitReset * 1000 - now : NaN
const minutes = Number.isFinite(resetMs) && resetMs > 0 ? Math.ceil(resetMs / 60_000) : null
+
const when =
minutes === null ? 'within an hour' : minutes === 1 ? 'in about a minute' : `in about ${minutes} minutes`
diff --git a/apps/desktop/src/app/chat/composer/hooks/use-status-drawer.ts b/apps/desktop/src/app/chat/composer/hooks/use-status-drawer.ts
index 27985d62214..1db92b0ade3 100644
--- a/apps/desktop/src/app/chat/composer/hooks/use-status-drawer.ts
+++ b/apps/desktop/src/app/chat/composer/hooks/use-status-drawer.ts
@@ -18,11 +18,11 @@ export function useStatusDrawer(sessionKey: string | null) {
const route = isSessionOwnerRoute(owner) ? owner : null
const profile = normalizeProfileKey(
- route?.profile ?? (typeof owner === 'string' ? owner : scope.profile ?? activeProfile)
+ route?.profile ?? (typeof owner === 'string' ? owner : (scope.profile ?? activeProfile))
)
const targetProfile = normalizeProfileKey(route?.targetProfile ?? profile)
- const connectionId = route ? route.connectionId ?? null : owner ? null : scope.connectionId ?? activeConnection
+ const connectionId = route ? (route.connectionId ?? null) : owner ? null : (scope.connectionId ?? activeConnection)
const ownerKey = JSON.stringify([connectionId, profile, targetProfile])
const key = sessionKey ? statusDrawerKey({ connectionId, profile, targetProfile, sessionId: sessionKey }) : null
const saved = useStoreSelector($collapsedStatusDrawers, keys => key !== null && keys.includes(key))
diff --git a/apps/desktop/src/app/chat/history-window.ts b/apps/desktop/src/app/chat/history-window.ts
index 460914896f3..e5ebf0fac2f 100644
--- a/apps/desktop/src/app/chat/history-window.ts
+++ b/apps/desktop/src/app/chat/history-window.ts
@@ -104,11 +104,13 @@ export function useHistoryWindow({ scopeKey, storedId, scope, isCurrent }: Histo
if (signal.aborted || !Number.isSafeInteger(rowId) || rowId <= 0) {
return null
}
+
const captured = latest.current
if (!captured.storedId || !captured.isCurrent()) {
return null
}
+
const controller = new AbortController()
pending.current = controller
const abort = () => controller.abort()
@@ -140,6 +142,7 @@ export function useHistoryWindow({ scopeKey, storedId, scope, isCurrent }: Histo
if (!target) {
return null
}
+
setSelection({ lifetime: captured.lifetime, page: next })
return target.id
diff --git a/apps/desktop/src/app/chat/hooks/use-composer-actions.test.ts b/apps/desktop/src/app/chat/hooks/use-composer-actions.test.ts
index 8921c992503..32e4a93c8a7 100644
--- a/apps/desktop/src/app/chat/hooks/use-composer-actions.test.ts
+++ b/apps/desktop/src/app/chat/hooks/use-composer-actions.test.ts
@@ -299,12 +299,14 @@ describe('useComposerActions native image drops', () => {
it('does not attach a screenshot when its draft changes during native image saving', async () => {
let finishSave!: (path: string) => void
+
const saveImageBuffer = vi.fn(
() =>
new Promise<string>(resolve => {
finishSave = resolve
})
)
+
const add = vi.fn()
Object.defineProperty(window, 'hermesDesktop', { configurable: true, value: { saveImageBuffer } })
@@ -324,10 +326,12 @@ describe('useComposerActions native image drops', () => {
)
let current = true
+
const pending = result.current.attachImageBlob(
new Blob([new Uint8Array([1])], { type: 'image/png' }),
() => current
)
+
await vi.waitFor(() => expect(saveImageBuffer).toHaveBeenCalledOnce())
current = false
finishSave('/test/screenshot.png')
diff --git a/apps/desktop/src/app/contrib/hooks/restore-late-plugin-route.test.tsx b/apps/desktop/src/app/contrib/hooks/restore-late-plugin-route.test.tsx
index bd635ec71c4..970cb3fa2de 100644
--- a/apps/desktop/src/app/contrib/hooks/restore-late-plugin-route.test.tsx
+++ b/apps/desktop/src/app/contrib/hooks/restore-late-plugin-route.test.tsx
@@ -87,6 +87,7 @@ it('restores a remembered plugin page whose route registers after the session li
data: { path: '/html-gallery' },
render: () => null
})
+
act(() => $diskPluginsScanPending.set(false))
expect(navigate).toHaveBeenCalledWith('/html-gallery', { replace: true })
diff --git a/apps/desktop/src/app/gateway/hooks/use-gateway-boot.test.tsx b/apps/desktop/src/app/gateway/hooks/use-gateway-boot.test.tsx
index b2f3975d3ec..ed584ddb8b2 100644
--- a/apps/desktop/src/app/gateway/hooks/use-gateway-boot.test.tsx
+++ b/apps/desktop/src/app/gateway/hooks/use-gateway-boot.test.tsx
@@ -705,7 +705,7 @@ describe('shared host backend event provenance', () => {
})
}
- it("stamps a shared-primary profile-B event with B, not with the boot-time profile", async () => {
+ it('stamps a shared-primary profile-B event with B, not with the boot-time profile', async () => {
const desktop = fakeDesktop()
desktop.getConnection.mockResolvedValue(sharedPrimaryConn)
diff --git a/apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts b/apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts
index 28176c31358..f80e841c912 100644
--- a/apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts
+++ b/apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts
@@ -1038,9 +1038,7 @@ export function useGatewayBoot({
// LAST rung of knownOwnerForSession, so durable stored identity still
// outranks it — #97511.)
const ownedEvent =
- $connection.get()?.sharedPrimary === true
- ? stampSecondaryProfileOwner(scopedEvent, sourceProfile)
- : scopedEvent
+ $connection.get()?.sharedPrimary === true ? stampSecondaryProfileOwner(scopedEvent, sourceProfile) : scopedEvent
recordSessionEventScope(ownedEvent)
callbacksRef.current.handleGatewayEvent(ownedEvent)
diff --git a/apps/desktop/src/app/hooks/use-config-record.test.tsx b/apps/desktop/src/app/hooks/use-config-record.test.tsx
index 8bbac0e57fc..143b9de0839 100644
--- a/apps/desktop/src/app/hooks/use-config-record.test.tsx
+++ b/apps/desktop/src/app/hooks/use-config-record.test.tsx
@@ -44,7 +44,5 @@ it('updates the write origin when a refetch replaces the displayed record', asyn
await queryClient.invalidateQueries({ queryKey: HERMES_CONFIG_KEY })
await waitFor(() => expect(result.current.data).toEqual(second))
- await waitFor(() =>
- expect(result.current.writeScope).toEqual({ connectionId: 'connection-b', profile: 'worker' })
- )
+ await waitFor(() => expect(result.current.writeScope).toEqual({ connectionId: 'connection-b', profile: 'worker' }))
})
diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/server-requests.test.ts b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/server-requests.test.ts
index efdc3392aeb..5183d4e50a2 100644
--- a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/server-requests.test.ts
+++ b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/server-requests.test.ts
@@ -19,6 +19,7 @@ const deps = {
function deliver(method: string, params: Record<string, unknown>, activeSessionId: null | string) {
const respond = vi.fn()
const fail = vi.fn()
+
const handled = handleServerRequest(
{ fail, id: 'srq-1', method, params, profile: 'default', respond },
deps,
diff --git a/apps/desktop/src/app/session/hooks/use-prompt-actions/index.test.tsx b/apps/desktop/src/app/session/hooks/use-prompt-actions/index.test.tsx
index 1b4bda1dd19..f685a5d7b40 100644
--- a/apps/desktop/src/app/session/hooks/use-prompt-actions/index.test.tsx
+++ b/apps/desktop/src/app/session/hooks/use-prompt-actions/index.test.tsx
@@ -2288,6 +2288,7 @@ describe('usePromptActions submit / queue drain semantics', () => {
})
expect(accepted).toBe(true)
+
const calls = requestGateway.mock.calls.map(([method, params]) => [
method,
(params as { session_id?: string })?.session_id
diff --git a/apps/desktop/src/app/settings/chat-font-setting.test.tsx b/apps/desktop/src/app/settings/chat-font-setting.test.tsx
index d7464e5b098..24105241fef 100644
--- a/apps/desktop/src/app/settings/chat-font-setting.test.tsx
+++ b/apps/desktop/src/app/settings/chat-font-setting.test.tsx
@@ -44,7 +44,11 @@ vi.mock('@/store/notifications', () => ({
vi.mock('../hooks/use-config-record', () => ({
setHermesConfigCache: (config: Record<string, unknown>) => mocks.cache(config),
- useHermesConfigRecord: () => ({ data: mocks.loadedConfig, dataUpdatedAt: mocks.configUpdatedAt, writeScope: mocks.writeScope })
+ useHermesConfigRecord: () => ({
+ data: mocks.loadedConfig,
+ dataUpdatedAt: mocks.configUpdatedAt,
+ writeScope: mocks.writeScope
+ })
}))
vi.mock('../hooks/use-on-profile-switch', () => ({
diff --git a/apps/desktop/src/app/settings/toolset-config-panel.test.tsx b/apps/desktop/src/app/settings/toolset-config-panel.test.tsx
index 735dbfe0165..28062817fcd 100644
--- a/apps/desktop/src/app/settings/toolset-config-panel.test.tsx
+++ b/apps/desktop/src/app/settings/toolset-config-panel.test.tsx
@@ -208,10 +208,12 @@ describe('ToolsetConfigPanel', () => {
const voiceInput = screen.getByDisplayValue('alloy')
fireEvent.change(voiceInput, { target: { value: 'marin' } })
await waitFor(() => expect(saveHermesConfigRecord).toHaveBeenCalled(), { timeout: 3000 })
+
const saved = saveHermesConfigRecord.mock.calls.at(-1)?.[0] as Record<
string,
Record<string, Record<string, string>>
>
+
expect(saved.tts.openai.voice).toBe('marin')
// Unscoped panel (no Capabilities override) → profile rides as undefined,
// preserving the active-profile default. A scoped panel forwards its scope.
diff --git a/apps/desktop/src/components/assistant-ui/mcp-setup-tool.tsx b/apps/desktop/src/components/assistant-ui/mcp-setup-tool.tsx
index d6091bc4bc2..301933a18dd 100644
--- a/apps/desktop/src/components/assistant-ui/mcp-setup-tool.tsx
+++ b/apps/desktop/src/components/assistant-ui/mcp-setup-tool.tsx
@@ -382,6 +382,7 @@ function McpSetupRow({ action, onReissue, reissueBlocked, reissuing, request, ta
} satisfies Record<Exclude<McpVerb, 'none'>, ConnectorRowAction>
const displayServer = prettyName(server)
+
const rowCue = target.discoveryError
? t.connectors.authorizedToolsUnavailable
: verb === 'open'
diff --git a/apps/desktop/src/components/assistant-ui/thread/response-group.test.tsx b/apps/desktop/src/components/assistant-ui/thread/response-group.test.tsx
index 4509ed3a6cc..ec55e9d5485 100644
--- a/apps/desktop/src/components/assistant-ui/thread/response-group.test.tsx
+++ b/apps/desktop/src/components/assistant-ui/thread/response-group.test.tsx
@@ -79,11 +79,13 @@ it('keeps background continuations in one response with one action bar and the o
expect(container.querySelectorAll('[data-slot="aui_msg-actions"]')).toHaveLength(1)
unmount()
+
const reloaded = render(
<ThreadRuntime messages={messages}>
<Thread />
</ThreadRuntime>
)
+
expect(reloaded.container.querySelectorAll('[data-slot="aui_msg-actions"]')).toHaveLength(1)
reloaded.unmount()
}
@@ -104,6 +106,7 @@ it('ends the response at a real user prompt or unrelated system event', () => {
<Thread />
</ThreadRuntime>
)
+
expect(container.querySelectorAll('[data-slot="aui_turn-pair"]')).toHaveLength(2)
expect(container.querySelectorAll('[data-slot="aui_msg-actions"]')).toHaveLength(3)
})
diff --git a/apps/desktop/src/components/assistant-ui/thread/timeline-rail.test.tsx b/apps/desktop/src/components/assistant-ui/thread/timeline-rail.test.tsx
index 60be2224a54..9c7cf2d6971 100644
--- a/apps/desktop/src/components/assistant-ui/thread/timeline-rail.test.tsx
+++ b/apps/desktop/src/components/assistant-ui/thread/timeline-rail.test.tsx
@@ -55,7 +55,9 @@ describe('TimelineRail', () => {
const { container, rerender } = render(
<TimelineRail activeIndex={0} entries={entries} loadingId={null} onJump={vi.fn()} />
)
+
const rail = container.querySelector<HTMLElement>('[data-slot="thread-timeline-ticks"]')!
+
const widths = () =>
Array.from(rail.querySelectorAll<HTMLElement>('[data-slot="timeline-bar"]'), bar => bar.style.width)
diff --git a/apps/desktop/src/components/assistant-ui/thread/timeline.tsx b/apps/desktop/src/components/assistant-ui/thread/timeline.tsx
index e5fbc6871f9..83df45fcdaf 100644
--- a/apps/desktop/src/components/assistant-ui/thread/timeline.tsx
+++ b/apps/desktop/src/components/assistant-ui/thread/timeline.tsx
@@ -93,6 +93,7 @@ const ActiveThreadTimeline: FC = () => {
const railEntries = useMemo(() => {
const indexed = indexedEntries ?? []
+
const selected = history.isHistorical
? deriveTimelineEntries(
(history.currentMessages ?? []).map(message => ({
@@ -103,9 +104,11 @@ const ActiveThreadTimeline: FC = () => {
}))
)
: []
+
const loaded = new Map(
[...entries, ...selected].filter(entry => entry.rowId !== undefined).map(entry => [entry.rowId, entry])
)
+
const seen = new Set(indexed.map(entry => entry.rowId))
const merged = [
@@ -180,12 +183,14 @@ const ActiveThreadTimeline: FC = () => {
const timeout = window.setTimeout(() => finish(false), 15000)
controller.signal.addEventListener('abort', () => finish(false), { once: true })
+
const detail: TimelineRevealRequest = {
id,
rowId: railEntries.find(entry => entry.id === id)?.rowId,
signal: controller.signal,
complete: finish
}
+
viewport.dispatchEvent(new CustomEvent(TIMELINE_REVEAL_EVENT, { detail }))
})
diff --git a/apps/desktop/src/components/assistant-ui/thread/use-timeline-history.ts b/apps/desktop/src/components/assistant-ui/thread/use-timeline-history.ts
index e02b795e6f0..282cd06f730 100644
--- a/apps/desktop/src/components/assistant-ui/thread/use-timeline-history.ts
+++ b/apps/desktop/src/components/assistant-ui/thread/use-timeline-history.ts
@@ -51,7 +51,6 @@ export function useTimelineHistory() {
setFailed(key)
}
// Owner is represented by key; do not restart on object identity alone.
- // eslint-disable-next-line react-hooks/exhaustive-deps
},
[key, storedId, runtimeId, view]
)
@@ -89,6 +88,7 @@ export function useTimelineHistory() {
// chronological), page it forward once per new prompt — no timer; an
// incomplete index still pages on demand.
const last = value?.entries.at(-1)?.rowId
+
const stale =
value?.complete === true && newestPromptRowId !== undefined && (last === undefined || last < newestPromptRowId)
diff --git a/apps/desktop/src/components/assistant-ui/thread/use-timeline-reveal.ts b/apps/desktop/src/components/assistant-ui/thread/use-timeline-reveal.ts
index 1838540e030..057015d9f6c 100644
--- a/apps/desktop/src/components/assistant-ui/thread/use-timeline-reveal.ts
+++ b/apps/desktop/src/components/assistant-ui/thread/use-timeline-reveal.ts
@@ -30,6 +30,7 @@ export function useTimelineReveal(options: TimelineRevealOptions) {
if (!viewport) {
return
}
+
let current: AbortController | null = null
const onReveal = (event: Event) => {
@@ -43,6 +44,7 @@ export function useTimelineReveal(options: TimelineRevealOptions) {
if (request.signal.aborted) {
controller.abort()
}
+
const timeout = window.setTimeout(abort, 15000)
const valid = () => !controller.signal.aborted
const find = (id: string) => viewport.querySelector<HTMLElement>(`[data-message-id="${CSS.escape(id)}"]`)
@@ -51,12 +53,14 @@ export function useTimelineReveal(options: TimelineRevealOptions) {
latest.current.prepare()
let id = request.id
const rowId = request.rowId ?? (id.startsWith('history:') ? Number(id.slice(8)) : undefined)
+
const loaded =
rowId === undefined
? undefined
: [...(latest.current.history.currentMessages ?? []), ...view.$messages.get()].find(
message => message.rowId === rowId
)
+
id = loaded?.id ?? id
if (find(id)) {
@@ -73,6 +77,7 @@ export function useTimelineReveal(options: TimelineRevealOptions) {
if (!target || !valid()) {
return false
}
+
id = target
} else if (id === EARLIER_TIMELINE_ID) {
const state = latest.current
@@ -80,6 +85,7 @@ export function useTimelineReveal(options: TimelineRevealOptions) {
if (!state.olderAvailable && !state.hiddenCount) {
return false
}
+
state.revealBudget(state.renderBudget + 600)
if (!state.hiddenCount) {
@@ -107,7 +113,9 @@ export function useTimelineReveal(options: TimelineRevealOptions) {
if (!valid()) {
return finish(false)
}
+
const state = latest.current
+
const index =
id === EARLIER_TIMELINE_ID
? Math.max(0, state.hiddenCount - 1)
diff --git a/apps/desktop/src/components/boot-failure-cause.test.ts b/apps/desktop/src/components/boot-failure-cause.test.ts
index e9bd7c4b238..ede96cc9525 100644
--- a/apps/desktop/src/components/boot-failure-cause.test.ts
+++ b/apps/desktop/src/components/boot-failure-cause.test.ts
@@ -30,6 +30,7 @@ describe('local boot failure classification', () => {
it('keeps the raw output out of the headline and behind details', () => {
const raw =
'Hermes backend exited before it became ready (1).\nRecent backend output:\nTraceback (most recent call last):'
+
const copy = localBootFailureCopy(raw, CAUSES)
expect(copy.headline).toBe(CAUSES.exitedEarly)
diff --git a/apps/desktop/src/components/desktop-install-overlay.tsx b/apps/desktop/src/components/desktop-install-overlay.tsx
index 2b4c27a1cfb..e7f51ae3c3a 100644
--- a/apps/desktop/src/components/desktop-install-overlay.tsx
+++ b/apps/desktop/src/components/desktop-install-overlay.tsx
@@ -171,6 +171,7 @@ export function splitFailureDetails(text: string | null): [string, string | null
}
const lead = value.slice(0, marker).trim()
+
const detail = value
.slice(marker)
.replace(/^\s*Details:\s*/, '')
diff --git a/apps/desktop/src/components/onboarding/free-tier-setup-notice.test.tsx b/apps/desktop/src/components/onboarding/free-tier-setup-notice.test.tsx
index cbe81d62108..1f693136ff6 100644
--- a/apps/desktop/src/components/onboarding/free-tier-setup-notice.test.tsx
+++ b/apps/desktop/src/components/onboarding/free-tier-setup-notice.test.tsx
@@ -104,12 +104,14 @@ describe('FreeTierSetupNotice', () => {
cleanup()
$freeTierStatus.set(null)
+
const unreachable = ctxReturning({
...NO_IDENTITY,
error_code: 'anon_unreachable',
retryable: true,
retry_after: 15
})
+
render(<FreeTierSetupNotice ctx={unreachable} />)
await screen.findByTestId('free-tier-setup-notice')
diff --git a/apps/desktop/src/lib/error-surface.test.ts b/apps/desktop/src/lib/error-surface.test.ts
index 6c9cf70f424..854ce293c18 100644
--- a/apps/desktop/src/lib/error-surface.test.ts
+++ b/apps/desktop/src/lib/error-surface.test.ts
@@ -149,6 +149,7 @@ describe('error copy never names a hidden Retry', () => {
provider: 'openai',
retryable: false
}
+
expect(errorRecoveryPlan(surface).retry).toBe(true)
})
@@ -159,6 +160,7 @@ describe('error copy never names a hidden Retry', () => {
provider: 'custom',
retryable: false
})!
+
const { body, title } = errorCardText(thread, surface)
expect(title).toBe(en.assistant.thread.errorCodes.upstream_blocked.title)
expect(body).toMatch(/firewall/i)
@@ -203,8 +205,10 @@ describe('free-tier refusals', () => {
it('every free-tier code has copy and the copy never blames the free model', () => {
for (const code of ERROR_CODE_KEYS.filter(key => key.startsWith('free_tier_'))) {
const copy = en.assistant.thread.errorCodes[code]
+
const text =
`${typeof copy.title === 'string' ? copy.title : ''} ${typeof copy.body === 'string' ? copy.body : ''}`.toLowerCase()
+
expect(text).not.toMatch(/free (service|model|tier) is (off|switched off|unavailable|down)/)
expect(text).not.toMatch(/anonymous|guest|credential|token|rate limit/)
}
diff --git a/apps/desktop/src/lib/onboarding-recommendations.ts b/apps/desktop/src/lib/onboarding-recommendations.ts
index 84f116dec47..0831a052f8c 100644
--- a/apps/desktop/src/lib/onboarding-recommendations.ts
+++ b/apps/desktop/src/lib/onboarding-recommendations.ts
@@ -37,6 +37,7 @@ export function onboardingRecommendations(
const terms = [entry.name, ...(entry.suggest?.keywords ?? []), ...(entry.suggest?.applications ?? [])]
.map(words)
.filter(Boolean)
+
const preferred = terms.some(term => selected.has(term))
const topical = terms.some(term => subject.includes(` ${term} `))
const detectedApps = entry.detected_apps ?? []
diff --git a/apps/desktop/src/plugins/hermes-bots/bot-row.test.tsx b/apps/desktop/src/plugins/hermes-bots/bot-row.test.tsx
index 98caa0d6e41..7004e668996 100644
--- a/apps/desktop/src/plugins/hermes-bots/bot-row.test.tsx
+++ b/apps/desktop/src/plugins/hermes-bots/bot-row.test.tsx
@@ -229,6 +229,7 @@ describe('the bot row context menu speaks the active language', () => {
describe('a group row', () => {
const members = [{ name: 'alpha' }, { name: 'beta' }, { name: 'gamma' }] as GroupMember[]
+
const row = (
<GroupRow
active={false}
diff --git a/apps/desktop/src/plugins/hermes-bots/group-activity.test.ts b/apps/desktop/src/plugins/hermes-bots/group-activity.test.ts
index a2ac0f06eb4..199424c2669 100644
--- a/apps/desktop/src/plugins/hermes-bots/group-activity.test.ts
+++ b/apps/desktop/src/plugins/hermes-bots/group-activity.test.ts
@@ -219,9 +219,11 @@ describe('turn arc', () => {
describe('epoch scoping', () => {
it('queues follow-ups without cancelling the active turn or losing its reply delta', async () => {
let release!: (reply: string) => void
+
const first = new Promise<string>(resolve => {
release = resolve
})
+
const room = await loadRoom({ turn: ({ n }) => (n === 1 ? first : '(pass)') })
const member: GroupMember[] = [{ name: 'research', title: '' }]
const thread = room.rounds.sendToGroupChat('Busy', member, 'first ask')!
diff --git a/apps/desktop/src/plugins/hermes-bots/group-chat-view.inline-code.test.tsx b/apps/desktop/src/plugins/hermes-bots/group-chat-view.inline-code.test.tsx
index 125bc64ee34..b9dc2e124cc 100644
--- a/apps/desktop/src/plugins/hermes-bots/group-chat-view.inline-code.test.tsx
+++ b/apps/desktop/src/plugins/hermes-bots/group-chat-view.inline-code.test.tsx
@@ -79,6 +79,7 @@ it('themes inline code in room message bodies with the chat inline-code tokens',
const log = [
{ id: 'm1', thread: 'a', from: { kind: 'member' as const, name: 'builder' }, text: 'discover_models', at: 1 }
]
+
$groupChats.set({ Room: { log, watermarks: {}, sessions: {} } })
const { getByTestId } = render(<GroupChatWorkspace group="Room" members={[{ name: 'builder' }] as never} />)
diff --git a/apps/desktop/src/plugins/hermes-bots/group-chat-view.tsx b/apps/desktop/src/plugins/hermes-bots/group-chat-view.tsx
index 7be670b9fe3..55c5d680a7f 100644
--- a/apps/desktop/src/plugins/hermes-bots/group-chat-view.tsx
+++ b/apps/desktop/src/plugins/hermes-bots/group-chat-view.tsx
@@ -1088,6 +1088,7 @@ export function GroupChatWorkspace({ group, members, onBack, visible = true }: G
const seed = (current: string) =>
current.includes(`@${tag}`) ? current : `@${tag} ${current}`.replace(/\s+$/, ' ')
+
const thread = groupThreadOf(entry)
if (replyThread === thread) {
diff --git a/apps/desktop/src/plugins/hermes-bots/group-chat.test.ts b/apps/desktop/src/plugins/hermes-bots/group-chat.test.ts
index 91a5c5ccc33..84d67d4f7bc 100644
--- a/apps/desktop/src/plugins/hermes-bots/group-chat.test.ts
+++ b/apps/desktop/src/plugins/hermes-bots/group-chat.test.ts
@@ -218,6 +218,7 @@ describe('speaker labels', () => {
const data = await import('./data')
const local = { connectionId: 'local', connectionLabel: 'This device', name: 'reviewer', sourceScoped: true }
+
const spark = {
connectionId: 'spark',
connectionLabel: 'Spark',
@@ -253,6 +254,7 @@ describe('speaker labels', () => {
const data = await import('./data')
const local = { connectionId: 'local', connectionLabel: 'This device', name: 'reviewer', sourceScoped: true }
+
const spark = {
connectionId: 'spark',
connectionLabel: 'Spark',
@@ -260,6 +262,7 @@ describe('speaker labels', () => {
remoteSource: true,
sourceScoped: true
}
+
data.$lastRoster.set([local, spark])
data.$botMeta.set({})
diff --git a/apps/desktop/src/plugins/hermes-bots/group-rounds.test.ts b/apps/desktop/src/plugins/hermes-bots/group-rounds.test.ts
index f352d84dcb7..cc95e66eee1 100644
--- a/apps/desktop/src/plugins/hermes-bots/group-rounds.test.ts
+++ b/apps/desktop/src/plugins/hermes-bots/group-rounds.test.ts
@@ -120,6 +120,7 @@ describe('routing', () => {
const { rounds } = await loadRoom()
const local: GroupMember = { name: 'reviewer' }
+
const remote: GroupMember = {
connectionId: 'mini',
handle: 'reviewer-mini',
@@ -127,6 +128,7 @@ describe('routing', () => {
remoteSource: true,
sourceScoped: true
}
+
const members = [local, remote]
for (const member of members) {
@@ -274,6 +276,7 @@ describe('routing', () => {
it('matches self on the gateway install_id when Desktops label the connection differently', async () => {
const room = await loadRoom({ turn: () => 'Central here.' })
const { formatGroupChatLine } = await import('./group-round-prompt')
+
const local: GroupMember = {
connectionId: 'central',
connectionLabel: 'Central',
@@ -411,9 +414,11 @@ describe('round lifecycle', () => {
it('does not retry an ambiguous submit from prequeued same-thread or cross-thread sends', async () => {
let reject!: (error: Error) => void
+
const held = new Promise<string>((_resolve, fail) => {
reject = fail
})
+
const room = await loadRoom({ turn: ({ n }) => (n === 1 ? held : '(pass)') })
const members = [MEMBERS[0]]
const thread = room.rounds.sendToGroupChat('Failure', members, 'first')!
@@ -434,9 +439,11 @@ describe('round lifecycle', () => {
it('attributes a queued drive failure to the thread whose harvest failed', async () => {
let finish!: (reply: string) => void
+
const held = new Promise<string>(resolve => {
finish = resolve
})
+
const room = await loadRoom({ turn: () => held })
const first = room.rounds.sendToGroupChat('Failure', MEMBERS.slice(0, 2), '@research first')!
await drain(() => room.gateway.calls.length < 1)
@@ -529,9 +536,11 @@ describe('round lifecycle', () => {
describe('per-member delta', () => {
it('retained-log trimming cannot acknowledge messages appended during inference', async () => {
let release!: (reply: string) => void
+
const held = new Promise<string>(resolve => {
release = resolve
})
+
const room = await loadRoom({ turn: ({ n }) => (n === 1 ? held : '(pass)') })
const members = [MEMBERS[0]]
const thread = room.rounds.sendToGroupChat('Trim', members, 'delivered')!
diff --git a/apps/desktop/src/plugins/hermes-bots/group-rounds.ts b/apps/desktop/src/plugins/hermes-bots/group-rounds.ts
index 7ce4b13ec9f..18d53bd033f 100644
--- a/apps/desktop/src/plugins/hermes-bots/group-rounds.ts
+++ b/apps/desktop/src/plugins/hermes-bots/group-rounds.ts
@@ -328,6 +328,7 @@ function stopWordPlacement(value: string): 'adjacent' | 'distant' | null {
maskQuotedAndCodeSpans(value)
.toLowerCase()
.match(/@[\p{L}\p{N}._-]+|[\p{L}\p{N}_-]+/gu) || []
+
const mentionAt: number[] = []
const stopAt: number[] = []
diff --git a/apps/desktop/src/plugins/hermes-bots/relay.test.ts b/apps/desktop/src/plugins/hermes-bots/relay.test.ts
index 1a29bd78c2c..ac46d5543ee 100644
--- a/apps/desktop/src/plugins/hermes-bots/relay.test.ts
+++ b/apps/desktop/src/plugins/hermes-bots/relay.test.ts
@@ -858,6 +858,7 @@ describe('the drain loop does not let one delivery hold every other gateway’s
// and the sender's waiter is finite.
type RelayEnvelopeFixture = { id: string; message: string; target_connection: string; target_profile: string }
const toB: RelayEnvelopeFixture = { id: 'env-1', message: 'long job', target_connection: 'b', target_profile: 'ops' }
+
const toA: RelayEnvelopeFixture = {
id: 'env-2',
message: 'quick one',
diff --git a/apps/desktop/src/plugins/hermes-bots/roster-actions.test.ts b/apps/desktop/src/plugins/hermes-bots/roster-actions.test.ts
index f8e6d49cc65..6a7d347b748 100644
--- a/apps/desktop/src/plugins/hermes-bots/roster-actions.test.ts
+++ b/apps/desktop/src/plugins/hermes-bots/roster-actions.test.ts
@@ -159,6 +159,7 @@ describe('new activity after the seed', () => {
const toasts = hostMock.notify.mock.calls.filter(
c => c[0].title.includes('has new activity') || c[0].title.includes('New message for')
)
+
expect(toasts.length).toBe(1)
})
@@ -173,6 +174,7 @@ describe('new activity after the seed', () => {
const toasts = hostMock.notify.mock.calls.filter(
c => c[0].title.includes('has new activity') || c[0].title.includes('New message for')
)
+
expect(toasts.length).toBe(2)
})
diff --git a/apps/desktop/src/store/connection-request.ts b/apps/desktop/src/store/connection-request.ts
index 42543191be7..d8a5df392e6 100644
--- a/apps/desktop/src/store/connection-request.ts
+++ b/apps/desktop/src/store/connection-request.ts
@@ -100,6 +100,7 @@ const TARGET_STATES: readonly ConnectionTargetState[] = [
]
const ACTIONS: readonly ConnectionTargetAction[] = ['authorize', 'connect', 'enable', 'install', 'reconnect']
+
const SETTLE_REASONS: readonly ConnectionSettleReason[] = [
'all_resolved',
'continue',
diff --git a/apps/desktop/src/store/hub-actions.blocked.test.ts b/apps/desktop/src/store/hub-actions.blocked.test.ts
index 1b4fa63b3e3..3b8ddac590e 100644
--- a/apps/desktop/src/store/hub-actions.blocked.test.ts
+++ b/apps/desktop/src/store/hub-actions.blocked.test.ts
@@ -49,6 +49,7 @@ test('the current CLI "Not installed:" tail parses into findings + trust', () =>
const uncounted = [
"Not installed: the security scan found high-risk patterns in 'org/skill' (listed above). Re-run with --force to install anyway."
]
+
expect(parseInstallBlocked(uncounted)).toEqual({ findings: 0, unverified: false })
})
diff --git a/apps/desktop/src/store/plugin-catalog-install.test.ts b/apps/desktop/src/store/plugin-catalog-install.test.ts
index caad92f0faf..1032e1bec37 100644
--- a/apps/desktop/src/store/plugin-catalog-install.test.ts
+++ b/apps/desktop/src/store/plugin-catalog-install.test.ts
@@ -62,6 +62,7 @@ describe('requestPluginCatalogInstallFromDeepLink', () => {
const feed = JSON.stringify([
{ name: 'weather', repo: 'https://github.com/x/weather', sha: 'a'.repeat(40), subdir: '' }
])
+
const fetchSpy = vi.spyOn(globalThis, 'fetch').mockImplementation(async () => new Response(feed, { status: 200 }))
await requestPluginCatalogInstallFromDeepLink('weather-evil')
diff --git a/apps/desktop/src/store/suggestion-providers/mcp.test.ts b/apps/desktop/src/store/suggestion-providers/mcp.test.ts
index fd61a891abb..8d643a1dbe5 100644
--- a/apps/desktop/src/store/suggestion-providers/mcp.test.ts
+++ b/apps/desktop/src/store/suggestion-providers/mcp.test.ts
@@ -10,6 +10,7 @@ it('does not send local-app or non-OAuth catalog suggestions through the hosted
transport: 'http',
suggest: { keywords: ['hosted'], hosts: [] }
}
+
const editor = {
...hosted,
name: 'editor',
@@ -17,6 +18,7 @@ it('does not send local-app or non-OAuth catalog suggestions through the hosted
auth_type: 'none',
suggest: { ...hosted.suggest, requires_app: true }
}
+
const key = { ...hosted, name: 'key', auth_type: 'api_key' }
const stdio = { ...hosted, name: 'stdio', url: null, transport: 'stdio' }
expect(buildMcpSuggestionIndex([hosted, editor, key, stdio]).map(row => row.server)).toEqual([hosted.name])
diff --git a/ui-tui/src/__tests__/createGatewayEventHandler.test.ts b/ui-tui/src/__tests__/createGatewayEventHandler.test.ts
index 15c251d8865..3a4c8e84c37 100644
--- a/ui-tui/src/__tests__/createGatewayEventHandler.test.ts
+++ b/ui-tui/src/__tests__/createGatewayEventHandler.test.ts
@@ -1740,6 +1740,7 @@ describe('createGatewayEventHandler', () => {
it('renders a failed turn from error_surface instead of the raw provider JSON', () => {
const appended: Msg[] = []
const onEvent = createGatewayEventHandler(buildCtx(appended))
+
const raw =
'Error code: 401 - {"error": {"message": "Incorrect API key provided", "type": "invalid_request_error"}}'
diff --git a/ui-tui/src/hooks/useCompletion.ts b/ui-tui/src/hooks/useCompletion.ts
index ab1ef2650af..bf6e4b0ec69 100644
--- a/ui-tui/src/hooks/useCompletion.ts
+++ b/ui-tui/src/hooks/useCompletion.ts
@@ -120,6 +120,7 @@ export function useCompletion(input: string, blocked: boolean, gw: GatewayClient
// Skill completions are per session: project-local skills follow the
// session's repo, so the gateway must know which session is asking.
const sid = getUiState().sid
+
const params =
request.method === 'complete.slash' && sid ? { ...request.params, session_id: sid } : request.params