Skip to content

The agent that grows with you

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

hermes-seaeye[bot]bb4765d21ce0
diff --git a/apps/desktop/electron/backend-env.test.ts b/apps/desktop/electron/backend-env.test.ts
index c42595a8247..a92ce6e062e 100644
--- a/apps/desktop/electron/backend-env.test.ts
+++ b/apps/desktop/electron/backend-env.test.ts
@@ -75,6 +75,7 @@ test('buildDesktopBackendEnv forces PYTHONUTF8 unless the user set it explicitly
platform: 'darwin',
pathModule: path.posix
})
+
assert.equal(defaulted.PYTHONUTF8, '1')
const optedOut = buildDesktopBackendEnv({
@@ -83,6 +84,7 @@ test('buildDesktopBackendEnv forces PYTHONUTF8 unless the user set it explicitly
platform: 'darwin',
pathModule: path.posix
})
+
assert.equal(optedOut.PYTHONUTF8, '0')
})
diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts
index 573f867ff45..98762242871 100644
--- a/apps/desktop/electron/main.ts
+++ b/apps/desktop/electron/main.ts
@@ -2985,6 +2985,7 @@ function preflightStateDb(hermesHome, rememberLog) {
if (!fileExists(stateDbPath)) {
rememberLog('[updates] state.db pre-flight: not found (fresh install?)')
+
return
}
@@ -3015,23 +3016,19 @@ function preflightStateDb(hermesHome, rememberLog) {
// Emergency timestamped backup, separate from the Python-level snapshot.
const ts = new Date().toISOString().replace(/[:.]/g, '-')
- const emergencyPath = path.join(
- hermesHome,
- `state.db.pre-update-emergency-${ts}.bak`
- )
+
+ const emergencyPath = path.join(hermesHome, `state.db.pre-update-emergency-${ts}.bak`)
try {
fs.copyFileSync(stateDbPath, emergencyPath)
const emergStat = fs.statSync(emergencyPath)
- rememberLog(
- `[updates] emergency state.db backup: ${emergencyPath} ` +
- `(${emergStat.size} bytes)`
- )
+ rememberLog(`[updates] emergency state.db backup: ${emergencyPath} ` + `(${emergStat.size} bytes)`)
// Prune to the 2 most recent emergency backups.
try {
const homeDir = fs.readdirSync(hermesHome)
+
const backups = homeDir
.filter(
f =>
@@ -3053,19 +3050,13 @@ function preflightStateDb(hermesHome, rememberLog) {
void 0
}
} catch (copyErr) {
- rememberLog(
- `[updates] emergency state.db backup failed: ${copyErr.message}`
- )
+ rememberLog(`[updates] emergency state.db backup failed: ${copyErr.message}`)
}
} else {
- rememberLog(
- `[updates] state.db too small (${stat.size} bytes) for a valid SQLite database`
- )
+ rememberLog(`[updates] state.db too small (${stat.size} bytes) for a valid SQLite database`)
}
} catch (statErr) {
- rememberLog(
- `[updates] could not stat state.db before update: ${statErr.message}`
- )
+ rememberLog(`[updates] could not stat state.db before update: ${statErr.message}`)
}
}
@@ -3083,6 +3074,7 @@ async function applyUpdatesPosixInApp(opts: any) {
if (!hermes) {
emitUpdateProgress({ stage: 'manual', message: 'hermes update', percent: null })
+
return { ok: true, manual: true, command: 'hermes update', hermesRoot: updateRoot }
}
diff --git a/apps/desktop/src/app/chat/composer/hooks/use-composer-draft.test.tsx b/apps/desktop/src/app/chat/composer/hooks/use-composer-draft.test.tsx
index 18f8e454237..81401482f69 100644
--- a/apps/desktop/src/app/chat/composer/hooks/use-composer-draft.test.tsx
+++ b/apps/desktop/src/app/chat/composer/hooks/use-composer-draft.test.tsx
@@ -12,8 +12,7 @@ const mockComposerApi = { setText: vi.fn() }
vi.mock('@assistant-ui/react', () => ({
useAui: () => ({ composer: () => mockComposerApi }),
- useAuiState: (selector: (state: { composer: { text: string } }) => unknown) =>
- selector({ composer: { text: '' } }),
+ useAuiState: (selector: (state: { composer: { text: string } }) => unknown) => selector({ composer: { text: '' } }),
useComposerRuntime: () => ({
getState: () => ({ text: '' }),
subscribe: () => () => undefined
@@ -60,11 +59,7 @@ describe('useComposerDraft — attachment scope stays coherent with the committe
const snapshots: ComposerAttachment[][] = []
const { rerender } = render(
- <ProbeHarness
- activeQueueSessionKey="session-A"
- onLayoutSnapshot={s => snapshots.push(s)}
- sessionId="session-A"
- />
+ <ProbeHarness activeQueueSessionKey="session-A" onLayoutSnapshot={s => snapshots.push(s)} sessionId="session-A" />
)
// Mount loads session A's stashed attachment into the (module-level) main
@@ -98,18 +93,24 @@ describe('useComposerDraft — rehydrate diagnostic log stays redacted', () => {
it('logs counts/kinds/scope on restore but never the raw url, refText, or label', () => {
const secretUrl = 'https://secret.example.com/private-workspace-path'
+
const attachment: ComposerAttachment = {
id: 'url-secret',
kind: 'url',
label: 'do-not-leak-label',
refText: `@url:${secretUrl}`
}
+
stashSessionDraft('session-secret', '', [attachment])
const debugSpy = vi.spyOn(console, 'debug').mockImplementation(() => undefined)
render(
- <ProbeHarness activeQueueSessionKey="session-secret" onLayoutSnapshot={() => undefined} sessionId="session-secret" />
+ <ProbeHarness
+ activeQueueSessionKey="session-secret"
+ onLayoutSnapshot={() => undefined}
+ sessionId="session-secret"
+ />
)
const rehydrateCalls = debugSpy.mock.calls.filter(call => call[0] === '[composer-rehydrate]')
diff --git a/apps/desktop/src/app/session/hooks/use-session-state-cache.ts b/apps/desktop/src/app/session/hooks/use-session-state-cache.ts
index 0f93d02a799..2e732cb5925 100644
--- a/apps/desktop/src/app/session/hooks/use-session-state-cache.ts
+++ b/apps/desktop/src/app/session/hooks/use-session-state-cache.ts
@@ -77,6 +77,7 @@ export function useSessionStateCache({
selectedStoredSessionIdPropRef.current = selectedStoredSessionId
selectedStoredSessionIdRef.current = selectedStoredSessionId
}
+
const sessionStateByRuntimeIdRef = useRef(new Map<string, ClientSessionState>())
const runtimeIdByStoredSessionIdRef = useRef(new Map<string, string>())
const pendingViewStateRef = useRef<{ sessionId: string; state: ClientSessionState } | null>(null)