Skip to content

The agent that grows with you

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

hermes-seaeye[bot]031d2237ade7
diff --git a/apps/desktop/electron/hardening.test.ts b/apps/desktop/electron/hardening.test.ts
index 7aae6b7c2fc..7d70271009d 100644
--- a/apps/desktop/electron/hardening.test.ts
+++ b/apps/desktop/electron/hardening.test.ts
@@ -1082,7 +1082,7 @@ test('isMissingFileError classifies ENOENT/ENOTDIR as expected preview-read outc
})
test('missingFileResult builds the structured missing-file IPC answer', () => {
- const error = new Error('ENOENT: no such file or directory, open \'/tmp/gone.txt\'')
+ const error = new Error("ENOENT: no such file or directory, open '/tmp/gone.txt'")
;(error as NodeJS.ErrnoException).code = 'ENOENT'
diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts
index 8306c12625d..30d95a64d76 100644
--- a/apps/desktop/electron/main.ts
+++ b/apps/desktop/electron/main.ts
@@ -5766,7 +5766,6 @@ function filenameFromUrl(rawUrl, fallback = 'image') {
}
}
-
async function resourceBufferFromUrl(rawUrl) {
if (!rawUrl) {
throw new Error('Missing URL')
@@ -7146,7 +7145,10 @@ function installMediaPermissions() {
// the request's own `requestingUrl` — the URL the frame actually asked for —
// whose origin is exact for both hub deployments and `null` for anything
// sandboxed or opaque.
-function focusedFrameOrigin(webContents: { getURL?: () => string } | null | undefined, details?: { requestingUrl?: string }): string | null {
+function focusedFrameOrigin(
+ webContents: { getURL?: () => string } | null | undefined,
+ details?: { requestingUrl?: string }
+): string | null {
try {
if (details?.requestingUrl) {
return new URL(details.requestingUrl).origin
@@ -7176,7 +7178,11 @@ function isHermesHubPickerUrl(url: string): boolean {
}
/** Look up a subframe by its process/routing id; never throws. */
-function findFrameByIdentifier(webContents: { frames?: readonly unknown[]; framesInSubtree?: readonly unknown[] } | null | undefined, frameProcessId: number, frameRoutingId: number): { origin?: string; reload?: () => void } | null {
+function findFrameByIdentifier(
+ webContents: { frames?: readonly unknown[]; framesInSubtree?: readonly unknown[] } | null | undefined,
+ frameProcessId: number,
+ frameRoutingId: number
+): { origin?: string; reload?: () => void } | null {
const candidates = [...(webContents?.frames ?? []), ...(webContents?.framesInSubtree ?? [])] as Array<{
processId?: number
routingId?: number
@@ -7188,9 +7194,7 @@ function findFrameByIdentifier(webContents: { frames?: readonly unknown[]; frame
return (
candidates.find(
- f =>
- (f.frameProcessId ?? f.processId) === frameProcessId &&
- (f.frameRoutingId ?? f.routingId) === frameRoutingId
+ f => (f.frameProcessId ?? f.processId) === frameProcessId && (f.frameRoutingId ?? f.routingId) === frameRoutingId
) ?? null
)
}
@@ -13507,13 +13511,10 @@ function wireCommonWindowHandlers(win, { zoom = true }: { zoom?: boolean } = {})
// creates a window: it hands http/https/mailto opens from the EXACT hub
// origin to the audited `openExternalUrl` as a deny side effect.
win.webContents.setWindowOpenHandler(
- createWindowOpenHandler(
- origin => rememberLog(`[window-open] denied: ${origin}`),
- {
- getOpenerOrigin: () => win.webContents.getFocusedFrame?.()?.origin ?? null,
- openExternalUrl: (url: string) => void openExternalUrl(url)
- }
- )
+ createWindowOpenHandler(origin => rememberLog(`[window-open] denied: ${origin}`), {
+ getOpenerOrigin: () => win.webContents.getFocusedFrame?.()?.origin ?? null,
+ openExternalUrl: (url: string) => void openExternalUrl(url)
+ })
)
// The embedded Skills Hub picker must stay pinned to its picker URL
// (#91612): the frame is free to navigate itself within the picker (search,
@@ -18146,9 +18147,11 @@ const quickEntrySubmitRelay = createQuickEntrySubmitRelay({
},
onSuccess: () => {
hideQuickEntryWindow()
+
if (process.platform === 'darwin') {
app.dock?.show()
}
+
if (mainWindow && !mainWindow.isDestroyed()) {
mainWindow.show()
mainWindow.focus()
@@ -18188,6 +18191,7 @@ ipcMain.on('hermes:quick-entry:ack', (event, payload) => {
if (!mainWindow || event.sender !== mainWindow.webContents) {
return
}
+
quickEntrySubmitRelay.acknowledge(payload?.correlationId, payload?.result)
})
diff --git a/apps/desktop/electron/preload.ts b/apps/desktop/electron/preload.ts
index a15713b3ff7..8109790464a 100644
--- a/apps/desktop/electron/preload.ts
+++ b/apps/desktop/electron/preload.ts
@@ -231,8 +231,7 @@ contextBridge.exposeInMainWorld('hermesDesktop', {
// Invoke returns the delivery result so the draft is not lost (#85590).
submit: payload => ipcRenderer.invoke('hermes:quick-entry:submit', payload),
// Main cannot invoke the primary renderer, so it receives this ack (#85590).
- ackSubmit: (correlationId, result) =>
- ipcRenderer.send('hermes:quick-entry:ack', { correlationId, result }),
+ ackSubmit: (correlationId, result) => ipcRenderer.send('hermes:quick-entry:ack', { correlationId, result }),
dismiss: () => ipcRenderer.send('hermes:quick-entry:dismiss'),
// Primary renderer → main → quick window: gateway connection state + the
// recent-session options the target picker offers. Main caches the latest
diff --git a/apps/desktop/electron/quick-entry.test.ts b/apps/desktop/electron/quick-entry.test.ts
index ffea129b083..50ea9cc5f48 100644
--- a/apps/desktop/electron/quick-entry.test.ts
+++ b/apps/desktop/electron/quick-entry.test.ts
@@ -15,11 +15,14 @@ describe('quick-entry submit ack relay', () => {
const relay = createQuickEntrySubmitRelay({ onSuccess: vi.fn(), timeoutMs: 1000 })
let correlationId = ''
let settled = false
- const pending = relay.begin(id => {
- correlationId = id
- }).then(() => {
- settled = true
- })
+
+ const pending = relay
+ .begin(id => {
+ correlationId = id
+ })
+ .then(() => {
+ settled = true
+ })
relay.acknowledge('qe-stale', { ok: true })
await Promise.resolve()
@@ -50,6 +53,7 @@ describe('quick-entry submit ack relay', () => {
const onLateResult = vi.fn()
const relay = createQuickEntrySubmitRelay({ onLateResult, onSuccess, timeoutMs: 15000 })
let correlationId = ''
+
const pending = relay.begin(id => {
correlationId = id
})
@@ -70,6 +74,7 @@ describe('quick-entry submit ack relay', () => {
const onLateResult = vi.fn()
const relay = createQuickEntrySubmitRelay({ onLateResult, onSuccess: vi.fn(), timeoutMs: 15000 })
let correlationId = ''
+
const pending = relay.begin(id => {
correlationId = id
})
@@ -88,6 +93,7 @@ describe('quick-entry submit ack relay', () => {
const onLateResult = vi.fn()
const relay = createQuickEntrySubmitRelay({ onLateResult, onSuccess: vi.fn(), timeoutMs: 15000 })
let correlationId = ''
+
const pending = relay.begin(id => {
correlationId = id
})
@@ -104,11 +110,14 @@ describe('quick-entry submit ack relay', () => {
it('runs hide and primary focus only after an ok acknowledgement', async () => {
const events: string[] = []
+
const relay = createQuickEntrySubmitRelay({
onSuccess: () => events.push('hide-primary-show-focus'),
timeoutMs: 1000
})
+
let correlationId = ''
+
const pending = relay.begin(id => {
correlationId = id
events.push('forward')
@@ -119,10 +128,12 @@ describe('quick-entry submit ack relay', () => {
expect(events).toEqual(['forward'])
let okCorrelationId = ''
+
const okPending = relay.begin(id => {
okCorrelationId = id
events.push('forward-ok')
})
+
relay.acknowledge(okCorrelationId, { ok: true })
await expect(okPending).resolves.toMatchObject({ ok: true })
expect(events).toEqual(['forward', 'forward-ok', 'hide-primary-show-focus'])
diff --git a/apps/desktop/electron/quick-entry.ts b/apps/desktop/electron/quick-entry.ts
index 825aca85ee9..ec24a21f44f 100644
--- a/apps/desktop/electron/quick-entry.ts
+++ b/apps/desktop/electron/quick-entry.ts
@@ -48,10 +48,8 @@ export function createQuickEntrySubmitRelay(options: {
onSuccess: () => void
timeoutMs?: number
}): QuickEntrySubmitRelay {
- const pending = new Map<
- string,
- { resolve: (result: QuickEntrySubmitRelayResult) => void; timer: NodeJS.Timeout }
- >()
+ const pending = new Map<string, { resolve: (result: QuickEntrySubmitRelayResult) => void; timer: NodeJS.Timeout }>()
+
// Timed-out correlations. Delivery is UNCONFIRMED, so a late ack must
// reconcile; a correlation is never resolved twice.
const reconcilable = new Set<string>()
@@ -75,6 +73,7 @@ export function createQuickEntrySubmitRelay(options: {
clearTimeout(request.timer)
pending.delete(correlationId)
request.resolve(result)
+
if (result.ok === true) {
options.onSuccess()
}
@@ -95,6 +94,7 @@ export function createQuickEntrySubmitRelay(options: {
retryable: false
})
}, options.timeoutMs ?? 15_000)
+
pending.set(correlationId, { resolve, timer })
forward(correlationId)
})
diff --git a/apps/desktop/electron/window-open-policy.test.ts b/apps/desktop/electron/window-open-policy.test.ts
index bd6ddb156e9..68ac8c68606 100644
--- a/apps/desktop/electron/window-open-policy.test.ts
+++ b/apps/desktop/electron/window-open-policy.test.ts
@@ -1,7 +1,13 @@
// @vitest-environment node
import { describe, expect, it, vi } from 'vitest'
-import { HERMES_HUB_FALLBACK_ORIGIN, HERMES_HUB_ORIGIN, isHermesHubClipboardWrite, isHermesHubExternalUrl, isHermesHubOrigin } from './hub-iframe-policy'
+import {
+ HERMES_HUB_FALLBACK_ORIGIN,
+ HERMES_HUB_ORIGIN,
+ isHermesHubClipboardWrite,
+ isHermesHubExternalUrl,
+ isHermesHubOrigin
+} from './hub-iframe-policy'
import { createWindowOpenHandler, describeDeniedUrl } from './window-open-policy'
describe('hub-iframe-policy predicates', () => {
@@ -45,6 +51,7 @@ describe('createWindowOpenHandler trusted-hub delegation', () => {
it('still denies artifact frames (opaque origin) with NO external open', () => {
const openExternalUrl = vi.fn()
+
const handler = createWindowOpenHandler(undefined, {
getOpenerOrigin: () => 'null',
openExternalUrl
@@ -56,6 +63,7 @@ describe('createWindowOpenHandler trusted-hub delegation', () => {
it('delegates a hub-origin http(s) open but still denies the window', () => {
const openExternalUrl = vi.fn()
+
const handler = createWindowOpenHandler(undefined, {
getOpenerOrigin: () => HERMES_HUB_ORIGIN,
openExternalUrl
@@ -67,6 +75,7 @@ describe('createWindowOpenHandler trusted-hub delegation', () => {
it('delegates from the fallback (GitHub Pages) hub origin too', () => {
const openExternalUrl = vi.fn()
+
const handler = createWindowOpenHandler(undefined, {
getOpenerOrigin: () => HERMES_HUB_FALLBACK_ORIGIN,
openExternalUrl
@@ -78,6 +87,7 @@ describe('createWindowOpenHandler trusted-hub delegation', () => {
it('never delegates file:// or unknown schemes from a hub-origin opener', () => {
const openExternalUrl = vi.fn()
+
const handler = createWindowOpenHandler(undefined, {
getOpenerOrigin: () => HERMES_HUB_ORIGIN,
openExternalUrl
@@ -91,6 +101,7 @@ describe('createWindowOpenHandler trusted-hub delegation', () => {
it('never delegates when the opener origin is not exactly the hub', () => {
const openExternalUrl = vi.fn()
+
const handler = createWindowOpenHandler(undefined, {
getOpenerOrigin: () => 'https://hermes-agent.nousresearch.com.evil.example',
openExternalUrl
@@ -104,6 +115,7 @@ describe('createWindowOpenHandler trusted-hub delegation', () => {
const openExternalUrl = vi.fn(() => {
throw new Error('boom')
})
+
const throwingProbe = createWindowOpenHandler(undefined, {
getOpenerOrigin: () => {
throw new Error('probe failed')
@@ -124,6 +136,7 @@ describe('createWindowOpenHandler trusted-hub delegation', () => {
it('a throwing logging observer cannot change the decision or the delegation', () => {
const openExternalUrl = vi.fn()
+
const handler = createWindowOpenHandler(
() => {
throw new Error('log failed')
diff --git a/apps/desktop/src/app/chat/right-rail/preview-act.test.ts b/apps/desktop/src/app/chat/right-rail/preview-act.test.ts
index 1cb7d67a321..b4a2292f49d 100644
--- a/apps/desktop/src/app/chat/right-rail/preview-act.test.ts
+++ b/apps/desktop/src/app/chat/right-rail/preview-act.test.ts
@@ -338,12 +338,16 @@ describe('actOnActivePreview (drive_preview tool)', () => {
send.mockImplementation((e: { type: string; keyCode: string; modifiers?: string[] }) => {
if (isSelectAll(e)) {
- if (opts.selectWorks && opts.clearable) {fieldLen = 0}
+ if (opts.selectWorks && opts.clearable) {
+ fieldLen = 0
+ }
return
}
- if (e.type === 'keyDown' && e.keyCode === 'Backspace' && fieldLen > 0 && opts.clearable) {fieldLen--}
+ if (e.type === 'keyDown' && e.keyCode === 'Backspace' && fieldLen > 0 && opts.clearable) {
+ fieldLen--
+ }
})
cleanups.push(
@@ -368,10 +372,16 @@ describe('actOnActivePreview (drive_preview tool)', () => {
}
const charKeys = (send: ReturnType<typeof vi.fn>) =>
- send.mock.calls.map(([e]) => e).filter((e: { type: string }) => e.type === 'char').map((e: { keyCode: string }) => e.keyCode)
+ send.mock.calls
+ .map(([e]) => e)
+ .filter((e: { type: string }) => e.type === 'char')
+ .map((e: { keyCode: string }) => e.keyCode)
const keyDowns = (send: ReturnType<typeof vi.fn>) =>
- send.mock.calls.map(([e]) => e).filter((e: { type: string }) => e.type === 'keyDown').map((e: { keyCode: string }) => e.keyCode)
+ send.mock.calls
+ .map(([e]) => e)
+ .filter((e: { type: string }) => e.type === 'keyDown')
+ .map((e: { keyCode: string }) => e.keyCode)
it('verifies the select emptied the field before typing (select works)', async () => {
const send = withTypingPane({ initial: 4, selectWorks: true, clearable: true })
@@ -435,21 +445,23 @@ describe('actOnActivePreview (drive_preview tool)', () => {
const send = vi.fn()
cleanups.push(
- registerPreviewScriptRunner(tabId, async code =>
- code.includes('hermes-focus-probe')
- ? JSON.stringify({ focused: true, success: true, tag: 'INPUT' })
- : code.includes('"kind":"locate"')
- ? JSON.stringify({
- acted: 'looking at textbox "Price"',
- point: { x: 120, y: 80 },
- success: true,
- typable: true
- })
- : !code.includes('__hermesAct') && code.includes('getOwnPropertyDescriptor')
- ? JSON.stringify({ success: true }) // the direct-set fallback succeeded (no preamble)
- : !code.includes('__hermesAct') && code.includes('document.activeElement')
- ? JSON.stringify({ success: true, field: true, len: 4 }) // field-state read
- : JSON.stringify({ elements: [], hit: { tag: 'INPUT', trusted: true }, success: true }) // finish trip
+ registerPreviewScriptRunner(
+ tabId,
+ async code =>
+ code.includes('hermes-focus-probe')
+ ? JSON.stringify({ focused: true, success: true, tag: 'INPUT' })
+ : code.includes('"kind":"locate"')
+ ? JSON.stringify({
+ acted: 'looking at textbox "Price"',
+ point: { x: 120, y: 80 },
+ success: true,
+ typable: true
+ })
+ : !code.includes('__hermesAct') && code.includes('getOwnPropertyDescriptor')
+ ? JSON.stringify({ success: true }) // the direct-set fallback succeeded (no preamble)
+ : !code.includes('__hermesAct') && code.includes('document.activeElement')
+ ? JSON.stringify({ success: true, field: true, len: 4 }) // field-state read
+ : JSON.stringify({ elements: [], hit: { tag: 'INPUT', trusted: true }, success: true }) // finish trip
)
)
cleanups.push(registerPreviewInput(tabId, { focus: vi.fn(), send }))
diff --git a/apps/desktop/src/app/chat/right-rail/preview-act.ts b/apps/desktop/src/app/chat/right-rail/preview-act.ts
index 585b80f9df3..d4b84bd9028 100644
--- a/apps/desktop/src/app/chat/right-rail/preview-act.ts
+++ b/apps/desktop/src/app/chat/right-rail/preview-act.ts
@@ -30,7 +30,16 @@
import { actEngineSource, type PreviewActAction, type PreviewActResult } from '@/lib/preview-act/act-in-page'
import { watchInPage } from '@/lib/preview-act/watch-in-page'
-import { clearCharsBack, clickAt, glideTo, pointerPlaced, pressKey, selectAll, typeText, wheelBy } from './preview-drive'
+import {
+ clearCharsBack,
+ clickAt,
+ glideTo,
+ pointerPlaced,
+ pressKey,
+ selectAll,
+ typeText,
+ wheelBy
+} from './preview-drive'
import { activePreviewInput, type PreviewInputHandle } from './preview-input'
import { activePreviewNav, type PreviewNavHandle } from './preview-nav'
import { activePreviewScriptRunner, type PreviewScriptRunner } from './preview-script-runner'
@@ -354,10 +363,7 @@ function buildFieldStateScript(): string {
/** True selection-bearing field state, or 'unknown' when it is not readable
* (focus elsewhere, or a control with no value/selection API). */
-type FieldState =
- | { ok: false }
- | { ok: true; field: false }
- | { ok: true; field: true; len: number }
+type FieldState = { ok: false } | { ok: true; field: false } | { ok: true; field: true; len: number }
async function readField(run: PreviewScriptRunner): Promise<FieldState> {
const trip = await runJson(run, buildFieldStateScript())
diff --git a/apps/desktop/src/app/chat/right-rail/preview-file.tsx b/apps/desktop/src/app/chat/right-rail/preview-file.tsx
index 98ba270485b..c686da01340 100644
--- a/apps/desktop/src/app/chat/right-rail/preview-file.tsx
+++ b/apps/desktop/src/app/chat/right-rail/preview-file.tsx
@@ -1120,14 +1120,15 @@ export function LocalFilePreview({
}
if (state.missing) {
- return <PreviewEmptyState body={t.preview.missingBody(target.label)} title={t.preview.missingTitle} tone="warning" />
+ return (
+ <PreviewEmptyState body={t.preview.missingBody(target.label)} title={t.preview.missingTitle} tone="warning" />
+ )
}
// A preview that can't load (the file was moved or deleted) is a dead end,
// so it carries its own way out rather than leaving it to the tab strip.
const closeAction = onClose ? { label: t.common.close, onClick: onClose } : undefined
-
if (state.error) {
return <PreviewEmptyState body={state.error} primaryAction={closeAction} title={t.preview.unavailable} />
}
diff --git a/apps/desktop/src/app/chat/right-rail/preview-pane.test.tsx b/apps/desktop/src/app/chat/right-rail/preview-pane.test.tsx
index 9f9ea77fd01..e73d504701d 100644
--- a/apps/desktop/src/app/chat/right-rail/preview-pane.test.tsx
+++ b/apps/desktop/src/app/chat/right-rail/preview-pane.test.tsx
@@ -294,7 +294,12 @@ describe('PreviewPane console state', () => {
rendered = render(
<PreviewPane
tabId={tabId}
- target={{ kind: 'url', label: 'Preview', source: 'http://localhost:5174/one', url: 'http://localhost:5174/one' }}
+ target={{
+ kind: 'url',
+ label: 'Preview',
+ source: 'http://localhost:5174/one',
+ url: 'http://localhost:5174/one'
+ }}
/>
)
})
@@ -308,7 +313,12 @@ describe('PreviewPane console state', () => {
rendered.rerender(
<PreviewPane
tabId={tabId}
- target={{ kind: 'url', label: 'Preview', source: 'http://localhost:5174/two', url: 'http://localhost:5174/two' }}
+ target={{
+ kind: 'url',
+ label: 'Preview',
+ source: 'http://localhost:5174/two',
+ url: 'http://localhost:5174/two'
+ }}
/>
)
})
diff --git a/apps/desktop/src/app/chat/right-rail/preview-popout-bridge.ts b/apps/desktop/src/app/chat/right-rail/preview-popout-bridge.ts
index b96b282ab25..2d426c2105b 100644
--- a/apps/desktop/src/app/chat/right-rail/preview-popout-bridge.ts
+++ b/apps/desktop/src/app/chat/right-rail/preview-popout-bridge.ts
@@ -31,8 +31,7 @@ const READ_TIMEOUT_MS = 8_000
type ActPayload = Omit<PreviewActAction, 'kind'> & { kind: string }
type BridgeRequest =
- | { id: string; kind: 'act'; payload: ActPayload }
- | { id: string; kind: 'read'; payload: PreviewReadOptions }
+ { id: string; kind: 'act'; payload: ActPayload } | { id: string; kind: 'read'; payload: PreviewReadOptions }
type BridgeResponse =
| { id: string; kind: 'act'; result: PreviewActResult }
@@ -148,19 +147,15 @@ function askPopout<T>(
/** Ask the browser pop-out to run drive_preview. Null when no pop-out answers. */
export function requestPopoutPreviewAct(payload: ActPayload): Promise<PreviewActResult | null> {
- return askPopout(
- { id: nextId('act'), kind: 'act', payload },
- ACT_TIMEOUT_MS,
- response => (response.kind === 'act' ? response.result : undefined)
+ return askPopout({ id: nextId('act'), kind: 'act', payload }, ACT_TIMEOUT_MS, response =>
+ response.kind === 'act' ? response.result : undefined
)
}
/** Ask the browser pop-out to run read_preview. Null when no pop-out answers. */
export function requestPopoutPreviewRead(payload: PreviewReadOptions = {}): Promise<PreviewReadResult | null> {
- return askPopout(
- { id: nextId('read'), kind: 'read', payload },
- READ_TIMEOUT_MS,
- response => (response.kind === 'read' ? response.result : undefined)
+ return askPopout({ id: nextId('read'), kind: 'read', payload }, READ_TIMEOUT_MS, response =>
+ response.kind === 'read' ? response.result : undefined
)
}
@@ -186,7 +181,11 @@ export function installPopoutPreviewResponder(): () => void {
const request = data as Partial<BridgeRequest> & { id?: unknown; kind?: unknown }
- if (typeof request.id !== 'string' || (request.kind !== 'act' && request.kind !== 'read') || !('payload' in request)) {
+ if (
+ typeof request.id !== 'string' ||
+ (request.kind !== 'act' && request.kind !== 'read') ||
+ !('payload' in request)
+ ) {
return
}
diff --git a/apps/desktop/src/app/chat/session-tile-actions.test.ts b/apps/desktop/src/app/chat/session-tile-actions.test.ts
index 005cd269e9d..7d3c9b89f92 100644
--- a/apps/desktop/src/app/chat/session-tile-actions.test.ts
+++ b/apps/desktop/src/app/chat/session-tile-actions.test.ts
@@ -308,14 +308,11 @@ describe('useSessionTileActions reloadFromMessage failed-submit rollback (#95745
// The refreshed transcript: same shapes, fresh row ids after the remap.
publishSessionState(
RUNTIME_SESSION_ID,
- createClientSessionState(
- STORED_SESSION_ID,
- [
- { id: 'u1-fresh', parts: [textPart('first')], role: 'user' as const, rowId: 501, timestamp: 0 },
- { id: 'a1-fresh', parts: [textPart('reply')], role: 'assistant' as const, rowId: 502, timestamp: 1 },
- { id: 'u2-fresh', parts: [textPart('later')], role: 'user' as const, rowId: 503, timestamp: 2 }
- ] as never
- )
+ createClientSessionState(STORED_SESSION_ID, [
+ { id: 'u1-fresh', parts: [textPart('first')], role: 'user' as const, rowId: 501, timestamp: 0 },
+ { id: 'a1-fresh', parts: [textPart('reply')], role: 'assistant' as const, rowId: 502, timestamp: 1 },
+ { id: 'u2-fresh', parts: [textPart('later')], role: 'user' as const, rowId: 503, timestamp: 2 }
+ ] as never)
)
return RUNTIME_SESSION_ID
diff --git a/apps/desktop/src/app/chat/session-tile-actions.ts b/apps/desktop/src/app/chat/session-tile-actions.ts
index 5907a52196a..2818421714d 100644
--- a/apps/desktop/src/app/chat/session-tile-actions.ts
+++ b/apps/desktop/src/app/chat/session-tile-actions.ts
@@ -634,11 +634,13 @@ export function useSessionTileActions({ requestGateway, runtimeId, scope, stored
const refreshed = await sessionTileDelegate()!.resumeTile(storedIdRef.current, {
refreshTranscript: true
})
+
if (typeof refreshed === 'string' && refreshed && refreshed !== sessionId) {
runtimeIdRef.current = refreshed
}
const freshMessages = readMessages()
+
const retryPlan = planRestore(freshMessages, messageId, {
text: target?.text ?? plan.sourceText,
userOrdinal: target?.userOrdinal ?? plan.truncateOrdinal
diff --git a/apps/desktop/src/app/chat/sidebar/session-actions-menu.test.ts b/apps/desktop/src/app/chat/sidebar/session-actions-menu.test.ts
index 9d088e5aefc..ad08d771891 100644
--- a/apps/desktop/src/app/chat/sidebar/session-actions-menu.test.ts
+++ b/apps/desktop/src/app/chat/sidebar/session-actions-menu.test.ts
@@ -73,9 +73,7 @@ describe('renameSessionPreferringRpc', () => {
it('resolves the owning profile from $sessions when profile argument is omitted', async () => {
$selectedStoredSessionId.set('some-other-active-session')
- $sessions.set([
- { id: STORED_ID, profile: 'personal', title: 'Own Google Docs document' } as never
- ])
+ $sessions.set([{ id: STORED_ID, profile: 'personal', title: 'Own Google Docs document' } as never])
await renameSessionPreferringRpc(STORED_ID, 'Prep Butler')
diff --git a/apps/desktop/src/app/chat/sidebar/session-actions-menu.tsx b/apps/desktop/src/app/chat/sidebar/session-actions-menu.tsx
index 6030943daca..922eedeaa4a 100644
--- a/apps/desktop/src/app/chat/sidebar/session-actions-menu.tsx
+++ b/apps/desktop/src/app/chat/sidebar/session-actions-menu.tsx
@@ -118,6 +118,7 @@ export async function renameSessionPreferringRpc(
(profile ?? '').trim() ||
$sessions.get().find(s => sessionMatchesStoredId(s, storedSessionId))?.profile ||
undefined
+
const runtimeId = resolveRuntimeIdForStored(storedSessionId)
const gateway = activeGateway()
@@ -742,9 +743,8 @@ function RenameSessionDialog({ open, onOpenChange, sessionId, currentTitle, prof
try {
const targetProfile =
- (profile ?? '').trim() ||
- $sessions.get().find(s => sessionMatchesStoredId(s, sessionId))?.profile ||
- undefined
+ (profile ?? '').trim() || $sessions.get().find(s => sessionMatchesStoredId(s, sessionId))?.profile || undefined
+
const result = await renameSessionPreferringRpc(sessionId, next, targetProfile)
const finalTitle = result.title || next || ''
// One write, every list: patch the main store AND the project surfaces.
diff --git a/apps/desktop/src/app/chat/transcript-backfill.test.ts b/apps/desktop/src/app/chat/transcript-backfill.test.ts
index 547bea622a4..c6677ba5925 100644
--- a/apps/desktop/src/app/chat/transcript-backfill.test.ts
+++ b/apps/desktop/src/app/chat/transcript-backfill.test.ts
@@ -723,9 +723,7 @@ describe('unhideOpeningUserRows', () => {
})
it('leaves a hidden opening row without content hidden', () => {
- const messages = unhideOpeningUserRows([
- { id: 1, role: 'user', content: '', display_kind: 'hidden', timestamp: 1 }
- ])
+ const messages = unhideOpeningUserRows([{ id: 1, role: 'user', content: '', display_kind: 'hidden', timestamp: 1 }])
expect(messages[0].display_kind).toBe('hidden')
})
diff --git a/apps/desktop/src/app/contrib/hooks/use-background-sync.test.ts b/apps/desktop/src/app/contrib/hooks/use-background-sync.test.ts
index 6c034ed5ab4..e3b8d5ce32c 100644
--- a/apps/desktop/src/app/contrib/hooks/use-background-sync.test.ts
+++ b/apps/desktop/src/app/contrib/hooks/use-background-sync.test.ts
@@ -792,7 +792,9 @@ describe('active transcript refresh', () => {
})
expect(refresh).toHaveBeenCalledTimes(1) // main pane still covered
- await waitFor(() => expect(getLatestSessionMessages).toHaveBeenCalledWith(tileStoredId, undefined, { passive: true }))
+ await waitFor(() =>
+ expect(getLatestSessionMessages).toHaveBeenCalledWith(tileStoredId, undefined, { passive: true })
+ )
})
it('reconciles tiles on return in a workspace with no selected session (#125532 review)', async () => {
@@ -813,7 +815,9 @@ describe('active transcript refresh', () => {
})
expect(refresh).not.toHaveBeenCalled() // nothing selected in the main pane
- await waitFor(() => expect(getLatestSessionMessages).toHaveBeenCalledWith(tileStoredId, undefined, { passive: true }))
+ await waitFor(() =>
+ expect(getLatestSessionMessages).toHaveBeenCalledWith(tileStoredId, undefined, { passive: true })
+ )
})
it('does not refresh on a visibilitychange to hidden (#125532 review)', () => {
diff --git a/apps/desktop/src/app/contrib/hooks/use-background-sync.ts b/apps/desktop/src/app/contrib/hooks/use-background-sync.ts
index 1d89976b66c..de455ed5ff2 100644
--- a/apps/desktop/src/app/contrib/hooks/use-background-sync.ts
+++ b/apps/desktop/src/app/contrib/hooks/use-background-sync.ts
@@ -1176,10 +1176,7 @@ export function useBackgroundSync({
// clicking) drops the visibility leg under a combined focused gate, and
// the focus leg it would wait for never arrives — the return refresh is
// lost for a window the user is reading.
- const viewed =
- event?.type === 'visibilitychange'
- ? document.visibilityState === 'visible'
- : document.hasFocus()
+ const viewed = event?.type === 'visibilitychange' ? document.visibilityState === 'visible' : document.hasFocus()
if (!viewed) {
return
@@ -1192,12 +1189,14 @@ export function useBackgroundSync({
}
lastRefreshAt = now
+
// The main pane resolves only with a selected session; a workspace whose
// pane shows just bot tiles has none, and the tile reconcile below still
// owes those tiles their catch-up.
if (activeSessionId && activeStoredSessionId) {
requestActiveTranscriptRefresh(true)
}
+
// Workspace tiles share the zombie-socket blind spot: the sessions.changed
// tick that would have reconciled them does not replay on wake, and bot
// canonical chats never resolve through the main-pane path. The shared
@@ -1216,7 +1215,14 @@ export function useBackgroundSync({
document.removeEventListener('visibilitychange', refreshOnReturn)
window.removeEventListener('focus', refreshOnReturn)
}
- }, [activeIsMessaging, activeSessionId, activeStoredSessionId, gatewayState, requestActiveTranscriptRefresh, updateSessionState])
+ }, [
+ activeIsMessaging,
+ activeSessionId,
+ activeStoredSessionId,
+ gatewayState,
+ requestActiveTranscriptRefresh,
+ updateSessionState
+ ])
// A reconnect loses renderer-only working/attention atoms while the backend
// keeps the actual turns alive. Re-seed from the gateway's in-memory session
diff --git a/apps/desktop/src/app/contrib/hooks/use-desktop-integrations.test.tsx b/apps/desktop/src/app/contrib/hooks/use-desktop-integrations.test.tsx
index d84f7685e4c..b986fade191 100644
--- a/apps/desktop/src/app/contrib/hooks/use-desktop-integrations.test.tsx
+++ b/apps/desktop/src/app/contrib/hooks/use-desktop-integrations.test.tsx
@@ -545,13 +545,15 @@ describe('useDesktopIntegrations', () => {
document.body.append(scope)
scope.tabIndex = -1
;(scope as HTMLElement).focus()
- scopeCleanup.push(registerTerminalContextMenu(host, {
- getSelection: () => '',
- paste: () => undefined,
- reload: () => {},
- selectAll: () => undefined,
- wordErase: () => true
- }))
+ scopeCleanup.push(
+ registerTerminalContextMenu(host, {
+ getSelection: () => '',
+ paste: () => undefined,
+ reload: () => {},
+ selectAll: () => undefined,
+ wordErase: () => true
+ })
+ )
}
const scopeCleanup: Array<() => void> = []
diff --git a/apps/desktop/src/app/contrib/hooks/use-desktop-integrations.ts b/apps/desktop/src/app/contrib/hooks/use-desktop-integrations.ts
index 86792cc67ff..9237c642d5a 100644
--- a/apps/desktop/src/app/contrib/hooks/use-desktop-integrations.ts
+++ b/apps/desktop/src/app/contrib/hooks/use-desktop-integrations.ts
@@ -5,10 +5,7 @@ import { resumeAccountConnect } from '@/app/capabilities/connectors/data/deep-li
import { closeActiveTab } from '@/app/chat/close-tab'
import { commandFocusedPreview } from '@/app/chat/right-rail/preview-nav'
import { openSession } from '@/app/open-session'
-import {
- commandFocusedTerminal,
- wordEraseFocusedTerminal
-} from '@/app/right-sidebar/terminal/terminal-context-menu'
+import { commandFocusedTerminal, wordEraseFocusedTerminal } from '@/app/right-sidebar/terminal/terminal-context-menu'
import { openConnectionDoneLink } from '@/components/assistant-ui/connector-tool'
import { $diskPluginsScanPending } from '@/contrib/runtime-loader'
import { getSession } from '@/hermes'
diff --git a/apps/desktop/src/app/contrib/hooks/use-quick-entry-bridge.test.ts b/apps/desktop/src/app/contrib/hooks/use-quick-entry-bridge.test.ts
index 6f310bc5eea..8aadef3b1fe 100644
--- a/apps/desktop/src/app/contrib/hooks/use-quick-entry-bridge.test.ts
+++ b/apps/desktop/src/app/contrib/hooks/use-quick-entry-bridge.test.ts
@@ -136,7 +136,10 @@ describe('useQuickEntryBridge', () => {
}
} as unknown as typeof window.hermesDesktop
- const { container, submit } = await renderBridge(vi.fn(async () => true), submitTextToNewSession)
+ const { container, submit } = await renderBridge(
+ vi.fn(async () => true),
+ submitTextToNewSession
+ )
await act(async () => {
await submit({ correlationId, target: 'new', text: 'Send to a new chat' })
diff --git a/apps/desktop/src/app/contrib/hooks/use-quick-entry-bridge.ts b/apps/desktop/src/app/contrib/hooks/use-quick-entry-bridge.ts
index da3a69abc83..e0ead6a2214 100644
--- a/apps/desktop/src/app/contrib/hooks/use-quick-entry-bridge.ts
+++ b/apps/desktop/src/app/contrib/hooks/use-quick-entry-bridge.ts
@@ -17,10 +17,7 @@ interface QuickEntryBridgeParams {
text: string,
options?: { onAccepted?: (identity: QuickEntryAcceptedIdentity) => void }
) => Promise<boolean> | boolean
- submitTextToNewSession: (
- text: string,
- owner?: string
- ) => Promise<{ runtimeSessionId: string; sessionId: string }>
+ submitTextToNewSession: (text: string, owner?: string) => Promise<{ runtimeSessionId: string; sessionId: string }>
}
/** Exact session identity that accepted a prompt (runtime + durable stored id). */
@@ -89,10 +86,7 @@ function sessionOptions(): QuickEntrySessionOption[] {
* secondary session window must not also claim the global capture channel, or
* one keystroke would send N prompts.
*/
-export function useQuickEntryBridge({
- submitText,
- submitTextToNewSession
-}: QuickEntryBridgeParams): void {
+export function useQuickEntryBridge({ submitText, submitTextToNewSession }: QuickEntryBridgeParams): void {
const submitTextRef = useRef(submitText)
submitTextRef.current = submitText
const submitNewRef = useRef(submitTextToNewSession)
@@ -122,7 +116,12 @@ export function useQuickEntryBridge({
const created = await submitNewRef.current(text, correlationId)
ack({ ok: true, runtimeSessionId: created.runtimeSessionId, sessionId: created.sessionId })
} catch (error) {
- ack({ code: 'submit-failed', message: error instanceof Error ? error.message : String(error), ok: false, retryable: true })
+ ack({
+ code: 'submit-failed',
+ message: error instanceof Error ? error.message : String(error),
+ ok: false,
+ retryable: true
+ })
}
return
@@ -169,7 +168,12 @@ export function useQuickEntryBridge({
return
}
- ack({ code: 'submit-failed', message: error instanceof Error ? error.message : String(error), ok: false, retryable: true })
+ ack({
+ code: 'submit-failed',
+ message: error instanceof Error ? error.message : String(error),
+ ok: false,
+ retryable: true
+ })
}
return
@@ -181,6 +185,7 @@ export function useQuickEntryBridge({
ok: false,
retryable: true
})
+
return
}
@@ -192,9 +197,15 @@ export function useQuickEntryBridge({
acceptedIdentity = identity
}
})
+
ack(quickEntrySubmitAck(submitted, acceptedIdentity))
} catch (error) {
- ack({ code: 'submit-failed', message: error instanceof Error ? error.message : String(error), ok: false, retryable: true })
+ ack({
+ code: 'submit-failed',
+ message: error instanceof Error ? error.message : String(error),
+ ok: false,
+ retryable: true
+ })
}
})
diff --git a/apps/desktop/src/app/contrib/panes.logs.test.tsx b/apps/desktop/src/app/contrib/panes.logs.test.tsx
index e60b0258c0e..daf62e73db0 100644
--- a/apps/desktop/src/app/contrib/panes.logs.test.tsx
+++ b/apps/desktop/src/app/contrib/panes.logs.test.tsx
@@ -35,7 +35,9 @@ const rafQueue: FrameRequestCallback[] = []
function flushFrames() {
const queued = rafQueue.splice(0)
- for (const cb of queued) {cb(0)}
+ for (const cb of queued) {
+ cb(0)
+ }
}
beforeEach(() => {
diff --git a/apps/desktop/src/app/contrib/panes.tsx b/apps/desktop/src/app/contrib/panes.tsx
index 46e56632789..4ad93af0c25 100644
--- a/apps/desktop/src/app/contrib/panes.tsx
+++ b/apps/desktop/src/app/contrib/panes.tsx
@@ -68,8 +68,7 @@ export function LogsPane() {
return
}
- shouldStickRef.current =
- el.scrollHeight - el.scrollTop - el.clientHeight <= LOGS_BOTTOM_THRESHOLD
+ shouldStickRef.current = el.scrollHeight - el.scrollTop - el.clientHeight <= LOGS_BOTTOM_THRESHOLD
}
if (error) {
diff --git a/apps/desktop/src/app/quick-entry/quick-entry-app.tsx b/apps/desktop/src/app/quick-entry/quick-entry-app.tsx
index 34a16cd5467..57c86621292 100644
--- a/apps/desktop/src/app/quick-entry/quick-entry-app.tsx
+++ b/apps/desktop/src/app/quick-entry/quick-entry-app.tsx
@@ -50,6 +50,7 @@ export function QuickEntryApp() {
const submitId = submitIdRef.current
void api?.submit(send).then(result => {
dispatch(quickEntryResultEvent(result, submitId))
+
if (!result.ok) {
requestAnimationFrame(() => inputRef.current?.focus())
}
diff --git a/apps/desktop/src/app/right-sidebar/index.test.tsx b/apps/desktop/src/app/right-sidebar/index.test.tsx
index c36e547b781..12abccd9e5f 100644
--- a/apps/desktop/src/app/right-sidebar/index.test.tsx
+++ b/apps/desktop/src/app/right-sidebar/index.test.tsx
@@ -14,7 +14,9 @@ const readDir = vi.fn<(path: string) => Promise<HermesReadDirResult>>()
const repoStatus = vi.fn<(cwd: string) => Promise<null>>()
function installBridge() {
- ;(window as unknown as { hermesDesktop: { git: { repoStatus: typeof repoStatus }; readDir: typeof readDir } }).hermesDesktop = {
+ ;(
+ window as unknown as { hermesDesktop: { git: { repoStatus: typeof repoStatus }; readDir: typeof readDir } }
+ ).hermesDesktop = {
git: { repoStatus },
readDir
}
@@ -83,12 +85,8 @@ describe('RightSidebarPane', () => {
$workspaceCwdOwner.set('main-session')
setCurrentCwd('/repo-main')
- $sessions.set([
- { cwd: '/repo-tile', id: 'tile-session' } as any
- ])
- $sessionTiles.set([
- { storedSessionId: 'tile-session', runtimeId: 'rt-tile', workspaceMode: 'sessions' } as any
- ])
+ $sessions.set([{ cwd: '/repo-tile', id: 'tile-session' } as any])
+ $sessionTiles.set([{ storedSessionId: 'tile-session', runtimeId: 'rt-tile', workspaceMode: 'sessions' } as any])
$layoutTree.set({
id: 'grp-1',
type: 'group',
@@ -114,12 +112,8 @@ describe('RightSidebarPane', () => {
$workspaceCwdOwner.set('main-session')
setCurrentCwd('/repo-main')
- $sessions.set([
- { cwd: '/repo-tile', id: 'tile-session' } as any
- ])
- $sessionTiles.set([
- { storedSessionId: 'tile-session', runtimeId: 'rt-tile', workspaceMode: 'sessions' } as any
- ])
+ $sessions.set([{ cwd: '/repo-tile', id: 'tile-session' } as any])
+ $sessionTiles.set([{ storedSessionId: 'tile-session', runtimeId: 'rt-tile', workspaceMode: 'sessions' } as any])
$layoutTree.set({
id: 'grp-main',
type: 'group',
diff --git a/apps/desktop/src/app/right-sidebar/review/index.test.tsx b/apps/desktop/src/app/right-sidebar/review/index.test.tsx
index 554aadddc37..5b9d4e8bc90 100644
--- a/apps/desktop/src/app/right-sidebar/review/index.test.tsx
+++ b/apps/desktop/src/app/right-sidebar/review/index.test.tsx
@@ -4,7 +4,15 @@ import { afterEach, beforeEach, describe, expect, it } from 'vitest'
import type { HermesReviewFile } from '@/global'
import { I18nProvider } from '@/i18n'
import { $panesFlipped } from '@/store/layout'
-import { $reviewDiff, $reviewDiffLoading, $reviewFiles, $reviewIsRepo, $reviewLoading, $reviewScope, $reviewSelectedPath } from '@/store/review'
+import {
+ $reviewDiff,
+ $reviewDiffLoading,
+ $reviewFiles,
+ $reviewIsRepo,
+ $reviewLoading,
+ $reviewScope,
+ $reviewSelectedPath
+} from '@/store/review'
import { ReviewPane } from './index'
diff --git a/apps/desktop/src/app/right-sidebar/terminal/instance.test.tsx b/apps/desktop/src/app/right-sidebar/terminal/instance.test.tsx
index 889260f9b64..0cfc423d16e 100644
--- a/apps/desktop/src/app/right-sidebar/terminal/instance.test.tsx
+++ b/apps/desktop/src/app/right-sidebar/terminal/instance.test.tsx
@@ -66,9 +66,7 @@ describe('background terminal input guidance (#108233)', () => {
describe('terminal close-chord markers', () => {
it('marks a user PTY as interactive so the close chord reaches the shell', () => {
- const { container } = render(
- <TerminalInstance active cwd="/tmp" id="terminal-1" onAddSelectionToChat={vi.fn()} />
- )
+ const { container } = render(<TerminalInstance active cwd="/tmp" id="terminal-1" onAddSelectionToChat={vi.fn()} />)
const terminal = container.firstElementChild
diff --git a/apps/desktop/src/app/right-sidebar/terminal/selection.test.ts b/apps/desktop/src/app/right-sidebar/terminal/selection.test.ts
index 0b723ec566d..8ecfc4e0875 100644
--- a/apps/desktop/src/app/right-sidebar/terminal/selection.test.ts
+++ b/apps/desktop/src/app/right-sidebar/terminal/selection.test.ts
@@ -11,12 +11,11 @@ const key = (init: Partial<KeyboardEvent> & { key: string }) =>
metaKey: false,
shiftKey: false,
type: 'keydown',
- ...init,
+ ...init
}) as KeyboardEvent
/** Chord that the composer-focus ladder accepts on this host. */
-const addSelectionKey = () =>
- isMacPlatform() ? key({ key: 'l', metaKey: true }) : key({ key: 'l', ctrlKey: true })
+const addSelectionKey = () => (isMacPlatform() ? key({ key: 'l', metaKey: true }) : key({ key: 'l', ctrlKey: true }))
describe('shouldOwnAddSelectionShortcut', () => {
it('only the active tab claims the add-selection shortcut when text is selected (#76116)', () => {
diff --git a/apps/desktop/src/app/right-sidebar/terminal/selection.ts b/apps/desktop/src/app/right-sidebar/terminal/selection.ts
index 1fca1e8c172..6042cd2328d 100644
--- a/apps/desktop/src/app/right-sidebar/terminal/selection.ts
+++ b/apps/desktop/src/app/right-sidebar/terminal/selection.ts
@@ -104,10 +104,7 @@ export { isMacPlatform }
/** Whether this terminal session should own a global ⌘/Ctrl+L keydown.
* `active` gates the fanout: every open tab stays mounted, so an inactive
* tab must never claim the press (#76116). */
-export function shouldOwnAddSelectionShortcut(
- event: KeyboardEvent,
- opts: { active: boolean; hasSelection: boolean }
-) {
+export function shouldOwnAddSelectionShortcut(event: KeyboardEvent, opts: { active: boolean; hasSelection: boolean }) {
return opts.active && opts.hasSelection && isComposerChord(event)
}
diff --git a/apps/desktop/src/app/right-sidebar/terminal/terminal-context-menu.test.ts b/apps/desktop/src/app/right-sidebar/terminal/terminal-context-menu.test.ts
index 0b6189df4d9..d90b54d2e70 100644
--- a/apps/desktop/src/app/right-sidebar/terminal/terminal-context-menu.test.ts
+++ b/apps/desktop/src/app/right-sidebar/terminal/terminal-context-menu.test.ts
@@ -144,13 +144,15 @@ describe('wordEraseFocusedTerminal', () => {
it('routes the close chord to the focused interactive terminal and reports it consumed', () => {
const { host, scope } = mountScope('interactive')
const wordErase = vi.fn(() => true)
- cleanups.push(registerTerminalContextMenu(host, {
- getSelection: () => '',
- paste: () => undefined,
- reload: () => {},
- selectAll: () => undefined,
- wordErase
- }))
+ cleanups.push(
+ registerTerminalContextMenu(host, {
+ getSelection: () => '',
+ paste: () => undefined,
+ reload: () => {},
+ selectAll: () => undefined,
+ wordErase
+ })
+ )
scope.tabIndex = -1
scope.focus()
@@ -162,13 +164,15 @@ describe('wordEraseFocusedTerminal', () => {
it('keys the registry by the [data-terminal] scope, not the nested host', () => {
const { host } = mountScope('interactive')
const wordErase = vi.fn(() => true)
- cleanups.push(registerTerminalContextMenu(host, {
- getSelection: () => '',
- paste: () => undefined,
- reload: () => {},
- selectAll: () => undefined,
- wordErase
- }))
+ cleanups.push(
+ registerTerminalContextMenu(host, {
+ getSelection: () => '',
+ paste: () => undefined,
+ reload: () => {},
+ selectAll: () => undefined,
+ wordErase
+ })
+ )
// The resolver walks up from a focus point INSIDE the host, exactly like
// the real xterm textareaFocus.
@@ -182,13 +186,15 @@ describe('wordEraseFocusedTerminal', () => {
it('keeps the read-only agent mirror closeable (null wordErase)', () => {
const { host, scope } = mountScope('readonly')
- cleanups.push(registerTerminalContextMenu(host, {
- getSelection: () => '',
- paste: null,
- reload: () => {},
- selectAll: () => undefined,
- wordErase: null
- }))
+ cleanups.push(
+ registerTerminalContextMenu(host, {
+ getSelection: () => '',
+ paste: null,
+ reload: () => {},
+ selectAll: () => undefined,
+ wordErase: null
+ })
+ )
scope.tabIndex = -1
scope.focus()
@@ -198,13 +204,15 @@ describe('wordEraseFocusedTerminal', () => {
it('reports not consumed when the terminal has no live session', () => {
const { host, scope } = mountScope('interactive')
- cleanups.push(registerTerminalContextMenu(host, {
- getSelection: () => '',
- paste: () => undefined,
- reload: () => {},
- selectAll: () => undefined,
- wordErase: () => false
- }))
+ cleanups.push(
+ registerTerminalContextMenu(host, {
+ getSelection: () => '',
+ paste: () => undefined,
+ reload: () => {},
+ selectAll: () => undefined,
+ wordErase: () => false
+ })
+ )
scope.tabIndex = -1
scope.focus()
@@ -215,13 +223,15 @@ describe('wordEraseFocusedTerminal', () => {
it('reports not consumed when focus is elsewhere', () => {
const { host } = mountScope('interactive')
- cleanups.push(registerTerminalContextMenu(host, {
- getSelection: () => '',
- paste: () => undefined,
- reload: () => {},
- selectAll: () => undefined,
- wordErase: () => true
- }))
+ cleanups.push(
+ registerTerminalContextMenu(host, {
+ getSelection: () => '',
+ paste: () => undefined,
+ reload: () => {},
+ selectAll: () => undefined,
+ wordErase: () => true
+ })
+ )
const elsewhere = document.createElement('textarea')
document.body.append(elsewhere)
@@ -233,6 +243,7 @@ describe('wordEraseFocusedTerminal', () => {
it('stops routing after the handle unregisters (idempotent remove)', () => {
const { host, scope } = mountScope('interactive')
const wordErase = vi.fn(() => true)
+
const unregister = registerTerminalContextMenu(host, {
getSelection: () => '',
paste: () => undefined,
diff --git a/apps/desktop/src/app/session/hooks/default-new-session.test.tsx b/apps/desktop/src/app/session/hooks/default-new-session.test.tsx
index df629e4b87c..33031c9d7a5 100644
--- a/apps/desktop/src/app/session/hooks/default-new-session.test.tsx
+++ b/apps/desktop/src/app/session/hooks/default-new-session.test.tsx
@@ -64,7 +64,7 @@ function mountActions() {
navigate,
requestGateway,
resetViewSync: vi.fn(),
- routedSessionId: null,
+ routedSessionId: null,
runtimeIdByStoredSessionIdRef: ref(new Map()),
selectedStoredSessionId: null,
selectedStoredSessionIdRef: ref<string | null>(null),
diff --git a/apps/desktop/src/app/session/hooks/session-context-drift.ts b/apps/desktop/src/app/session/hooks/session-context-drift.ts
index b85ce0ee928..9f9c038505b 100644
--- a/apps/desktop/src/app/session/hooks/session-context-drift.ts
+++ b/apps/desktop/src/app/session/hooks/session-context-drift.ts
@@ -120,6 +120,7 @@ export function sessionContextDrift({
pinOwner
}: SessionContextDriftArgs): string | null {
const activePins = pinOwner ? pinnedStoredSessionIdsForOwner(pinOwner) : NO_PINS
+
// Composer prong: the composer's loaded scope disagrees with the resolved
// submit target. Not a start/now comparison like the two prongs below — the
// composer only hands us one snapshot per submit — but it belongs in the
diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/lifecycle.ts b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/lifecycle.ts
index e6812f6f637..06641ecb48f 100644
--- a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/lifecycle.ts
+++ b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/lifecycle.ts
@@ -133,9 +133,7 @@ export function handleLifecycleEvent(ctx: GatewayEventContext): boolean {
// breakdown so the statusbar gauge refetches instead of serving the
// pre-compression figure (#94001). The breakdown cache keys on the
// STORED id; the reclaim payload carries it alongside the runtime id.
- const reclaimedStoredId = String(
- (payload as { stored_session_id?: string } | undefined)?.stored_session_id ?? ''
- )
+ const reclaimedStoredId = String((payload as { stored_session_id?: string } | undefined)?.stored_session_id ?? '')
if (reclaimedRuntimeId) {
// Heal while the cached stored-id mapping is still intact, then drop.
diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/tools-subagent-interrupt.test.ts b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/tools-subagent-interrupt.test.ts
index 29b673cbca1..1042578d34e 100644
--- a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/tools-subagent-interrupt.test.ts
+++ b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/tools-subagent-interrupt.test.ts
@@ -37,7 +37,10 @@ function deliver(event: GatewayEvent, interrupted: boolean) {
describe('subagent events across an interrupted session', () => {
beforeEach(() => {
- deliver(subagentEvent('subagent.start', { status: 'running', subagent_id: 'sa-1', goal: 'audit files', task_index: 0 }), false)
+ deliver(
+ subagentEvent('subagent.start', { status: 'running', subagent_id: 'sa-1', goal: 'audit files', task_index: 0 }),
+ false
+ )
})
afterEach(() => {
@@ -46,7 +49,10 @@ describe('subagent events across an interrupted session', () => {
})
it('a terminal subagent.complete still lands after Stop instead of leaving the row running forever', () => {
- deliver(subagentEvent('subagent.complete', { status: 'completed', subagent_id: 'sa-1', summary: 'done', task_index: 0 }), true)
+ deliver(
+ subagentEvent('subagent.complete', { status: 'completed', subagent_id: 'sa-1', summary: 'done', task_index: 0 }),
+ true
+ )
const row = $subagentsBySession.get()[sid]?.[0]
expect(row?.status).toBe('completed')
@@ -54,7 +60,15 @@ describe('subagent events across an interrupted session', () => {
})
it('live progress and non-terminal completions stay suppressed after Stop', () => {
- deliver(subagentEvent('subagent.progress', { status: 'running', subagent_id: 'sa-1', text: 'still going', task_index: 0 }), true)
+ deliver(
+ subagentEvent('subagent.progress', {
+ status: 'running',
+ subagent_id: 'sa-1',
+ text: 'still going',
+ task_index: 0
+ }),
+ true
+ )
deliver(subagentEvent('subagent.complete', { status: 'running', subagent_id: 'sa-1', task_index: 0 }), true)
const row = $subagentsBySession.get()[sid]?.[0]
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 ef2b9cf3af8..4f6ada67228 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
@@ -3150,6 +3150,7 @@ describe('usePromptActions restoreToMessage', () => {
$messages.set(initialMessages as never)
let submitAttempts = 0
+
const requestGateway = vi.fn(async (method: string, _params?: Record<string, unknown>) => {
if (method === 'prompt.submit') {
submitAttempts += 1
@@ -3695,7 +3696,6 @@ describe('usePromptActions file attachment sync', () => {
params: { session_id: RUNTIME_SESSION_ID, text: '@file:data/report.txt\n\nsummarize' }
})
})
-
})
describe('usePromptActions eager-upload races', () => {
@@ -6356,11 +6356,7 @@ describe('usePromptActions stale multi-window guard (#65047)', () => {
let handle: HarnessHandle | null = null
await actRender(
- <Harness
- onReady={h => (handle = h)}
- refreshSessions={async () => undefined}
- requestGateway={requestGateway}
- />
+ <Harness onReady={h => (handle = h)} refreshSessions={async () => undefined} requestGateway={requestGateway} />
)
const ok = await handle!.submitText('/goal align with the handoff doc', {
diff --git a/apps/desktop/src/app/session/hooks/use-prompt-actions/index.ts b/apps/desktop/src/app/session/hooks/use-prompt-actions/index.ts
index c9c6c767d8c..949a27de6d8 100644
--- a/apps/desktop/src/app/session/hooks/use-prompt-actions/index.ts
+++ b/apps/desktop/src/app/session/hooks/use-prompt-actions/index.ts
@@ -1100,6 +1100,7 @@ export function usePromptActions({
}
const refreshed = $messages.get()
+
const retryPlan = planRestore(refreshed, messageId, {
text: target?.text ?? plan.sourceText,
userOrdinal: target?.userOrdinal ?? plan.truncateOrdinal
diff --git a/apps/desktop/src/app/session/hooks/use-prompt-actions/submit.ts b/apps/desktop/src/app/session/hooks/use-prompt-actions/submit.ts
index b5611d2c1b4..82148a5aa61 100644
--- a/apps/desktop/src/app/session/hooks/use-prompt-actions/submit.ts
+++ b/apps/desktop/src/app/session/hooks/use-prompt-actions/submit.ts
@@ -898,6 +898,7 @@ export function useSubmitPrompt(deps: SubmitPromptDeps) {
state => ({ ...state, messages: refresh.messages }),
targetStoredSessionId
)
+
if (targetIsCurrentView()) {
scope.setMessages(() => refresh.messages)
}
diff --git a/apps/desktop/src/app/session/hooks/use-route-resume.ts b/apps/desktop/src/app/session/hooks/use-route-resume.ts
index 81e11622d1f..ba0355845fa 100644
--- a/apps/desktop/src/app/session/hooks/use-route-resume.ts
+++ b/apps/desktop/src/app/session/hooks/use-route-resume.ts
@@ -167,9 +167,7 @@ export function useRouteResume({
Boolean(activeSessionIdRef.current)
const stuckOnRoutedSession =
- routedSessionId !== selectedStoredSessionIdRef.current &&
- !freshDraftReady &&
- !selectionMovedAheadOfRoute
+ routedSessionId !== selectedStoredSessionIdRef.current && !freshDraftReady && !selectionMovedAheadOfRoute
// Resume when the route meaningfully changed, the gateway just opened, or
// we're stranded on a routed session that never loaded. The first two
diff --git a/apps/desktop/src/app/session/hooks/use-session-actions.test.tsx b/apps/desktop/src/app/session/hooks/use-session-actions.test.tsx
index b6a233737f2..d10f94b0b88 100644
--- a/apps/desktop/src/app/session/hooks/use-session-actions.test.tsx
+++ b/apps/desktop/src/app/session/hooks/use-session-actions.test.tsx
@@ -108,11 +108,7 @@ import { deferred } from '../../../test/deferred'
import { NEW_CHAT_ROUTE, sessionRoute } from '../../routes'
import type { ClientSessionState } from '../../types'
-import {
- pinnedOwnerCount,
- pinnedStoredSessionIdsForOwner,
- releaseStoredSessionPins
-} from './session-context-drift'
+import { pinnedOwnerCount, pinnedStoredSessionIdsForOwner, releaseStoredSessionPins } from './session-context-drift'
import { applySessionInfoStatePatch, sessionInfoStatePatch } from './use-message-stream/utils'
import { captureSteeringSession } from './use-prompt-actions/steering-session'
import { useSessionActions } from './use-session-actions'
@@ -167,7 +163,8 @@ type HarnessHandle = Pick<
| 'removeSession'
| 'selectSidebarItem'
| 'startFreshSessionDraft'
-> & Pick<ReturnType<typeof useSessionActions>, 'submitTextToNewSession'>
+> &
+ Pick<ReturnType<typeof useSessionActions>, 'submitTextToNewSession'>
function storedSession(overrides: Partial<SessionInfo> = {}): SessionInfo {
return {
@@ -233,7 +230,8 @@ function Harness({
routedSessionId: null,
runtimeIdByStoredSessionIdRef: runtimeIdByStoredSessionIdRefOverride ?? ref(new Map<string, string>()),
selectedStoredSessionId,
- selectedStoredSessionIdRef: selectedStoredSessionIdRefOverride ?? ref(selectedStoredSessionId), sessionStateByRuntimeIdRef: ref(new Map<string, ClientSessionState>()),
+ selectedStoredSessionIdRef: selectedStoredSessionIdRefOverride ?? ref(selectedStoredSessionId),
+ sessionStateByRuntimeIdRef: ref(new Map<string, ClientSessionState>()),
syncSessionStateToView: vi.fn(),
updateSessionState: updateSessionStateOverride ?? (() => ({}) as ClientSessionState)
})
@@ -1184,9 +1182,7 @@ describe('submitTextToNewSession pin release', () => {
const otherPins = observation[observation.promptOwner === 'owner-a' ? 'ownerB' : 'ownerA']
expect(ownPins).toContain(storedByOwner[observation.promptOwner])
- expect(ownPins).not.toContain(
- storedByOwner[observation.promptOwner === 'owner-a' ? 'owner-b' : 'owner-a']
- )
+ expect(ownPins).not.toContain(storedByOwner[observation.promptOwner === 'owner-a' ? 'owner-b' : 'owner-a'])
expect(otherPins).not.toContain(storedByOwner[observation.promptOwner])
}
@@ -1543,7 +1539,8 @@ function ResumeHarness({
requestGateway,
resetViewSync: vi.fn(),
routedSessionId: null,
- runtimeIdByStoredSessionIdRef: runtimeMapRef, selectedStoredSessionId,
+ runtimeIdByStoredSessionIdRef: runtimeMapRef,
+ selectedStoredSessionId,
selectedStoredSessionIdRef: ref<string | null>(selectedStoredSessionId),
sessionStateByRuntimeIdRef: stateMapRef,
holdSessionTranscriptView: runtimeId => {
@@ -6432,6 +6429,7 @@ describe('createBackendSessionForSend creatingSessionRef hold (#66057)', () => {
selectedStoredSessionIdRef: MutableRefObject<null | string>
}) {
const ref = <T,>(value: T): MutableRefObject<T> => ({ current: value })
+
const actions = useSessionActions({
activeSessionId: null,
activeSessionIdRef: ref<string | null>(null),
@@ -6474,6 +6472,7 @@ describe('createBackendSessionForSend creatingSessionRef hold (#66057)', () => {
}
let create: (() => Promise<string | null>) | null = null
+
const { rerender } = render(
<GuardHarness
creatingSessionRef={creatingSessionRef}
@@ -6484,6 +6483,7 @@ describe('createBackendSessionForSend creatingSessionRef hold (#66057)', () => {
selectedStoredSessionIdRef={selectedStoredSessionIdRef}
/>
)
+
await waitFor(() => expect(create).not.toBeNull())
await act(async () => {
@@ -6525,6 +6525,7 @@ describe('createBackendSessionForSend creatingSessionRef hold (#66057)', () => {
it('clears creatingSessionRef when navigate throws', async () => {
const creatingSessionRef: MutableRefObject<boolean> = { current: false }
const selectedStoredSessionIdRef: MutableRefObject<null | string> = { current: null }
+
const navigate = vi.fn(() => {
throw new Error('navigate failed')
})
@@ -6570,6 +6571,7 @@ describe('createBackendSessionForSend creatingSessionRef hold (#66057)', () => {
}
let create: (() => Promise<string | null>) | null = null
+
const { rerender } = render(
<GuardHarness
creatingSessionRef={creatingSessionRef}
@@ -6580,6 +6582,7 @@ describe('createBackendSessionForSend creatingSessionRef hold (#66057)', () => {
selectedStoredSessionIdRef={selectedStoredSessionIdRef}
/>
)
+
await waitFor(() => expect(create).not.toBeNull())
await act(async () => {
diff --git a/apps/desktop/src/app/session/hooks/use-session-actions/index.ts b/apps/desktop/src/app/session/hooks/use-session-actions/index.ts
index 4c867dcc2cd..a067e787074 100644
--- a/apps/desktop/src/app/session/hooks/use-session-actions/index.ts
+++ b/apps/desktop/src/app/session/hooks/use-session-actions/index.ts
@@ -930,6 +930,7 @@ export function useSessionActions({
} catch {
releaseCreatingSessionGuard()
}
+
// Other windows (e.g. the main window when this is the pop-out) can't
// see this session until they re-pull the shared list.
broadcastSessionsChanged()
@@ -1035,7 +1036,14 @@ export function useSessionActions({
releaseStoredSessionPins(pinOwner)
}
},
- [ensureSessionState, getRouteToken, navigate, requestGateway, runtimeIdByStoredSessionIdRef, selectedStoredSessionIdRef]
+ [
+ ensureSessionState,
+ getRouteToken,
+ navigate,
+ requestGateway,
+ runtimeIdByStoredSessionIdRef,
+ selectedStoredSessionIdRef
+ ]
)
const selectSidebarItem = useCallback(
diff --git a/apps/desktop/src/app/shell/hooks/use-context-breakdown.test.ts b/apps/desktop/src/app/shell/hooks/use-context-breakdown.test.ts
index e7208cedc59..b68c9212f6b 100644
--- a/apps/desktop/src/app/shell/hooks/use-context-breakdown.test.ts
+++ b/apps/desktop/src/app/shell/hooks/use-context-breakdown.test.ts
@@ -89,7 +89,9 @@ describe('useContextBreakdown (#94001)', () => {
// s2's fetch resolved with LIVE_BREAKDOWN too (same mock), so it serves —
// but the point is the s1 entry did not leak during the s2 loading window.
- const requestGatewaySlow = vi.fn((_method: string) => deferred<ContextBreakdown>().promise) as unknown as GatewayRequester
+ const requestGatewaySlow = vi.fn(
+ (_method: string) => deferred<ContextBreakdown>().promise
+ ) as unknown as GatewayRequester
rerender({ busy: false, enabled: true, requestGateway: requestGatewaySlow, sessionId: 's3' })
expect(result.current.breakdown).toBeNull()
@@ -175,7 +177,9 @@ describe('useContextBreakdown (#94001)', () => {
it('does not cache a zeroed breakdown (agentless window) and retries until a live agent answers', async () => {
let zeroed = true
- const requestGateway = vi.fn(async () => (zeroed ? ZEROED_BREAKDOWN : LIVE_BREAKDOWN)) as unknown as GatewayRequester
+ const requestGateway = vi.fn(async () =>
+ zeroed ? ZEROED_BREAKDOWN : LIVE_BREAKDOWN
+ ) as unknown as GatewayRequester
const { result } = renderHook(props => useContextBreakdown(props), {
initialProps: { busy: false, enabled: true, requestGateway, sessionId: 's1' as null | string }
diff --git a/apps/desktop/src/app/shell/hooks/use-context-breakdown.ts b/apps/desktop/src/app/shell/hooks/use-context-breakdown.ts
index 293cbcbaa08..bd54844ffc3 100644
--- a/apps/desktop/src/app/shell/hooks/use-context-breakdown.ts
+++ b/apps/desktop/src/app/shell/hooks/use-context-breakdown.ts
@@ -207,4 +207,4 @@ export function useContextBreakdown({ busy, enabled, requestGateway, sessionId }
breakdown: !busy && fetched?.sessionId === sessionId ? fetched.breakdown : null,
loading
}
-}
\ No newline at end of file
+}
diff --git a/apps/desktop/src/app/starmap/context-menu-handle.ts b/apps/desktop/src/app/starmap/context-menu-handle.ts
index a68b4cfc257..d5f181a92fc 100644
--- a/apps/desktop/src/app/starmap/context-menu-handle.ts
+++ b/apps/desktop/src/app/starmap/context-menu-handle.ts
@@ -13,10 +13,7 @@ export interface StarMapContextMenuHandle {
const handles = new WeakMap<HTMLCanvasElement, StarMapContextMenuHandle>()
/** Register the handle for a Star Map canvas. Returns an idempotent remove. */
-export function registerStarMapContextMenu(
- canvas: HTMLCanvasElement,
- handle: StarMapContextMenuHandle
-): () => void {
+export function registerStarMapContextMenu(canvas: HTMLCanvasElement, handle: StarMapContextMenuHandle): () => void {
handles.set(canvas, handle)
return () => {
diff --git a/apps/desktop/src/components/assistant-ui/inline-preview-directive.tsx b/apps/desktop/src/components/assistant-ui/inline-preview-directive.tsx
index 16cf13559a8..2d0ca408d98 100644
--- a/apps/desktop/src/components/assistant-ui/inline-preview-directive.tsx
+++ b/apps/desktop/src/components/assistant-ui/inline-preview-directive.tsx
@@ -407,6 +407,7 @@ function InlineHtmlFrame({
if (!result || isReadFileErrorResult(result)) {
setFailed(true)
+
return
}
diff --git a/apps/desktop/src/components/assistant-ui/markdown-text.filelinks.test.tsx b/apps/desktop/src/components/assistant-ui/markdown-text.filelinks.test.tsx
index c714e47cc44..3ff40d8805a 100644
--- a/apps/desktop/src/components/assistant-ui/markdown-text.filelinks.test.tsx
+++ b/apps/desktop/src/components/assistant-ui/markdown-text.filelinks.test.tsx
@@ -39,9 +39,7 @@ describe('MarkdownLink filesystem hrefs', () => {
// CommonMark requires `<...>` destinations for paths with spaces; the
// old FILE_LINK_RE charset `[^\)\s]*` couldn't match them, so the link
// fell through to harden and rendered as "label [blocked]".
- render(
- <MarkdownTextContent isRunning={false} text={'See [notes](<~/My Notes/todo with spaces.md>)'} />
- )
+ render(<MarkdownTextContent isRunning={false} text={'See [notes](<~/My Notes/todo with spaces.md>)'} />)
await screen.findByText('todo with spaces.md')
expect(screen.getByRole('button', { name: 'Open preview' })).toBeTruthy()
@@ -52,9 +50,7 @@ describe('MarkdownLink filesystem hrefs', () => {
// Markdown renderers emit the href percent-encoded; the renderer keeps
// the encoded form in the card label, and the electron side retries the
// decoded on-disk path when the file is opened.
- render(
- <MarkdownTextContent isRunning={false} text={'See [notes](~/My%20Notes/todo%20with%20spaces.md)'} />
- )
+ render(<MarkdownTextContent isRunning={false} text={'See [notes](~/My%20Notes/todo%20with%20spaces.md)'} />)
await screen.findByText('todo%20with%20spaces.md')
expect(screen.getByRole('button', { name: 'Open preview' })).toBeTruthy()
diff --git a/apps/desktop/src/components/assistant-ui/thread/timeline-position.ts b/apps/desktop/src/components/assistant-ui/thread/timeline-position.ts
index 367f40f118c..dc37c8d6e57 100644
--- a/apps/desktop/src/components/assistant-ui/thread/timeline-position.ts
+++ b/apps/desktop/src/components/assistant-ui/thread/timeline-position.ts
@@ -22,9 +22,7 @@ export function createTimelinePositionReader(viewport: HTMLElement, indexes: Rea
invalidate(records: readonly MutationRecord[]) {
if (
records.some(
- record =>
- record.type === 'attributes' ||
- [...record.addedNodes, ...record.removedNodes].some(containsMessage)
+ record => record.type === 'attributes' || [...record.addedNodes, ...record.removedNodes].some(containsMessage)
)
) {
prompts = null
diff --git a/apps/desktop/src/components/assistant-ui/thread/use-messages-below-perf.test.ts b/apps/desktop/src/components/assistant-ui/thread/use-messages-below-perf.test.ts
index ca003c3c92e..4862d0816a3 100644
--- a/apps/desktop/src/components/assistant-ui/thread/use-messages-below-perf.test.ts
+++ b/apps/desktop/src/components/assistant-ui/thread/use-messages-below-perf.test.ts
@@ -2,8 +2,7 @@ import { afterEach, describe, expect, it, vi } from 'vitest'
import { countMessagesBelow } from './use-messages-below'
-const rect = (top: number, bottom: number): DOMRect =>
- ({ top, bottom, height: bottom - top, width: 800 } as DOMRect)
+const rect = (top: number, bottom: number): DOMRect => ({ top, bottom, height: bottom - top, width: 800 }) as DOMRect
afterEach(() => {
window.document.body.innerHTML = ''
diff --git a/apps/desktop/src/components/assistant-ui/thread/use-messages-below.test.tsx b/apps/desktop/src/components/assistant-ui/thread/use-messages-below.test.tsx
index 5eb076ec546..170e5101368 100644
--- a/apps/desktop/src/components/assistant-ui/thread/use-messages-below.test.tsx
+++ b/apps/desktop/src/components/assistant-ui/thread/use-messages-below.test.tsx
@@ -195,7 +195,16 @@ describe('messages below the viewport', () => {
expect($threadMessagesBelowBySession.get()['runtime-a'] ?? 0).toBe(1)
// Non-message subtree mutations do not schedule another geometry read.
- mutate?.([{ type: 'childList', addedNodes: [window.document.createElement('span')], removedNodes: [] } as unknown as MutationRecord], {} as MutationObserver)
+ mutate?.(
+ [
+ {
+ type: 'childList',
+ addedNodes: [window.document.createElement('span')],
+ removedNodes: []
+ } as unknown as MutationRecord
+ ],
+ {} as MutationObserver
+ )
expect(frame).toBeUndefined()
// Another visible pane reaching bottom must not erase this reader's count.
diff --git a/apps/desktop/src/components/chat/zoomable-image.tsx b/apps/desktop/src/components/chat/zoomable-image.tsx
index c38a261f4c9..a748e68e223 100644
--- a/apps/desktop/src/components/chat/zoomable-image.tsx
+++ b/apps/desktop/src/components/chat/zoomable-image.tsx
@@ -167,7 +167,8 @@ export function ImageLightbox({
<ZoomIn className="size-4" />
</button>
</div>
- )}
+ )
+ }
className="w-auto max-h-[calc(100vh-12rem)] max-w-[calc(100vw-12rem)] border-0 bg-transparent! shadow-none!"
// The media-lightbox shell variant. styles.css paints every
// [data-slot='dialog-content'] with the themed elevated background +
diff --git a/apps/desktop/src/i18n/ar.ts b/apps/desktop/src/i18n/ar.ts
index bff7e70e491..4db6decd094 100644
--- a/apps/desktop/src/i18n/ar.ts
+++ b/apps/desktop/src/i18n/ar.ts
@@ -56,5 +56,5 @@ export const ar = defineLocale({
desktop: arChat.desktop,
errors: arDiagnostics.errors,
tips: arChat.tips,
- ui: arCommon.ui,
+ ui: arCommon.ui
})
diff --git a/apps/desktop/src/i18n/ar_artifacts.ts b/apps/desktop/src/i18n/ar_artifacts.ts
index acf39b0a5fe..dcf0d14eff8 100644
--- a/apps/desktop/src/i18n/ar_artifacts.ts
+++ b/apps/desktop/src/i18n/ar_artifacts.ts
@@ -59,7 +59,8 @@ export const arArtifacts = {
loading: 'جار تحميل المعاينة',
unavailable: 'المعاينة غير متاحة',
missingTitle: 'الملف لم يعد موجودا',
- missingBody: label => `تم حذف ${label} أو نقله، أو أُفرغ موقعه المؤقت. لن تتم استعادة علامة التبويب هذه عند الإطلاق التالي.`,
+ missingBody: label =>
+ `تم حذف ${label} أو نقله، أو أُفرغ موقعه المؤقت. لن تتم استعادة علامة التبويب هذه عند الإطلاق التالي.`,
opening: 'جار الفتح...',
hide: 'إخفاء',
openPreview: 'فتح المعاينة',
@@ -153,5 +154,5 @@ export const arArtifacts = {
openTarget: url => `فتح ${url}`,
fallbackTitle: 'معاينة'
}
- },
+ }
} satisfies Pick<TranslationOverrides, 'artifacts' | 'artifactCard' | 'artifactPreview' | 'preview'>
diff --git a/apps/desktop/src/i18n/ar_assistant.ts b/apps/desktop/src/i18n/ar_assistant.ts
index 3b92de61e68..a118f033cde 100644
--- a/apps/desktop/src/i18n/ar_assistant.ts
+++ b/apps/desktop/src/i18n/ar_assistant.ts
@@ -297,5 +297,5 @@ export const arAssistant = {
}
}
}
- },
+ }
} satisfies Pick<TranslationOverrides, 'assistant'>
diff --git a/apps/desktop/src/i18n/ar_boot.ts b/apps/desktop/src/i18n/ar_boot.ts
index 2d48e30735c..4a2995df2b7 100644
--- a/apps/desktop/src/i18n/ar_boot.ts
+++ b/apps/desktop/src/i18n/ar_boot.ts
@@ -323,5 +323,8 @@ export const arBoot = {
change: 'تغيير',
startChatting: 'ابدأ',
docs: provider => `وثائق ${provider}`
- },
-} satisfies Pick<TranslationOverrides, 'boot' | 'remoteDisplayBanner' | 'updates' | 'guidedGreeting' | 'install' | 'onboarding'>
+ }
+} satisfies Pick<
+ TranslationOverrides,
+ 'boot' | 'remoteDisplayBanner' | 'updates' | 'guidedGreeting' | 'install' | 'onboarding'
+>
diff --git a/apps/desktop/src/i18n/ar_capabilities.ts b/apps/desktop/src/i18n/ar_capabilities.ts
index 5d4ffcd4238..87db92f7561 100644
--- a/apps/desktop/src/i18n/ar_capabilities.ts
+++ b/apps/desktop/src/i18n/ar_capabilities.ts
@@ -131,5 +131,5 @@ export const arCapabilities = {
durationSeconds: seconds => `${seconds} ث`,
durationMinutes: (minutes, seconds) => `${minutes} د ${seconds} ث`,
tokens: value => `${value} رمز`
- },
+ }
} satisfies Pick<TranslationOverrides, 'catalog' | 'skills' | 'agents'>
diff --git a/apps/desktop/src/i18n/ar_chat.ts b/apps/desktop/src/i18n/ar_chat.ts
index 910adb3e24f..1e24ba3b1b5 100644
--- a/apps/desktop/src/i18n/ar_chat.ts
+++ b/apps/desktop/src/i18n/ar_chat.ts
@@ -528,5 +528,5 @@ export const arChat = {
text: 'الملفات والطرفية والمراجعة والمتصفح المدمج تتشارك اللوحة الجانبية.'
}
}
- },
+ }
} satisfies Pick<TranslationOverrides, 'composer' | 'statusStack' | 'prompts' | 'desktop' | 'tips'>
diff --git a/apps/desktop/src/i18n/ar_chrome.ts b/apps/desktop/src/i18n/ar_chrome.ts
index 940822f1e88..10a85e987ff 100644
--- a/apps/desktop/src/i18n/ar_chrome.ts
+++ b/apps/desktop/src/i18n/ar_chrome.ts
@@ -555,5 +555,16 @@ export const arChrome = {
copyPageUrl: 'نسخ رابط الصفحة',
inspectElement: 'فحص العنصر'
}
- },
-} satisfies Pick<TranslationOverrides, 'externalOpenFailed' | 'fileMenu' | 'titlebar' | 'keybinds' | 'sidebar' | 'shell' | 'rightSidebar' | 'zones' | 'contextMenu'>
+ }
+} satisfies Pick<
+ TranslationOverrides,
+ | 'externalOpenFailed'
+ | 'fileMenu'
+ | 'titlebar'
+ | 'keybinds'
+ | 'sidebar'
+ | 'shell'
+ | 'rightSidebar'
+ | 'zones'
+ | 'contextMenu'
+>
diff --git a/apps/desktop/src/i18n/ar_command_center.ts b/apps/desktop/src/i18n/ar_command_center.ts
index 074754b9de5..fd4f1bf6406 100644
--- a/apps/desktop/src/i18n/ar_command_center.ts
+++ b/apps/desktop/src/i18n/ar_command_center.ts
@@ -623,5 +623,5 @@ export const arCommandCenter = {
promptScheduleRequired: 'الرسالة والجدول مطلوبان',
saveChanges: 'حفظ التغييرات',
createAction: 'إنشاء'
- },
+ }
} satisfies Pick<TranslationOverrides, 'commandCenter' | 'messaging' | 'profiles' | 'cron'>
diff --git a/apps/desktop/src/i18n/ar_connectors.ts b/apps/desktop/src/i18n/ar_connectors.ts
index a0e6870c676..adf72400fd6 100644
--- a/apps/desktop/src/i18n/ar_connectors.ts
+++ b/apps/desktop/src/i18n/ar_connectors.ts
@@ -33,5 +33,5 @@ export const arConnectors = {
open: 'فتح في Hermes',
continue: 'المتابعة في Hermes',
importError: 'تعذر استيراد هذه المحادثة.'
- },
+ }
} satisfies Pick<TranslationOverrides, 'sessionImport'>
diff --git a/apps/desktop/src/i18n/ar_diagnostics.ts b/apps/desktop/src/i18n/ar_diagnostics.ts
index 1937ac9ede8..f537374190f 100644
--- a/apps/desktop/src/i18n/ar_diagnostics.ts
+++ b/apps/desktop/src/i18n/ar_diagnostics.ts
@@ -107,5 +107,5 @@ export const arDiagnostics = {
boundaryDesc: 'يمكنك إعادة تحميل النافذة أو فتح السجلات لمعرفة التفاصيل.',
reloadWindow: 'إعادة تحميل النافذة',
openLogs: 'فتح السجلات'
- },
+ }
} satisfies Pick<TranslationOverrides, 'sendDiagnostics' | 'notifications' | 'errors'>
diff --git a/apps/desktop/src/i18n/ar_settings.ts b/apps/desktop/src/i18n/ar_settings.ts
index 3209fbac01a..c457841071b 100644
--- a/apps/desktop/src/i18n/ar_settings.ts
+++ b/apps/desktop/src/i18n/ar_settings.ts
@@ -924,5 +924,8 @@ export const arSettings = {
label: 'متقدم',
description: 'للمطورين. الطرفية والملفات والفروقات وشريط الحالة والتخطيطات، كما أعددتها.'
}
- },
-} satisfies Pick<TranslationOverrides, 'language' | 'settings' | 'modelAssignment' | 'modelPicker' | 'modelVisibility' | 'interfaceMode'>
+ }
+} satisfies Pick<
+ TranslationOverrides,
+ 'language' | 'settings' | 'modelAssignment' | 'modelPicker' | 'modelVisibility' | 'interfaceMode'
+>
diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts
index c1a7901a9cc..39a9f821af6 100644
--- a/apps/desktop/src/i18n/en.ts
+++ b/apps/desktop/src/i18n/en.ts
@@ -4860,7 +4860,8 @@ export const en: Translations = {
unavailable: 'Preview unavailable',
missingTarget: 'That path does not exist on this computer',
missingTitle: 'File no longer exists',
- missingBody: label => `${label} was deleted, moved, or its temporary location was cleared. This tab will not be restored on the next launch.`,
+ missingBody: label =>
+ `${label} was deleted, moved, or its temporary location was cleared. This tab will not be restored on the next launch.`,
opening: 'Opening...',
hide: 'Hide',
openPreview: 'Open preview',
diff --git a/apps/desktop/src/i18n/ja.ts b/apps/desktop/src/i18n/ja.ts
index 884fedeacf7..303dac642f4 100644
--- a/apps/desktop/src/i18n/ja.ts
+++ b/apps/desktop/src/i18n/ja.ts
@@ -3581,7 +3581,8 @@ export const ja = defineLocale({
loading: 'プレビューを読み込み中',
unavailable: 'プレビューは利用できません',
missingTitle: 'ファイルは存在しません',
- missingBody: label => `${label} は削除・移動されたか、一時的な場所が消去されました。このタブは次回の起動時には復元されません。`,
+ missingBody: label =>
+ `${label} は削除・移動されたか、一時的な場所が消去されました。このタブは次回の起動時には復元されません。`,
opening: '開いています...',
hide: '非表示',
openPreview: 'プレビューを開く',
diff --git a/apps/desktop/src/lib/chat-runtime.ts b/apps/desktop/src/lib/chat-runtime.ts
index a55248d153a..68aa19ae136 100644
--- a/apps/desktop/src/lib/chat-runtime.ts
+++ b/apps/desktop/src/lib/chat-runtime.ts
@@ -327,12 +327,13 @@ const ATTACHMENT_REF_LINE_RE = /^@[a-z][a-z0-9-]*:[^\n]*\n?/i
export function stripAttachmentRefs(text: string): string {
let current = text ?? ''
- // eslint-disable-next-line no-constant-condition
while (true) {
const next = current.replace(ATTACHMENT_REF_LINE_RE, '')
+
if (next === current) {
break
}
+
current = next
}
diff --git a/apps/desktop/src/lib/desktop-slash-commands.test.ts b/apps/desktop/src/lib/desktop-slash-commands.test.ts
index ed4cee93bd7..6a9003bbf63 100644
--- a/apps/desktop/src/lib/desktop-slash-commands.test.ts
+++ b/apps/desktop/src/lib/desktop-slash-commands.test.ts
@@ -107,7 +107,9 @@ describe('desktop slash command curation', () => {
// render a refusal message instead of reaching the wire, and a bare
// /skills never execs into the interactive hub from the desktop.
expect(desktopSubcommandUnavailableMessage('/skills', 'search')).toContain('not available in the desktop app')
- expect(desktopSubcommandUnavailableMessage('/skills', 'install gif-search')).toContain('not available in the desktop app')
+ expect(desktopSubcommandUnavailableMessage('/skills', 'install gif-search')).toContain(
+ 'not available in the desktop app'
+ )
expect(desktopSubcommandUnavailableMessage('/skills', 'audit')).toContain('not available in the desktop app')
expect(desktopSubcommandUnavailableMessage('/skills', '')).toContain('needs a subcommand here')
expect(desktopSubcommandUnavailableMessage('/skills', ' ')).toContain('needs a subcommand here')
@@ -115,20 +117,24 @@ describe('desktop slash command curation', () => {
// Completion never suggests a subcommand the gate would refuse.
const subs = (items: readonly { text?: string }[]) => items.map(item => item.text)
- expect(subs(filterDesktopSubcommandCompletions(
- '/skills ', [{ text: 'pending review' }, { text: 'install demo' }], { isArgCompletion: true })
- )).toEqual(['pending review'])
- expect(subs(filterDesktopSubcommandCompletions(
- '/skills ap', [{ text: 'approval on' }], { isArgCompletion: true })
- )).toEqual(['approval on'])
+ expect(
+ subs(
+ filterDesktopSubcommandCompletions('/skills ', [{ text: 'pending review' }, { text: 'install demo' }], {
+ isArgCompletion: true
+ })
+ )
+ ).toEqual(['pending review'])
+ expect(
+ subs(filterDesktopSubcommandCompletions('/skills ap', [{ text: 'approval on' }], { isArgCompletion: true }))
+ ).toEqual(['approval on'])
// Value completion for a blocked hub mutation stays empty.
- expect(filterDesktopSubcommandCompletions(
- '/skills install ', [{ text: 'demo' }], { isArgCompletion: true })
+ expect(
+ filterDesktopSubcommandCompletions('/skills install ', [{ text: 'demo' }], { isArgCompletion: true })
).toEqual([])
// Command-token completions pass through untouched.
- expect(subs(filterDesktopSubcommandCompletions(
- '/sk', [{ text: '/skills' }], { isArgCompletion: false })
- )).toEqual(['/skills'])
+ expect(subs(filterDesktopSubcommandCompletions('/sk', [{ text: '/skills' }], { isArgCompletion: false }))).toEqual([
+ '/skills'
+ ])
})
it('groups complete.slash rows by backend kind, not the desktop table', () => {
diff --git a/apps/desktop/src/lib/markdown-preprocess.ts b/apps/desktop/src/lib/markdown-preprocess.ts
index 3417fed55dd..fa67ea2626f 100644
--- a/apps/desktop/src/lib/markdown-preprocess.ts
+++ b/apps/desktop/src/lib/markdown-preprocess.ts
@@ -220,7 +220,8 @@ const FENCE_TOGGLE_RE = /^[ \t]*(?:```|~~~)/
// CommonMark angle-bracket destinations (`[notes](<~/My Notes/todo.md>`) are
// matched separately so paths with spaces route to the preview pipeline too
// (#102782) — `routeFileLinksToPreview` strips the surrounding `<>`.
-const FILE_LINK_RE = /(?<!!)\[(?<label>[^\]\n]+)\]\((?<target>(?:<(?:file:\/\/|\/|~\/|[a-z]:[\\/])[^>]*>)|(?:file:\/\/|\/|~\/|[a-z]:[\\/])[^)\s]*)\)/gi
+const FILE_LINK_RE =
+ /(?<!!)\[(?<label>[^\]\n]+)\]\((?<target>(?:<(?:file:\/\/|\/|~\/|[a-z]:[\\/])[^>]*>)|(?:file:\/\/|\/|~\/|[a-z]:[\\/])[^)\s]*)\)/gi
// A transcript directive on its own line: `::name{...}`. Attribute values are
// prose the model wrote (a task brief, a question) and read as markdown to the
diff --git a/apps/desktop/src/lib/quick-entry-submission.test.ts b/apps/desktop/src/lib/quick-entry-submission.test.ts
index 45e213b54a2..af8ee01cc35 100644
--- a/apps/desktop/src/lib/quick-entry-submission.test.ts
+++ b/apps/desktop/src/lib/quick-entry-submission.test.ts
@@ -43,6 +43,7 @@ describe('captureQuickEntryRequest', () => {
target: 'current'
}
}
+
const request = captureQuickEntryRequest(original)
original.correlationId = 'qe-other'
diff --git a/apps/desktop/src/lib/quick-entry-submission.ts b/apps/desktop/src/lib/quick-entry-submission.ts
index 1aeb2a41e06..0070e48bb73 100644
--- a/apps/desktop/src/lib/quick-entry-submission.ts
+++ b/apps/desktop/src/lib/quick-entry-submission.ts
@@ -89,6 +89,7 @@ export function captureQuickEntryRequest(input: {
identity: QuickEntryRequestIdentity
}): CapturedQuickEntryRequest {
const identity: QuickEntryRequestIdentity = { ...input.identity }
+
const request: CapturedQuickEntryRequest = {
correlationId: input.correlationId,
identity
@@ -161,6 +162,7 @@ export function validateQuickEntryAcceptance(
}
const result = isRecord(backendResult) && Object.keys(backendResult).length > 0 ? backendResult : null
+
if (
result === null ||
!nonEmptyString(result.correlationId) ||
diff --git a/apps/desktop/src/lib/speech-text.identifier-corpus.test.ts b/apps/desktop/src/lib/speech-text.identifier-corpus.test.ts
index 63d566811d9..e134456be13 100644
--- a/apps/desktop/src/lib/speech-text.identifier-corpus.test.ts
+++ b/apps/desktop/src/lib/speech-text.identifier-corpus.test.ts
@@ -12,6 +12,7 @@ import { sanitizeTextForSpeech } from './speech-text'
// never hardcoded English placeholder words (#86602); ordinary prose,
// emails, dates and ratios pass verbatim.
const corpusPath = resolve(__dirname, '../../../../tests/fixtures/identifier_speech_corpus.json')
+
const corpus = JSON.parse(readFileSync(corpusPath, 'utf8')) as {
identifier_tokens: [string, string[], string[]][]
pass_through_tokens: [string, string[], string[]][]
@@ -21,9 +22,11 @@ describe('sanitizeTextForSpeech identifier-dense tokens (#119207)', () => {
it('silences identifier tokens while the prose around them survives', () => {
for (const [text, mustNotContain, mustContain] of corpus.identifier_tokens) {
const spoken = sanitizeTextForSpeech(text)
+
for (const needle of mustNotContain) {
expect(spoken, `${needle} leaked from ${text}`).not.toContain(needle)
}
+
for (const needle of mustContain) {
expect(spoken, `${needle} lost from ${text}`).toContain(needle)
}
@@ -33,6 +36,7 @@ describe('sanitizeTextForSpeech identifier-dense tokens (#119207)', () => {
it('passes ordinary speech through untouched', () => {
for (const [text, , mustContain] of corpus.pass_through_tokens) {
const spoken = sanitizeTextForSpeech(text)
+
for (const needle of mustContain) {
expect(spoken, `${needle} lost from ${text}`).toContain(needle)
}
@@ -40,9 +44,8 @@ describe('sanitizeTextForSpeech identifier-dense tokens (#119207)', () => {
})
it('reads the issue repro: filenames never spell out character by character', () => {
- const spoken = sanitizeTextForSpeech(
- 'Saved peyton-sample-20260922.wav and peyton-sample-20260922.ogg.'
- )
+ const spoken = sanitizeTextForSpeech('Saved peyton-sample-20260922.wav and peyton-sample-20260922.ogg.')
+
expect(spoken).not.toContain('.wav')
expect(spoken).not.toContain('.ogg')
expect(spoken).not.toContain('peyton')
@@ -50,11 +53,7 @@ describe('sanitizeTextForSpeech identifier-dense tokens (#119207)', () => {
})
it('keeps code fences, links and MEDIA: tokens working alongside the new pass', () => {
- expect(sanitizeTextForSpeech('Here is code:\n```ts\nconst x = 1\n```\nDone.')).toBe(
- 'Here is code. Done.'
- )
- expect(sanitizeTextForSpeech('Use `git status` after the change.')).toBe(
- 'Use git status after the change.'
- )
+ expect(sanitizeTextForSpeech('Here is code:\n```ts\nconst x = 1\n```\nDone.')).toBe('Here is code. Done.')
+ expect(sanitizeTextForSpeech('Use `git status` after the change.')).toBe('Use git status after the change.')
})
})
diff --git a/apps/desktop/src/lib/speech-text.ts b/apps/desktop/src/lib/speech-text.ts
index 0c1cfde4b10..a9af70ea71b 100644
--- a/apps/desktop/src/lib/speech-text.ts
+++ b/apps/desktop/src/lib/speech-text.ts
@@ -29,6 +29,7 @@ const URL_RE = /\bhttps?:\/\/\S+/gi
// (tests/fixtures/identifier_speech_corpus.json) first.
const FILENAME_EXT_RE =
/[\w.-]{0,60}\.(?:wav|ogg|mp3|flac|m4a|aac|py|pyc|ts|tsx|js|jsx|mjs|cjs|json|yaml|yml|toml|md|mdx|txt|csv|xlsx|xls|pdf|png|jpg|jpeg|gif|webp|svg|log|sql|sh|bash|zsh|rs|go|java|rb|php|html|css|lock|tar|gz|zip|db|sqlite|sqlite3|onnx|pt|bin|env|ini|conf|cfg|xml)\b/i
+
const UUID_RE = /[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/
const HASH_PREFIX_HEX_RE = /\b(?:sha(?:-?256|-?512|-?1|3)?|blake2[ab]?|md5|crc32?)[:\s]+[0-9a-fA-F]{7,64}/gi
const HEX_RUN_RE = /[0-9a-fA-F]{7,64}/
@@ -39,28 +40,36 @@ function isDenseIdentifier(token: string): boolean {
if (token.includes('@') || DATE_TOKEN_RE.test(token)) {
return false // email addresses, dates ("2026-09-28", "2026/06/02")
}
+
if (/^(?:~\/|\.\.?\/|\/)/.test(token)) {
return true // filesystem paths
}
+
if (token.includes('/') && (FILENAME_EXT_RE.test(token) || /\d/.test(token))) {
return true // paths and dense model IDs ("meta-llama/Llama-3.3-70B-Instruct")
}
+
if (FILENAME_EXT_RE.test(token) || UUID_RE.test(token)) {
return true
}
+
// Hex-hash runs ("73688014f78", "e3b0c442...") — digit-free runs
// ("defaced") are legitimate words and stay.
if (HEX_RUN_RE.test(token) && /\d/.test(token)) {
return true
}
+
if (!/\d/.test(token)) {
return false
}
+
const seps = ['_', '.', '/'].filter(char => token.includes(char)).length
const hyphens = (token.match(/-/g) ?? []).length
+
if (seps >= 2 || hyphens >= 2) {
return true // v2.1.0-beta.3, Llama-3.3-70B, dated filename slugs
}
+
return token.includes('/') || (hyphens >= 1 && seps >= 1)
}
@@ -325,14 +334,16 @@ export function sanitizeTextForSpeech(text: string): string {
// run AFTER code fences/inline code/links are consumed so their contents
// are not double-processed, and AFTER URLs/MEDIA: tokens, which own
// themselves.
- const withoutIdentifiers = pruneIdentifierTokens(normalizeLineBreaks(pre)
- .replace(FENCED_CODE_RE, '')
- .replace(THINKING_PREFIX_RE, ' ')
- .replace(MARKDOWN_LINK_RE, '$1')
- .replace(INLINE_CODE_RE, '$1')
- .replace(URL_RE, '')
- .replace(MEDIA_PATH_RE, '')
- .replace(EMOJI_RE, ' '))
+ const withoutIdentifiers = pruneIdentifierTokens(
+ normalizeLineBreaks(pre)
+ .replace(FENCED_CODE_RE, '')
+ .replace(THINKING_PREFIX_RE, ' ')
+ .replace(MARKDOWN_LINK_RE, '$1')
+ .replace(INLINE_CODE_RE, '$1')
+ .replace(URL_RE, '')
+ .replace(MEDIA_PATH_RE, '')
+ .replace(EMOJI_RE, ' ')
+ )
return withoutIdentifiers
.replace(/^#{1,6}\s+/gm, '')
diff --git a/apps/desktop/src/lib/stale-transcript-guard.test.ts b/apps/desktop/src/lib/stale-transcript-guard.test.ts
index 9edbc1462ee..670c5bb5491 100644
--- a/apps/desktop/src/lib/stale-transcript-guard.test.ts
+++ b/apps/desktop/src/lib/stale-transcript-guard.test.ts
@@ -181,6 +181,7 @@ describe('surplusIsCompetingView', () => {
// That residue is this window's own turn aftermath, not a competing view.
it('turn-death residue with an unreconciled optimistic user row is not a competing view', () => {
const local = [competingViewUserMessage('opt-old', 'deploy the schema')]
+
const refreshed = [
competingViewUserMessage('msg-10', 'deploy the schema', 10),
competingViewAssistantMessage('msg-11', '⌛ Approval timed out after 5 minutes', 11)
@@ -193,6 +194,7 @@ describe('surplusIsCompetingView', () => {
// Issue comment 2: a successful plain tool turn reproduces the refusal
// single-window — the server folded rows this window never streamed back.
const local = [competingViewUserMessage('opt-old', 'run the tests')]
+
const refreshed = [
competingViewUserMessage('msg-10', 'run the tests', 10),
competingViewAssistantMessage('msg-11', 'checking', 11),
@@ -204,6 +206,7 @@ describe('surplusIsCompetingView', () => {
it('rejects a repeated prompt from another view even when the text matches', () => {
const local = [competingViewUserMessage('prior', 'run the tests')]
+
const refreshed = [
competingViewUserMessage('prior', 'run the tests', 10),
competingViewUserMessage('peer', 'run the tests', 12)
@@ -214,6 +217,7 @@ describe('surplusIsCompetingView', () => {
it('a user row with unknown text is a competing view', () => {
const local = [competingViewUserMessage('opt-old', 'deploy the schema')]
+
const refreshed = [
competingViewUserMessage('msg-10', 'deploy the schema', 10),
competingViewUserMessage('msg-12', 'typed in another window'),
@@ -225,20 +229,25 @@ describe('surplusIsCompetingView', () => {
it('user rows matching by rowId or id are known', () => {
const byRowId = [competingViewUserMessage('msg-10', 'deploy the schema', 10)]
- expect(surplusIsCompetingView(byRowId, [
- competingViewUserMessage('msg-10', 'deploy the schema', 10),
- competingViewAssistantMessage('msg-11', 'done', 11)
- ])).toBe(false)
+ expect(
+ surplusIsCompetingView(byRowId, [
+ competingViewUserMessage('msg-10', 'deploy the schema', 10),
+ competingViewAssistantMessage('msg-11', 'done', 11)
+ ])
+ ).toBe(false)
const byId = [competingViewUserMessage('msg-10', 'deploy the schema')]
- expect(surplusIsCompetingView(byId, [
- competingViewUserMessage('msg-10', 'deploy the schema'),
- competingViewAssistantMessage('msg-11', 'done')
- ])).toBe(false)
+ expect(
+ surplusIsCompetingView(byId, [
+ competingViewUserMessage('msg-10', 'deploy the schema'),
+ competingViewAssistantMessage('msg-11', 'done')
+ ])
+ ).toBe(false)
})
it('assistant/tool-only surplus is never a competing view', () => {
const local = [competingViewUserMessage('opt-old', 'deploy the schema')]
+
const refreshed = [
competingViewUserMessage('msg-10', 'deploy the schema', 10),
competingViewAssistantMessage('msg-11', 'running the command', 11),
diff --git a/apps/desktop/src/lib/stale-transcript-guard.ts b/apps/desktop/src/lib/stale-transcript-guard.ts
index 9d56dac447d..1669972345c 100644
--- a/apps/desktop/src/lib/stale-transcript-guard.ts
+++ b/apps/desktop/src/lib/stale-transcript-guard.ts
@@ -59,7 +59,8 @@ export function surplusIsCompetingView(
!matchedLocalUsers.has(index) &&
(local.id === message.id ||
(message.rowId !== undefined && local.rowId === message.rowId) ||
- (local.id === options?.optimisticMessageId && local.rowId === undefined &&
+ (local.id === options?.optimisticMessageId &&
+ local.rowId === undefined &&
chatMessageText(local) === chatMessageText(message)))
)
@@ -68,6 +69,7 @@ export function surplusIsCompetingView(
}
matchedLocalUsers.add(matchIndex)
+
return false
})
}
diff --git a/apps/desktop/src/plugins/hermes-bots/skills-hub-picker.test.tsx b/apps/desktop/src/plugins/hermes-bots/skills-hub-picker.test.tsx
index b4848fd200a..039a1f95cb3 100644
--- a/apps/desktop/src/plugins/hermes-bots/skills-hub-picker.test.tsx
+++ b/apps/desktop/src/plugins/hermes-bots/skills-hub-picker.test.tsx
@@ -120,6 +120,7 @@ describe('hub pick messages', () => {
vi.spyOn(AbortSignal, 'timeout').mockImplementation(ms => {
const controller = new AbortController()
setTimeout(() => controller.abort(new DOMException('Timed out', 'TimeoutError')), ms)
+
return controller.signal
})
vi.stubGlobal(
diff --git a/apps/desktop/src/store/dead-session-prune.test.ts b/apps/desktop/src/store/dead-session-prune.test.ts
index 7f364b8babc..b09a0ac84c5 100644
--- a/apps/desktop/src/store/dead-session-prune.test.ts
+++ b/apps/desktop/src/store/dead-session-prune.test.ts
@@ -26,7 +26,15 @@ const row = (id: string, extra: Partial<SessionInfo> = {}): SessionInfo =>
({ id, message_count: 1, source: 'cli', started_at: 0, title: id, ...extra }) as SessionInfo
const profile = (name: string): ProfileInfo =>
- ({ has_env: false, is_default: name === 'default', model: null, name, path: name, provider: null, skill_count: 0 }) as ProfileInfo
+ ({
+ has_env: false,
+ is_default: name === 'default',
+ model: null,
+ name,
+ path: name,
+ provider: null,
+ skill_count: 0
+ }) as ProfileInfo
const notFound = () => new Error('404: {"detail":"Session not found"}')
@@ -213,9 +221,12 @@ describe('__runDeadSessionPrunePass', () => {
$sessions.set([row('unrelated')])
$pinnedSessionIds.set(['race-pin'])
let resolveProbe!: (value: SessionInfo) => void
- getSessionMock.mockImplementation(() => new Promise(resolve => {
- resolveProbe = resolve
- }))
+ getSessionMock.mockImplementation(
+ () =>
+ new Promise(resolve => {
+ resolveProbe = resolve
+ })
+ )
const pass = __runDeadSessionPrunePass()
// Gateway switch while the probe is in flight.
diff --git a/apps/desktop/src/store/dead-session-prune.ts b/apps/desktop/src/store/dead-session-prune.ts
index 463bf8be688..e396b468a02 100644
--- a/apps/desktop/src/store/dead-session-prune.ts
+++ b/apps/desktop/src/store/dead-session-prune.ts
@@ -271,11 +271,14 @@ export function watchDeadSessionPrune(): () => void {
// Exactly one timer at a time: a churn that doesn't move the deadline
// keeps the existing timer instead of stacking a second one.
if (!sweepTimer) {
- sweepTimer = setTimeout(() => {
- sweepDueAt = 0
- sweepTimer = undefined
- void sweepOnce()
- }, Math.max(0, nextDueAt - Date.now()))
+ sweepTimer = setTimeout(
+ () => {
+ sweepDueAt = 0
+ sweepTimer = undefined
+ void sweepOnce()
+ },
+ Math.max(0, nextDueAt - Date.now())
+ )
}
})
}
diff --git a/apps/desktop/src/store/preview.ts b/apps/desktop/src/store/preview.ts
index 4d8f6bc9627..2c7af636086 100644
--- a/apps/desktop/src/store/preview.ts
+++ b/apps/desktop/src/store/preview.ts
@@ -135,15 +135,17 @@ export function decodePreviewTabs(raw: string): PreviewTab[] {
}
function parseTabList(parsed: unknown): PreviewTab[] {
- return (Array.isArray(parsed) ? parsed.filter(isPreviewTab) : [])
- .map(tab =>
- isPdfFileTarget(tab.target) && tab.target.previewKind === 'binary'
- ? { ...tab, target: { ...tab.target, previewKind: 'pdf' as const } }
- : tab
- )
- // Drop tombstoned file tabs (a previous session confirmed the file is
- // gone). Keeping them would re-probe a known-dead path on every boot.
- .filter(tab => !tab.target.missing)
+ return (
+ (Array.isArray(parsed) ? parsed.filter(isPreviewTab) : [])
+ .map(tab =>
+ isPdfFileTarget(tab.target) && tab.target.previewKind === 'binary'
+ ? { ...tab, target: { ...tab.target, previewKind: 'pdf' as const } }
+ : tab
+ )
+ // Drop tombstoned file tabs (a previous session confirmed the file is
+ // gone). Keeping them would re-probe a known-dead path on every boot.
+ .filter(tab => !tab.target.missing)
+ )
}
/** The tabs a profile's rail is showing, keyed by profile. */
@@ -648,9 +650,7 @@ export function markPreviewTabMissing(targetUrl: string) {
return
}
- $previewTabs.set(
- current.map((tab, i) => (i === index ? { ...tab, target: { ...tab.target, missing: true } } : tab))
- )
+ $previewTabs.set(current.map((tab, i) => (i === index ? { ...tab, target: { ...tab.target, missing: true } } : tab)))
}
/** Show the Browser — the surface, not a page. Keeps whatever it was last
diff --git a/apps/desktop/src/store/quick-entry.ts b/apps/desktop/src/store/quick-entry.ts
index cae2ef4c1ce..03838a9c253 100644
--- a/apps/desktop/src/store/quick-entry.ts
+++ b/apps/desktop/src/store/quick-entry.ts
@@ -524,6 +524,7 @@ export function initQuickEntryBridge(): () => void {
if (payload && typeof raw === 'object' && raw !== null) {
const correlationId = (raw as unknown as Record<string, unknown>).correlationId
+
if (typeof correlationId === 'string') {
submitHandler?.({ ...payload, correlationId })
}
diff --git a/apps/desktop/src/store/reactions.test.ts b/apps/desktop/src/store/reactions.test.ts
index 32e37c936c0..cbba47aa9e2 100644
--- a/apps/desktop/src/store/reactions.test.ts
+++ b/apps/desktop/src/store/reactions.test.ts
@@ -13,6 +13,7 @@ const reactionTestState = vi.hoisted(() => {
}
}
}
+
const gateway = { request: vi.fn(async (..._args: any[]) => ({ row_id: 7, reactions: [] })) }
return {
diff --git a/apps/desktop/src/store/reactions.ts b/apps/desktop/src/store/reactions.ts
index c63c1f76756..6bb8bcf2583 100644
--- a/apps/desktop/src/store/reactions.ts
+++ b/apps/desktop/src/store/reactions.ts
@@ -60,6 +60,7 @@ export async function toggleMessageReaction(
// in any active conversation), let the backend resolve the newest row of
// this role — which is exactly the message being reacted to.
const rowId = message.rowId
+
// The runtime id is unavailable while a stored conversation is being
// resumed (and can briefly be cleared during a profile/context switch), but
// the mounted transcript is still owned by the selected stored session.
@@ -67,6 +68,7 @@ export async function toggleMessageReaction(
// visible conversation as a draft. A genuinely new draft has neither id.
const sessionId =
sessionIdOverride === undefined ? ($activeSessionId.get() ?? $selectedStoredSessionId.get()) : sessionIdOverride
+
const gateway = $gateway.get()
if (!sessionId || !gateway) {
diff --git a/apps/desktop/src/store/session-sidebar-focus.test.ts b/apps/desktop/src/store/session-sidebar-focus.test.ts
index 960a904c30a..a5df99e7c55 100644
--- a/apps/desktop/src/store/session-sidebar-focus.test.ts
+++ b/apps/desktop/src/store/session-sidebar-focus.test.ts
@@ -69,9 +69,7 @@ describe('session focus while interacting with the sidebar', () => {
it('keeps the remembered chat while Files or Terminal own focus', () => {
const tree = $layoutTree.get()!
- $layoutTree.set(
- split('row', [tree, group(['files', 'terminal'], { active: 'files', id: 'tools' })])
- )
+ $layoutTree.set(split('row', [tree, group(['files', 'terminal'], { active: 'files', id: 'tools' })]))
const tools = target('tools')
target('split').focus()
diff --git a/apps/desktop/src/store/session-states.test.ts b/apps/desktop/src/store/session-states.test.ts
index 58a9bbc7aa9..23d752a53ae 100644
--- a/apps/desktop/src/store/session-states.test.ts
+++ b/apps/desktop/src/store/session-states.test.ts
@@ -1245,9 +1245,7 @@ describe('$focusedStoredSessionId in Bot Mode (#96062)', () => {
it('computes $focusedWorkspaceCwd from the focused tile session state or sessions list', () => {
$selectedStoredSessionId.set('primary-1')
setSessions([{ cwd: '/repo-stacked', id: 'stacked' } as any])
- $sessionTiles.set([
- { storedSessionId: 'stacked', runtimeId: 'rt-stacked', workspaceMode: 'sessions' } as any
- ])
+ $sessionTiles.set([{ storedSessionId: 'stacked', runtimeId: 'rt-stacked', workspaceMode: 'sessions' } as any])
$sessionStates.set({
'rt-stacked': { cwd: '/repo-stacked' } as any
})
@@ -1270,11 +1268,7 @@ describe('$focusedStoredSessionId in Bot Mode (#96062)', () => {
setSessions([{ cwd: '/repo-primary-project', id: 'primary-1' } as any])
$sessionTiles.set([])
$sessionStates.set({})
- $layoutTree.set(
- split('row', [
- group(['workspace'], { active: 'workspace', id: 'grp-main' })
- ])
- )
+ $layoutTree.set(split('row', [group(['workspace'], { active: 'workspace', id: 'grp-main' })]))
noteActiveTreeGroup('grp-main')
expect($focusedStoredSessionId.get()).toBe('primary-1')
diff --git a/apps/desktop/src/store/session-states.ts b/apps/desktop/src/store/session-states.ts
index 6ec953cdcdc..b487a46e8bc 100644
--- a/apps/desktop/src/store/session-states.ts
+++ b/apps/desktop/src/store/session-states.ts
@@ -3071,15 +3071,15 @@ export const $focusedSessionState = computed([$focusedRuntimeId, $sessionStates]
/** The workspace CWD of the currently focused session (the focused tile's cwd,
* else the primary session's confirmed workspace cwd, with fallback to historical session cwd). */
export const $focusedWorkspaceCwd = computed(
- [
- $focusedStoredSessionId,
- $selectedStoredSessionId,
- $focusedSessionState,
- $sessions,
- $currentCwd,
- $workspaceCwdOwner
- ],
- (focusedStoredId, selectedStoredId, focusedSessionState, sessions: readonly SessionInfo[], currentCwd, workspaceCwdOwner) => {
+ [$focusedStoredSessionId, $selectedStoredSessionId, $focusedSessionState, $sessions, $currentCwd, $workspaceCwdOwner],
+ (
+ focusedStoredId,
+ selectedStoredId,
+ focusedSessionState,
+ sessions: readonly SessionInfo[],
+ currentCwd,
+ workspaceCwdOwner
+ ) => {
const isTile = Boolean(focusedStoredId && focusedStoredId !== selectedStoredId)
if (isTile && focusedStoredId) {
diff --git a/apps/desktop/src/store/subagents.test.ts b/apps/desktop/src/store/subagents.test.ts
index 20ecd19f8dc..4ebeac2cfa8 100644
--- a/apps/desktop/src/store/subagents.test.ts
+++ b/apps/desktop/src/store/subagents.test.ts
@@ -212,6 +212,7 @@ describe('subagent store', () => {
const active = 's1'
const panel = subagentsForPanel($subagentsBySession.get(), active)
const indicatorRunning = Object.values($subagentsBySession.get()).reduce((n, l) => n + activeSubagentCount(l), 0)
+
const indicatorFailed = Object.entries($subagentsBySession.get())
.filter(([sid]) => sid === active)
.reduce((n, [, l]) => n + failedSubagentCount(l), 0)
diff --git a/apps/desktop/src/store/subagents.ts b/apps/desktop/src/store/subagents.ts
index d1915d6f78b..9ae2d4c38ca 100644
--- a/apps/desktop/src/store/subagents.ts
+++ b/apps/desktop/src/store/subagents.ts
@@ -399,7 +399,15 @@ export function upsertSubagent(sid: string, payload: SubagentPayload, createIfMi
// Statuses that end a subagent run. The store's asStatus normalizes the last
// three to failed/interrupted, so the event path treats them as terminal too.
-const SUBAGENT_TERMINAL_STATUSES = new Set(['completed', 'failed', 'interrupted', 'timeout', 'error', 'cancelled', 'canceled'])
+const SUBAGENT_TERMINAL_STATUSES = new Set([
+ 'completed',
+ 'failed',
+ 'interrupted',
+ 'timeout',
+ 'error',
+ 'cancelled',
+ 'canceled'
+])
/** True only for a `subagent.complete` carrying a status that ends the run —
* the one event the interrupted-session guard in the message-stream must let