Skip to content

The agent that grows with you

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

hermes-seaeye[bot]01512ca00013
diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts
index b66faf6b821..9501ff6a902 100644
--- a/apps/desktop/electron/main.ts
+++ b/apps/desktop/electron/main.ts
@@ -37,11 +37,7 @@ import { dashboardFallbackArgs, sourceDeclaresServe } from './backend-command'
import { createBackendConnectionState } from './backend-connection-state'
import { buildDesktopBackendEnv, hermesManagedNodePathEntries, normalizeHermesHomeRoot } from './backend-env'
import { isReauthRequiredError, waitForHermesReady } from './backend-health'
-import {
- backendCommandMatches,
- createBackendOwnership,
- createBackendShutdownCoordinator
-} from './backend-ownership'
+import { backendCommandMatches, createBackendOwnership, createBackendShutdownCoordinator } from './backend-ownership'
import {
canImportHermesCli,
execProbeSync,
@@ -2927,7 +2923,10 @@ function execText(command, args) {
async function processStartMarker(pid) {
if (process.platform === 'linux') {
const stat = await fs.promises.readFile(`/proc/${pid}/stat`, 'utf8')
- const fields = stat.slice(stat.lastIndexOf(')') + 1).trim().split(/\s+/)
+ const fields = stat
+ .slice(stat.lastIndexOf(')') + 1)
+ .trim()
+ .split(/\s+/)
if (!/^\d+$/.test(fields[19] || '')) {
throw new Error(`Invalid /proc start marker for PID ${pid}`)
@@ -2965,7 +2964,12 @@ async function backendCommandForPid(pid) {
const command = IS_WINDOWS ? 'powershell.exe' : 'ps'
const args = IS_WINDOWS
- ? ['-NoProfile', '-NonInteractive', '-Command', `(Get-CimInstance Win32_Process -Filter 'ProcessId = ${pid}').CommandLine`]
+ ? [
+ '-NoProfile',
+ '-NonInteractive',
+ '-Command',
+ `(Get-CimInstance Win32_Process -Filter 'ProcessId = ${pid}').CommandLine`
+ ]
: ['-p', String(pid), '-o', 'command=']
return (await execText(command, args)) || null
diff --git a/apps/desktop/src/app/chat/session-tile-actions.ts b/apps/desktop/src/app/chat/session-tile-actions.ts
index b991bf596f4..c4c6ae02862 100644
--- a/apps/desktop/src/app/chat/session-tile-actions.ts
+++ b/apps/desktop/src/app/chat/session-tile-actions.ts
@@ -472,7 +472,13 @@ export function useSessionTileActions({ runtimeId, scope, storedSessionId }: Ses
try {
applySurvivorRowIds(
- await submitRewind(plan.text, plan.truncateOrdinal, interruptFirst, plan.truncateMessageId, plan.truncateRowId)
+ await submitRewind(
+ plan.text,
+ plan.truncateOrdinal,
+ interruptFirst,
+ plan.truncateMessageId,
+ plan.truncateRowId
+ )
)
} catch (err) {
update(state => ({ ...state, busy: false, awaitingResponse: false, messages }))
@@ -506,7 +512,13 @@ export function useSessionTileActions({ runtimeId, scope, storedSessionId }: Ses
try {
applySurvivorRowIds(
- await submitRewind(plan.text, plan.truncateOrdinal, interruptFirst, plan.truncateMessageId, plan.truncateRowId)
+ await submitRewind(
+ plan.text,
+ plan.truncateOrdinal,
+ interruptFirst,
+ plan.truncateMessageId,
+ plan.truncateRowId
+ )
)
} catch (err) {
update(state => ({ ...state, busy: false, awaitingResponse: false, messages }))
diff --git a/apps/desktop/src/app/contrib/surfaces.test.tsx b/apps/desktop/src/app/contrib/surfaces.test.tsx
index 274da802683..472bf8cbeae 100644
--- a/apps/desktop/src/app/contrib/surfaces.test.tsx
+++ b/apps/desktop/src/app/contrib/surfaces.test.tsx
@@ -23,7 +23,9 @@ vi.mock('../chat', () => ({
vi.mock('../chat/sidebar', () => ({ ChatSidebar: () => null }))
vi.mock('../right-sidebar/terminal/chrome', () => ({ TerminalPaneChrome: () => null }))
vi.mock('../shell/hooks/use-status-snapshot', () => ({ useStatusSnapshot: () => ({}) }))
-vi.mock('../shell/hooks/use-statusbar-items', () => ({ useStatusbarItems: () => ({ leftStatusbarItems: [], statusbarItems: [] }) }))
+vi.mock('../shell/hooks/use-statusbar-items', () => ({
+ useStatusbarItems: () => ({ leftStatusbarItems: [], statusbarItems: [] })
+}))
vi.mock('../shell/statusbar-controls', () => ({ StatusbarControls: () => null }))
vi.mock('../routes', () => ({
contributedRoutes: () => [],
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 baaffd47875..765a26f05ca 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
@@ -147,13 +147,13 @@ function Harness({
const defaultStoredSessionId = storedSessionId === undefined ? RUNTIME_SESSION_ID : storedSessionId
const defaultRuntimeSessionId = activeSessionId === undefined ? RUNTIME_SESSION_ID : activeSessionId
- const runtimeIdByStoredSessionIdRef: MutableRefObject<Map<string, string>> =
- runtimeIdByStoredSessionIdRefProp ?? {
- current:
- defaultStoredSessionId && defaultRuntimeSessionId
- ? new Map([[defaultStoredSessionId, defaultRuntimeSessionId]])
- : new Map()
- }
+
+ const runtimeIdByStoredSessionIdRef: MutableRefObject<Map<string, string>> = runtimeIdByStoredSessionIdRefProp ?? {
+ current:
+ defaultStoredSessionId && defaultRuntimeSessionId
+ ? new Map([[defaultStoredSessionId, defaultRuntimeSessionId]])
+ : new Map()
+ }
const localBusyRef = busyRef ?? { current: false }
@@ -4372,9 +4372,7 @@ describe('usePromptActions submit entry-time runtime ownership proof (#64789/#65
session_id: STORED_SESSION_B,
source: 'desktop'
})
- expect(
- calls.find(c => c.method === 'prompt.submit' && c.params?.session_id === RUNTIME_SESSION_A)
- ).toBeUndefined()
+ expect(calls.find(c => c.method === 'prompt.submit' && c.params?.session_id === RUNTIME_SESSION_A)).toBeUndefined()
expect(
calls.find(c => c.method === 'prompt.submit' && c.params?.session_id === RUNTIME_SESSION_B_RESUMED)
).toBeDefined()
@@ -4429,9 +4427,7 @@ describe('usePromptActions submit entry-time runtime ownership proof (#64789/#65
session_id: STORED_SESSION_B,
source: 'desktop'
})
- expect(
- calls.find(c => c.method === 'prompt.submit' && c.params?.session_id === RUNTIME_SESSION_A)
- ).toBeUndefined()
+ expect(calls.find(c => c.method === 'prompt.submit' && c.params?.session_id === RUNTIME_SESSION_A)).toBeUndefined()
expect(
calls.find(c => c.method === 'prompt.submit' && c.params?.session_id === RUNTIME_SESSION_B_RESUMED)
).toBeDefined()
@@ -4444,6 +4440,7 @@ describe('usePromptActions submit entry-time runtime ownership proof (#64789/#65
const selectedStoredSessionIdRef: MutableRefObject<string | null> = { current: STORED_SESSION_B }
const activeSessionIdRef: MutableRefObject<string | null> = { current: RUNTIME_SESSION_A }
+
const runtimeIdByStoredSessionIdRef: MutableRefObject<Map<string, string>> = {
current: new Map([[STORED_SESSION_B, RUNTIME_SESSION_A]])
}
@@ -4472,9 +4469,7 @@ describe('usePromptActions submit entry-time runtime ownership proof (#64789/#65
await handle!.submitText('first message in a genuinely fresh session')
expect(calls.some(c => c.method === 'session.resume')).toBe(false)
- expect(
- calls.find(c => c.method === 'prompt.submit' && c.params?.session_id === RUNTIME_SESSION_A)
- ).toBeDefined()
+ expect(calls.find(c => c.method === 'prompt.submit' && c.params?.session_id === RUNTIME_SESSION_A)).toBeDefined()
})
it('resumes the selected session when its ownership cache entry is missing', async () => {
@@ -4514,9 +4509,7 @@ describe('usePromptActions submit entry-time runtime ownership proof (#64789/#65
session_id: STORED_SESSION_B,
source: 'desktop'
})
- expect(
- calls.find(c => c.method === 'prompt.submit' && c.params?.session_id === RUNTIME_SESSION_A)
- ).toBeUndefined()
+ expect(calls.find(c => c.method === 'prompt.submit' && c.params?.session_id === RUNTIME_SESSION_A)).toBeUndefined()
expect(
calls.find(c => c.method === 'prompt.submit' && c.params?.session_id === RUNTIME_SESSION_B_RESUMED)
).toBeDefined()
diff --git a/apps/desktop/src/app/session/hooks/use-prompt-actions/rewind.test.ts b/apps/desktop/src/app/session/hooks/use-prompt-actions/rewind.test.ts
index ebe6ca7528e..2b8f99ff293 100644
--- a/apps/desktop/src/app/session/hooks/use-prompt-actions/rewind.test.ts
+++ b/apps/desktop/src/app/session/hooks/use-prompt-actions/rewind.test.ts
@@ -53,7 +53,13 @@ describe('appendMidTurnUserMessage', () => {
const next = appendMidTurnUserMessage(state, row('user-3', 'user', 'mid-turn note'))
- expect(next.messages.map(message => message.id)).toEqual(['user-1', 'assistant-1', 'user-2', 'assistant-2', 'user-3'])
+ expect(next.messages.map(message => message.id)).toEqual([
+ 'user-1',
+ 'assistant-1',
+ 'user-2',
+ 'assistant-2',
+ 'user-3'
+ ])
expect(next.messages.at(-1)?.id).toBe('user-3')
expect(next.interimBoundaryPending).toBe(false)
})
diff --git a/apps/desktop/src/app/session/hooks/use-prompt-actions/utils.ts b/apps/desktop/src/app/session/hooks/use-prompt-actions/utils.ts
index 77227229e52..88880fdc8c8 100644
--- a/apps/desktop/src/app/session/hooks/use-prompt-actions/utils.ts
+++ b/apps/desktop/src/app/session/hooks/use-prompt-actions/utils.ts
@@ -302,11 +302,7 @@ export function clearSessionRecentlyInterrupted(sessionId?: string): void {
}
/** Whether a rewind/edit should interrupt before submit — busy OR recent Stop. */
-export function shouldInterruptBeforeRewind(opts: {
- busy: boolean
- sessionId: string
- now?: number
-}): boolean {
+export function shouldInterruptBeforeRewind(opts: { busy: boolean; sessionId: string; now?: number }): boolean {
return opts.busy || isSessionRecentlyInterrupted(opts.sessionId, opts.now)
}
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 5b4aeb3ce5b..e11adefdba9 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
@@ -857,7 +857,11 @@ export function useSessionActions({
// wipes the just-restored activate/cache transcript (the same
// wipe the `activated.messages.length || ...` guard above
// already prevents for the activate payload itself).
- if (persisted && persistedMatchesActivatedSession && (persisted.messages.length || !activatedMessages.length)) {
+ if (
+ persisted &&
+ persistedMatchesActivatedSession &&
+ (persisted.messages.length || !activatedMessages.length)
+ ) {
activatedMessages = reconcileAuthoritativeMessages(persisted.messages, activatedMessages)
}
}
diff --git a/apps/desktop/src/app/session/hooks/use-session-actions/utils.ts b/apps/desktop/src/app/session/hooks/use-session-actions/utils.ts
index 1a510c778cd..db6132c556f 100644
--- a/apps/desktop/src/app/session/hooks/use-session-actions/utils.ts
+++ b/apps/desktop/src/app/session/hooks/use-session-actions/utils.ts
@@ -637,10 +637,7 @@ export function preserveLocalPendingTurnMessages(
candidate.role === 'assistant' &&
!isLiveTailRow(candidate) &&
(textWithoutReferenceLines(chatMessageText(candidate)) === nextText ||
- isStrictAnswerTextExtension(
- textWithoutReferenceLines(chatMessageText(candidate)),
- nextText
- ))
+ isStrictAnswerTextExtension(textWithoutReferenceLines(chatMessageText(candidate)), nextText))
)
if (committedMatch) {
@@ -651,10 +648,7 @@ export function preserveLocalPendingTurnMessages(
candidate =>
candidate.role === 'assistant' &&
!isLiveTailRow(candidate) &&
- isStrictAnswerTextExtension(
- nextText,
- textWithoutReferenceLines(chatMessageText(candidate))
- )
+ isStrictAnswerTextExtension(nextText, textWithoutReferenceLines(chatMessageText(candidate)))
)
if (committedPrefix) {
diff --git a/apps/desktop/src/components/chat/status-section.tsx b/apps/desktop/src/components/chat/status-section.tsx
index ab9c1180503..bdbead9b33a 100644
--- a/apps/desktop/src/components/chat/status-section.tsx
+++ b/apps/desktop/src/components/chat/status-section.tsx
@@ -42,9 +42,7 @@ export function StatusSection({
<DisclosureCaret className="shrink-0" open={!collapsed} size="1em" />
{icon && <span className="flex shrink-0 items-center">{icon}</span>}
<span className="min-w-0 truncate">{label}</span>
- {collapsed && collapsedIndicator && (
- <span className="flex shrink-0 items-center">{collapsedIndicator}</span>
- )}
+ {collapsed && collapsedIndicator && <span className="flex shrink-0 items-center">{collapsedIndicator}</span>}
</button>
{accessory && <div className="flex shrink-0 items-center gap-1">{accessory}</div>}
</div>
diff --git a/apps/desktop/src/components/pane-shell/pane-lifecycle.ts b/apps/desktop/src/components/pane-shell/pane-lifecycle.ts
index edac97d3dc5..6e537854e00 100644
--- a/apps/desktop/src/components/pane-shell/pane-lifecycle.ts
+++ b/apps/desktop/src/components/pane-shell/pane-lifecycle.ts
@@ -31,7 +31,12 @@ interface ReconcilePaneLifecycleOptions {
*/
export function reconcilePaneLifecycle(
previous: PaneLifecycleState,
- { activeId, hotHiddenCap = DEFAULT_HOT_HIDDEN_PANE_CAP, keepAlive = () => false, paneIds }: ReconcilePaneLifecycleOptions
+ {
+ activeId,
+ hotHiddenCap = DEFAULT_HOT_HIDDEN_PANE_CAP,
+ keepAlive = () => false,
+ paneIds
+ }: ReconcilePaneLifecycleOptions
): PaneLifecycleState {
const present = new Set(paneIds)
const entries: Record<string, PaneLifecycleEntry> = {}
diff --git a/apps/desktop/src/lib/renderer-loop-pause.test.ts b/apps/desktop/src/lib/renderer-loop-pause.test.ts
index c6fe0e91de3..46563c627a4 100644
--- a/apps/desktop/src/lib/renderer-loop-pause.test.ts
+++ b/apps/desktop/src/lib/renderer-loop-pause.test.ts
@@ -1,9 +1,6 @@
import { afterEach, describe, expect, it, vi } from 'vitest'
-import {
- installRendererAnimationPauseState,
- RENDERER_ANIMATIONS_PAUSED_ATTRIBUTE
-} from './renderer-loop-pause'
+import { installRendererAnimationPauseState, RENDERER_ANIMATIONS_PAUSED_ATTRIBUTE } from './renderer-loop-pause'
describe('installRendererAnimationPauseState', () => {
afterEach(() => {
diff --git a/apps/desktop/src/store/gateway-shared-remote.test.ts b/apps/desktop/src/store/gateway-shared-remote.test.ts
index c74b312a101..7d3d33c5016 100644
--- a/apps/desktop/src/store/gateway-shared-remote.test.ts
+++ b/apps/desktop/src/store/gateway-shared-remote.test.ts
@@ -127,9 +127,7 @@ describe('ensureGatewayForProfile under a shared global remote', () => {
setPrimaryGateway(makePrimary() as never, 'default')
installDesktop({ getConnection })
- gatewayMocks.connect
- .mockRejectedValueOnce(new Error('temporarily offline'))
- .mockResolvedValueOnce(undefined)
+ gatewayMocks.connect.mockRejectedValueOnce(new Error('temporarily offline')).mockResolvedValueOnce(undefined)
await ensureGatewayForProfile('worker')
diff --git a/apps/desktop/src/store/prompts.ts b/apps/desktop/src/store/prompts.ts
index 35f95455bcb..c70a0965cb5 100644
--- a/apps/desktop/src/store/prompts.ts
+++ b/apps/desktop/src/store/prompts.ts
@@ -135,7 +135,8 @@ export async function replayPendingApproval(gateway: ApprovalGateway | null, ses
session_id: sessionId
})
- const result = rawResult && typeof rawResult === 'object' ? (rawResult as { approvals?: PendingApprovalPayload[] }) : {}
+ const result =
+ rawResult && typeof rawResult === 'object' ? (rawResult as { approvals?: PendingApprovalPayload[] }) : {}
const pending = Array.isArray(result?.approvals) ? result.approvals[0] : undefined
if (!pending || typeof pending.request_id !== 'string') {
diff --git a/apps/desktop/src/store/subagents.test.ts b/apps/desktop/src/store/subagents.test.ts
index 4922376ecc0..74a604a026c 100644
--- a/apps/desktop/src/store/subagents.test.ts
+++ b/apps/desktop/src/store/subagents.test.ts
@@ -202,8 +202,18 @@ describe('subagent store', () => {
upsertSubagent('s1', { goal: 'd', status: 'running', subagent_id: 'd', task_index: 3 })
// Emit terminal events with backend-native status strings
- upsertSubagent('s1', { status: 'timeout', subagent_id: 'a', task_index: 0, summary: 'timed out' }, false, 'subagent.complete')
- upsertSubagent('s1', { status: 'error', subagent_id: 'b', task_index: 1, summary: 'errored' }, false, 'subagent.complete')
+ upsertSubagent(
+ 's1',
+ { status: 'timeout', subagent_id: 'a', task_index: 0, summary: 'timed out' },
+ false,
+ 'subagent.complete'
+ )
+ upsertSubagent(
+ 's1',
+ { status: 'error', subagent_id: 'b', task_index: 1, summary: 'errored' },
+ false,
+ 'subagent.complete'
+ )
upsertSubagent('s1', { status: 'cancelled', subagent_id: 'c', task_index: 2 }, false, 'subagent.complete')
upsertSubagent('s1', { status: 'canceled', subagent_id: 'd', task_index: 3 }, false, 'subagent.complete')
@@ -291,7 +301,13 @@ describe('subagent store', () => {
status => {
upsertSubagent(
's1',
- { goal: 'inconsistent completion', status: 'running', subagent_id: 'ic1', task_index: 0, tool_name: 'search_files' },
+ {
+ goal: 'inconsistent completion',
+ status: 'running',
+ subagent_id: 'ic1',
+ task_index: 0,
+ tool_name: 'search_files'
+ },
true,
'subagent.start'
)