Skip to content

The agent that grows with you

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

hermes-seaeye[bot]aae6c2044e35
diff --git a/apps/desktop/electron/backend-discovery.test.ts b/apps/desktop/electron/backend-discovery.test.ts
index fb3bf961dd1..395c4cf9488 100644
--- a/apps/desktop/electron/backend-discovery.test.ts
+++ b/apps/desktop/electron/backend-discovery.test.ts
@@ -152,22 +152,19 @@ test('a relaunch adopts a backend that published a session token instead of spaw
const setup = await runPrimaryBackendStartup({
assertCurrentAttempt: () => {},
attachHostBackend: () =>
- attachToHostBackend(
- { isolated: false, ledgerPath: '/ledger.json' },
- {
- ...attachDeps(LEDGER),
- log: message => {
- logs.push(message)
- },
- probeWebSocket: async wsUrl => {
- assert.match(wsUrl, /token=published-session-token/)
-
- return { ok: true }
- },
- publishedTokenFor: () => token,
- resolveServedToken: async () => null
- } as Parameters<typeof attachToHostBackend>[1]
- ),
+ attachToHostBackend({ isolated: false, ledgerPath: '/ledger.json' }, {
+ ...attachDeps(LEDGER),
+ log: message => {
+ logs.push(message)
+ },
+ probeWebSocket: async wsUrl => {
+ assert.match(wsUrl, /token=published-session-token/)
+
+ return { ok: true }
+ },
+ publishedTokenFor: () => token,
+ resolveServedToken: async () => null
+ } as Parameters<typeof attachToHostBackend>[1]),
connectRemote: async () => ({ mode: 'remote' }),
ensureLocalRuntime: async backend => backend,
prepareLocalBackend: () => {
@@ -192,19 +189,16 @@ test('a relaunch adopts a backend that published a session token instead of spaw
test('a published token the websocket rejects is not adopted', async () => {
let probed = 0
- const attached = await attachToHostBackend(
- { isolated: false, ledgerPath: '/ledger.json' },
- {
- ...attachDeps(LEDGER),
- probeWebSocket: async () => {
- probed += 1
-
- return { ok: false, reason: 'unauthorized' }
- },
- publishedTokenFor: () => 'published-session-token',
- resolveServedToken: async () => null
- } as Parameters<typeof attachToHostBackend>[1]
- )
+ const attached = await attachToHostBackend({ isolated: false, ledgerPath: '/ledger.json' }, {
+ ...attachDeps(LEDGER),
+ probeWebSocket: async () => {
+ probed += 1
+
+ return { ok: false, reason: 'unauthorized' }
+ },
+ publishedTokenFor: () => 'published-session-token',
+ resolveServedToken: async () => null
+ } as Parameters<typeof attachToHostBackend>[1])
assert.equal(attached, null)
assert.equal(probed, 1)
diff --git a/apps/desktop/electron/backend-start-failure.ts b/apps/desktop/electron/backend-start-failure.ts
index 873837ed1df..58441409e7a 100644
--- a/apps/desktop/electron/backend-start-failure.ts
+++ b/apps/desktop/electron/backend-start-failure.ts
@@ -138,7 +138,9 @@ export function isSshAuthFailedBootFailure(error: unknown): boolean {
const message = error instanceof Error ? error.message : String(error ?? '')
- return /SSH authentication to .+ failed|Permission denied \((?:publickey|password|keyboard-interactive)/i.test(message)
+ return /SSH authentication to .+ failed|Permission denied \((?:publickey|password|keyboard-interactive)/i.test(
+ message
+ )
}
/**
@@ -183,7 +185,10 @@ export function shouldLatchHostKeyChangedFailure(context: RemoteBootRetryContext
*/
export function isRetryableRemoteBootFailure(context: RemoteBootRetryContext): boolean {
return (
- context.attemptedRemote && !context.isReauth && context.isHostKeyChanged !== true && context.isSshAuthFailed !== true
+ context.attemptedRemote &&
+ !context.isReauth &&
+ context.isHostKeyChanged !== true &&
+ context.isSshAuthFailed !== true
)
}
diff --git a/apps/desktop/electron/channel-build-version.test.ts b/apps/desktop/electron/channel-build-version.test.ts
index 01e17eee381..7f5160f8985 100644
--- a/apps/desktop/electron/channel-build-version.test.ts
+++ b/apps/desktop/electron/channel-build-version.test.ts
@@ -352,6 +352,7 @@ test('actual MSIX manifest writer consumes the channel quad across rollover inst
for (const tree of ['pm', 'scripts/releases']) {
fs.cpSync(path.join(repo, tree), path.join(root, tree), { recursive: true })
}
+
fs.symlinkSync(path.join(repo, 'node_modules'), path.join(root, 'node_modules'), 'junction')
const assets: string = path.join(app, 'assets/appx')
fs.mkdirSync(assets)
diff --git a/apps/desktop/electron/cloud-boot-cascade.test.ts b/apps/desktop/electron/cloud-boot-cascade.test.ts
index e826f4e3109..7646f5a6d14 100644
--- a/apps/desktop/electron/cloud-boot-cascade.test.ts
+++ b/apps/desktop/electron/cloud-boot-cascade.test.ts
@@ -31,7 +31,10 @@ test('a plain url remote never triggers the cascade, even with the same error',
})
test('a token-auth cloud connection has no cookie to mint, so no cascade', () => {
- assert.equal(shouldAttemptCloudBootCascade({ remoteKind: 'cloud', authMode: 'token' }, makeUnsignedOauthError()), false)
+ assert.equal(
+ shouldAttemptCloudBootCascade({ remoteKind: 'cloud', authMode: 'token' }, makeUnsignedOauthError()),
+ false
+ )
})
test('transport and server errors keep their existing handling', () => {
diff --git a/apps/desktop/electron/cloud-boot-cascade.ts b/apps/desktop/electron/cloud-boot-cascade.ts
index d2453f2da93..afe5f9be33e 100644
--- a/apps/desktop/electron/cloud-boot-cascade.ts
+++ b/apps/desktop/electron/cloud-boot-cascade.ts
@@ -40,7 +40,10 @@ export interface CloudBootCascadeCandidate {
* the cascade; without one the cascade cannot succeed and would only add a
* hidden window and a delay in front of the same error.
*/
-export function shouldAttemptCloudBootCascade(remote: CloudBootCascadeCandidate | null | undefined, error: unknown): boolean {
+export function shouldAttemptCloudBootCascade(
+ remote: CloudBootCascadeCandidate | null | undefined,
+ error: unknown
+): boolean {
if (!remote || typeof remote !== 'object') {
return false
}
diff --git a/apps/desktop/electron/git-binary-candidates.test.ts b/apps/desktop/electron/git-binary-candidates.test.ts
index 32c7c6d44ce..da1c00b9952 100644
--- a/apps/desktop/electron/git-binary-candidates.test.ts
+++ b/apps/desktop/electron/git-binary-candidates.test.ts
@@ -27,19 +27,19 @@ const ugitGitExe = (version: string): string =>
describe('ugitGitBinaries (#61494)', () => {
test('enumerates the UGit app-* glob and returns each bundled git.exe, newest first', () => {
- const fs = fakeFs(
- { [path.join(LAD, 'UGit')]: ['app-5.50.1', 'app-5.51.0', 'Update.exe', 'tools'] },
- [ugitGitExe('5.50.1'), ugitGitExe('5.51.0')]
- )
+ const fs = fakeFs({ [path.join(LAD, 'UGit')]: ['app-5.50.1', 'app-5.51.0', 'Update.exe', 'tools'] }, [
+ ugitGitExe('5.50.1'),
+ ugitGitExe('5.51.0')
+ ])
assert.deepEqual(ugitGitBinaries(LAD, fs), [ugitGitExe('5.51.0'), ugitGitExe('5.50.1')])
})
test('sorts app dirs by version, not lexically (app-10.0.0 beats app-9.0.0)', () => {
- const fs = fakeFs(
- { [path.join(LAD, 'UGit')]: ['app-9.0.0', 'app-10.0.0'] },
- [ugitGitExe('9.0.0'), ugitGitExe('10.0.0')]
- )
+ const fs = fakeFs({ [path.join(LAD, 'UGit')]: ['app-9.0.0', 'app-10.0.0'] }, [
+ ugitGitExe('9.0.0'),
+ ugitGitExe('10.0.0')
+ ])
assert.deepEqual(ugitGitBinaries(LAD, fs), [ugitGitExe('10.0.0'), ugitGitExe('9.0.0')])
})
diff --git a/apps/desktop/electron/host-published-token.test.ts b/apps/desktop/electron/host-published-token.test.ts
index 4b4fccb3f81..b13b69007eb 100644
--- a/apps/desktop/electron/host-published-token.test.ts
+++ b/apps/desktop/electron/host-published-token.test.ts
@@ -43,10 +43,7 @@ function publication(role: string, token: string, overrides: Record<string, unkn
test('a desktop-serve publication matches the ledger record by pid, port, and fingerprint', () => {
const token = 'published-session-token'
- assert.equal(
- publishedTokenForRecord(RECORD, [publication('desktop-serve', token)]),
- token
- )
+ assert.equal(publishedTokenForRecord(RECORD, [publication('desktop-serve', token)]), token)
assert.equal(
publishedTokenForRecord(RECORD, [publication('desktop-serve', token, { tokenFingerprint: '0'.repeat(16) })]),
null
diff --git a/apps/desktop/electron/host-published-token.ts b/apps/desktop/electron/host-published-token.ts
index f3f417f9f7a..d2083fd760d 100644
--- a/apps/desktop/electron/host-published-token.ts
+++ b/apps/desktop/electron/host-published-token.ts
@@ -50,7 +50,8 @@ export function hostRendezvousDirectory(env: HostRendezvousEnv): string {
}
const stateHomeEnv = String(env.stateHome || '').trim()
- const stateHome = stateHomeEnv && path.isAbsolute(stateHomeEnv) ? stateHomeEnv : path.join(env.home, '.local', 'state')
+ const stateHome =
+ stateHomeEnv && path.isAbsolute(stateHomeEnv) ? stateHomeEnv : path.join(env.home, '.local', 'state')
return path.join(stateHome, 'hermes', 'gateway-locks')
}
@@ -112,10 +113,7 @@ function tokenForPublication(record: HostBackendRecord, publication: PublishedHo
}
/** The published token that belongs to this ledger record, or null. */
-export function publishedTokenForRecord(
- record: HostBackendRecord,
- publications: PublishedHostToken[]
-): string | null {
+export function publishedTokenForRecord(record: HostBackendRecord, publications: PublishedHostToken[]): string | null {
for (const publication of publications) {
const token = tokenForPublication(record, publication)
diff --git a/apps/desktop/electron/linux-nvidia-egl-fallback.test.ts b/apps/desktop/electron/linux-nvidia-egl-fallback.test.ts
index ab23c3cb5e9..0f5cbc0078f 100644
--- a/apps/desktop/electron/linux-nvidia-egl-fallback.test.ts
+++ b/apps/desktop/electron/linux-nvidia-egl-fallback.test.ts
@@ -1,17 +1,12 @@
import { describe, expect, it } from 'vitest'
-import {
- decideNvidiaEglFallback,
- NVIDIA_BROKEN_EGL_MAJOR,
- parseNvidiaDriverMajor
-} from './linux-nvidia-egl-fallback'
+import { decideNvidiaEglFallback, NVIDIA_BROKEN_EGL_MAJOR, parseNvidiaDriverMajor } from './linux-nvidia-egl-fallback'
const LINUX = { env: {}, platform: 'linux' as const, isWsl: false, remoteDisplayReason: null }
describe('parseNvidiaDriverMajor', () => {
it('parses the major from /proc/driver/nvidia/version content', () => {
- const text =
- 'NVRM version: NVIDIA UNIX x86_64 Kernel Module 580.82.09 Mon Jul 21 19:44:16 UTC 2025\n'
+ const text = 'NVRM version: NVIDIA UNIX x86_64 Kernel Module 580.82.09 Mon Jul 21 19:44:16 UTC 2025\n'
expect(parseNvidiaDriverMajor(text)).toBe(580)
})
@@ -46,12 +41,8 @@ describe('decideNvidiaEglFallback', () => {
})
it('stays off on non-linux platforms', () => {
- expect(
- decideNvidiaEglFallback({ ...LINUX, platform: 'darwin', driverMajor: 580 }).enable
- ).toBe(false)
- expect(
- decideNvidiaEglFallback({ ...LINUX, platform: 'win32', driverMajor: 580 }).enable
- ).toBe(false)
+ expect(decideNvidiaEglFallback({ ...LINUX, platform: 'darwin', driverMajor: 580 }).enable).toBe(false)
+ expect(decideNvidiaEglFallback({ ...LINUX, platform: 'win32', driverMajor: 580 }).enable).toBe(false)
})
it('stays off under WSLg', () => {
diff --git a/apps/desktop/electron/linux-nvidia-egl-fallback.ts b/apps/desktop/electron/linux-nvidia-egl-fallback.ts
index cda71c33771..10188fc3f4a 100644
--- a/apps/desktop/electron/linux-nvidia-egl-fallback.ts
+++ b/apps/desktop/electron/linux-nvidia-egl-fallback.ts
@@ -94,8 +94,7 @@ export function decideNvidiaEglFallback(options: {
return { enable: false, reason: null }
}
- const detected =
- driverMajor !== null && driverMajor >= NVIDIA_BROKEN_EGL_MAJOR
+ const detected = driverMajor !== null && driverMajor >= NVIDIA_BROKEN_EGL_MAJOR
if (!detected && !OVERRIDE_ON.has(nvidiaOverride)) {
return { enable: false, reason: null }
diff --git a/apps/desktop/electron/local-skin.test.ts b/apps/desktop/electron/local-skin.test.ts
index dd03de0a103..8015425ed59 100644
--- a/apps/desktop/electron/local-skin.test.ts
+++ b/apps/desktop/electron/local-skin.test.ts
@@ -44,7 +44,10 @@ test('reads the active named profile instead of the root home', () => {
fs.mkdirSync(path.join(profileHome, 'skins'), { recursive: true })
fs.writeFileSync(path.join(home, 'config.yaml'), 'display:\n skin: root\n')
fs.writeFileSync(path.join(profileHome, 'config.yaml'), 'display:\n skin: profile\n')
- fs.writeFileSync(path.join(profileHome, 'skins', 'profile.yaml'), 'name: profile\ncolors:\n ui_accent: "#00ffff"\n')
+ fs.writeFileSync(
+ path.join(profileHome, 'skins', 'profile.yaml'),
+ 'name: profile\ncolors:\n ui_accent: "#00ffff"\n'
+ )
const skin = readLocalDisplaySkin(home, 'research')
@@ -63,7 +66,10 @@ test('uses a routed session or hud profile before any gateway can connect', () =
try {
fs.mkdirSync(path.join(profileHome, 'skins'), { recursive: true })
fs.writeFileSync(path.join(profileHome, 'config.yaml'), 'display:\n skin: research\n')
- fs.writeFileSync(path.join(profileHome, 'skins', 'research.yaml'), 'name: research\ncolors:\n ui_accent: "#00ffff"\n')
+ fs.writeFileSync(
+ path.join(profileHome, 'skins', 'research.yaml'),
+ 'name: research\ncolors:\n ui_accent: "#00ffff"\n'
+ )
const payload = readLocalSkinPayload(home, 'research', 'default')
diff --git a/apps/desktop/electron/mac-usage-strings.test.ts b/apps/desktop/electron/mac-usage-strings.test.ts
index 9a6527738d1..9983334a616 100644
--- a/apps/desktop/electron/mac-usage-strings.test.ts
+++ b/apps/desktop/electron/mac-usage-strings.test.ts
@@ -26,6 +26,9 @@ test('mac extendInfo declares a usage string for every TCC-gated desktop service
for (const [key, service] of MAC_USAGE_STRINGS) {
const value = extendInfo[key]
- assert.ok(typeof value === 'string' && value.trim().length > 0, `mac.extendInfo.${key} must be a non-empty usage string; without it macOS denies ${service} access without showing a TCC prompt (#59482)`)
+ assert.ok(
+ typeof value === 'string' && value.trim().length > 0,
+ `mac.extendInfo.${key} must be a non-empty usage string; without it macOS denies ${service} access without showing a TCC prompt (#59482)`
+ )
}
})
diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts
index e65d444ab73..0291d35349c 100644
--- a/apps/desktop/electron/main.ts
+++ b/apps/desktop/electron/main.ts
@@ -393,10 +393,7 @@ import { createPortalSession } from './portal-session'
import { createKeepAwake } from './power-save'
import { readPreUpdateBackupEnabled } from './pre-update-backup-config'
import { capturePreviewContents } from './preview-capture'
-import {
- onPreviewWatchOwnerDestroyed,
- sendPreviewFileChangedToOwner
-} from './preview-file-watch'
+import { onPreviewWatchOwnerDestroyed, sendPreviewFileChangedToOwner } from './preview-file-watch'
import { PreviewReachRegistry } from './preview-reach'
import {
createPrimaryRemoteConnection,
@@ -671,6 +668,7 @@ let windowsGpuStackCookieRelaunchAttempted = false
if (IS_WINDOWS) {
const windowsGpuUserData = app.getPath('userData')
+
const gpuStackCookieDecision = decideWindowsGpuStackCookieLaunch({
argv: process.argv,
marker: readGpuStackCookieMarker(windowsGpuUserData),
@@ -2089,6 +2087,7 @@ async function openExternalFile(rawUrl: string) {
if (lastReveal !== undefined && now - lastReveal < FILE_REVEAL_DEDUPE_MS) {
rememberLog(`[file] duplicate reveal request within ${FILE_REVEAL_DEDUPE_MS}ms; ignored: ${localPath}`)
+
return
}
@@ -3060,6 +3059,7 @@ function resolveGitBinary() {
}
const localAppData = process.env.LOCALAPPDATA || ''
+
// Fixed candidates + the UGit-bundled glob (a UGit install moves with every
// app-* version, so it can only be found by enumerating the dir). UGit's
// git.exe is usually on PATH, but an Explorer-launched Electron inherits the
@@ -6072,10 +6072,7 @@ async function watchPreviewFile(owner, rawUrl) {
// Proactive teardown: the watch must not outlive the window that asked for
// it by whole quit-cycles waiting on a change event that never comes.
- const offOwnerDestroyed = onPreviewWatchOwnerDestroyed(
- owner,
- () => stopPreviewFileWatch(id)
- )
+ const offOwnerDestroyed = onPreviewWatchOwnerDestroyed(owner, () => stopPreviewFileWatch(id))
const watcher = fs.watch(watchDir, (_eventType, filename) => {
const changedName = filename ? path.basename(String(filename)) : ''
@@ -6095,10 +6092,8 @@ async function watchPreviewFile(owner, rawUrl) {
return
}
- sendPreviewFileChangedToOwner(
- owner,
- { id, path: filePath, url: pathToFileURL(filePath).toString() },
- () => stopPreviewFileWatch(id)
+ sendPreviewFileChangedToOwner(owner, { id, path: filePath, url: pathToFileURL(filePath).toString() }, () =>
+ stopPreviewFileWatch(id)
)
}, PREVIEW_WATCH_DEBOUNCE_MS)
})
@@ -6107,6 +6102,7 @@ async function watchPreviewFile(owner, rawUrl) {
owner,
close: () => {
offOwnerDestroyed()
+
if (timer) {
clearTimeout(timer)
}
@@ -6164,10 +6160,7 @@ function watchDirectory(owner, rawDir) {
// Same proactive teardown as a file watch: a closed window's directory
// watch must not keep polling the disk-plugin door until quit.
- const offOwnerDestroyed = onPreviewWatchOwnerDestroyed(
- owner,
- () => stopPreviewFileWatch(id)
- )
+ const offOwnerDestroyed = onPreviewWatchOwnerDestroyed(owner, () => stopPreviewFileWatch(id))
const watcher = fs.watch(watchDir, () => {
if (timer) {
@@ -6176,10 +6169,8 @@ function watchDirectory(owner, rawDir) {
timer = setTimeout(() => {
timer = null
- sendPreviewFileChangedToOwner(
- owner,
- { id, path: watchDir, url: pathToFileURL(watchDir).toString() },
- () => stopPreviewFileWatch(id)
+ sendPreviewFileChangedToOwner(owner, { id, path: watchDir, url: pathToFileURL(watchDir).toString() }, () =>
+ stopPreviewFileWatch(id)
)
}, PREVIEW_WATCH_DEBOUNCE_MS)
})
@@ -6188,6 +6179,7 @@ function watchDirectory(owner, rawDir) {
owner,
close: () => {
offOwnerDestroyed()
+
if (timer) {
clearTimeout(timer)
}
@@ -10193,7 +10185,10 @@ function persistSshConnectionToken(profile, source, token, registryConnectionId
// 3. global remote (connection.json `mode: 'remote'`)
// A null/empty profile resolves the env/global remote, so legacy callers and
// the connection test (which pass no profile) are unchanged.
-async function resolveRemoteBackend(profile, options: { forceRegistryPrimary?: boolean; poolKey?: string; primary?: boolean } = {}) {
+async function resolveRemoteBackend(
+ profile,
+ options: { forceRegistryPrimary?: boolean; poolKey?: string; primary?: boolean } = {}
+) {
const profileKey = String(profile || '').trim() || 'default'
const managedPrimary = options.primary
@@ -12129,6 +12124,7 @@ async function runPoolBackendStart(
WebSocketImpl: globalThis.WebSocket,
...spawnedBackendProbeOptions(childAlive)
})
+
assertPoolEntryStillOwned(poolKey, entry, backendPool, localBackendLifecycle.signal)
if (!wsProbe.ok) {
@@ -12715,15 +12711,15 @@ async function runHermesStart({ supervisorRecovery = false }: { supervisorRecove
migrateActiveProfileIfMissing()
const connectionAttempt = backendConnectionState.startAttempt()
+
// ONE launch-profile decision for this attempt (#108417): routing pin,
// --profile argv, and the child env all derive from the same read, so a
// hermes:profile:remember landing mid-startup becomes the NEXT boot's
// preference instead of splitting routing identity from the launch
// argument. (The pin below still honors a live primary — but a primary
// being live means startHermes never got here.)
- const { argvProfile: activeProfile, routingProfile: primaryProfile } = resolveLaunchProfile(
- readActiveDesktopProfile
- )
+ const { argvProfile: activeProfile, routingProfile: primaryProfile } = resolveLaunchProfile(readActiveDesktopProfile)
+
// Pin the routing table to the profile this primary actually boots as; a
// later hermes:profile:remember must not retarget requests mid-life.
primaryProfilePin.pin(primaryProfile)
@@ -12784,6 +12780,7 @@ async function runHermesStart({ supervisorRecovery = false }: { supervisorRecove
const token = crypto.randomBytes(32).toString('base64url')
// --port 0: the OS assigns an ephemeral port; the child announces it on stdout.
const backendArgs = ['serve', '--host', '127.0.0.1', '--port', '0']
+
// Pin the desktop's chosen profile via the global --profile flag. This is
// deterministic (it wins over the sticky ~/.hermes/active_profile file) and
// resolves HERMES_HOME the same way `hermes -p <name>` does on the CLI. An
@@ -16679,10 +16676,15 @@ const rowsOf = data => (Array.isArray(data?.sessions) ? data.sessions : [])
// authoritative identity — never relabel rows with the Desktop scope name.
async function remoteSessionList(profile, searchParams) {
const sshOverride = profileSshOverride(readDesktopConnectionConfig(), profile)
+
const data = await fetchRemoteProfileSessions(profile, searchParams, fetchJsonForProfile, {
remoteProfileAlias: sshOverride?.remoteProfile
})
- const rows = tagRemoteSessionRows(rowsOf(data), remoteProfileQueryScope(profile, sshOverride?.remoteProfile) || profile)
+
+ const rows = tagRemoteSessionRows(
+ rowsOf(data),
+ remoteProfileQueryScope(profile, sshOverride?.remoteProfile) || profile
+ )
return { ...(data as any), sessions: rows }
}
@@ -17361,13 +17363,9 @@ ipcMain.handle('hermes:normalizePreviewTarget', (_event, target, baseDir) =>
normalizePreviewTarget(String(target || ''), baseDir ? String(baseDir) : '')
)
-ipcMain.handle('hermes:watchPreviewFile', (event, url) =>
- watchPreviewFile(event.sender, String(url || ''))
-)
+ipcMain.handle('hermes:watchPreviewFile', (event, url) => watchPreviewFile(event.sender, String(url || '')))
-ipcMain.handle('hermes:watchDirectory', (event, dir) =>
- watchDirectory(event.sender, String(dir || ''))
-)
+ipcMain.handle('hermes:watchDirectory', (event, dir) => watchDirectory(event.sender, String(dir || '')))
ipcMain.handle('hermes:stopPreviewFileWatch', (_event, id) => stopPreviewFileWatch(String(id || '')))
@@ -18498,9 +18496,7 @@ app.whenReady().then(() => {
const systemCa = installSystemCaTrust(tls)
if (systemCa.applied) {
- rememberLog(
- `[tls] trusting ${systemCa.systemCertificateCount} OS CA certificate(s) for backend connections`
- )
+ rememberLog(`[tls] trusting ${systemCa.systemCertificateCount} OS CA certificate(s) for backend connections`)
} else if (systemCa.error) {
rememberLog(`[tls] could not load OS system CA certificates: ${systemCa.error}`)
}
diff --git a/apps/desktop/electron/preload-local-skin.test.ts b/apps/desktop/electron/preload-local-skin.test.ts
index 695a484b580..dfec5766c9f 100644
--- a/apps/desktop/electron/preload-local-skin.test.ts
+++ b/apps/desktop/electron/preload-local-skin.test.ts
@@ -26,5 +26,8 @@ test('the preload carries the local skin across before the renderer starts', asy
const [, bridge] = electron.contextBridge.exposeInMainWorld.mock.calls[0]
assert.deepEqual(bridge.localSkin, skin)
- assert.equal(electron.ipcRenderer.sendSync.mock.calls.some(([channel]) => channel === 'hermes:skin:local'), true)
+ assert.equal(
+ electron.ipcRenderer.sendSync.mock.calls.some(([channel]) => channel === 'hermes:skin:local'),
+ true
+ )
})
diff --git a/apps/desktop/electron/preload.ts b/apps/desktop/electron/preload.ts
index 2988a7eb661..c3e48f41ccd 100644
--- a/apps/desktop/electron/preload.ts
+++ b/apps/desktop/electron/preload.ts
@@ -17,6 +17,7 @@ const hudNativeDrag = hudWindowing?.nativeDrag === true
const launchFlags: { localModels?: boolean; guestOnboarding?: boolean; skipIntro?: boolean } | undefined =
ipcRenderer.sendSync('hermes:feature-flags')
+
// Local, sanitized skin payload for the first renderer theme paint. This does
// not wait on `gateway.ready`, so an unreachable remote primary cannot force
// the built-in palette over the skin configured on this machine.
diff --git a/apps/desktop/electron/preview-file-watch.ts b/apps/desktop/electron/preview-file-watch.ts
index a94f09231ba..8025ca25220 100644
--- a/apps/desktop/electron/preview-file-watch.ts
+++ b/apps/desktop/electron/preview-file-watch.ts
@@ -32,10 +32,12 @@ export function sendPreviewFileChangedToOwner(
): boolean {
if (!owner || owner.isDestroyed()) {
onDestroyed?.()
+
return false
}
owner.send(PREVIEW_FILE_CHANGED_CHANNEL, payload)
+
return true
}
diff --git a/apps/desktop/electron/primary-backend-startup.test.ts b/apps/desktop/electron/primary-backend-startup.test.ts
index 37acbf2fc95..30e5e777086 100644
--- a/apps/desktop/electron/primary-backend-startup.test.ts
+++ b/apps/desktop/electron/primary-backend-startup.test.ts
@@ -26,6 +26,7 @@ function startupOptions<T extends Record<string, unknown> = Record<string, never
waitForDecision: vi.fn(async () => 'continue-local' as const),
waitForLocalStart: vi.fn(async () => {})
}
+
return { ...base, ...overrides } as typeof base & T
}
diff --git a/apps/desktop/electron/primary-profile-pin.ts b/apps/desktop/electron/primary-profile-pin.ts
index c8ae9c52787..9bb6c33e380 100644
--- a/apps/desktop/electron/primary-profile-pin.ts
+++ b/apps/desktop/electron/primary-profile-pin.ts
@@ -61,9 +61,10 @@ export class PrimaryProfilePin {
* next boot's decision instead of splitting routing identity from
* `--profile`.
*/
-export function resolveLaunchProfile(
- readPreference: () => null | string | undefined
-): { argvProfile: null | string; routingProfile: string } {
+export function resolveLaunchProfile(readPreference: () => null | string | undefined): {
+ argvProfile: null | string
+ routingProfile: string
+} {
const argvProfile = String(readPreference() ?? '').trim() || null
return { argvProfile, routingProfile: argvProfile ?? 'default' }
diff --git a/apps/desktop/electron/product-identity.test.ts b/apps/desktop/electron/product-identity.test.ts
index c8f78b8e068..a45fc948e69 100644
--- a/apps/desktop/electron/product-identity.test.ts
+++ b/apps/desktop/electron/product-identity.test.ts
@@ -242,10 +242,7 @@ test('packaging isolates boot metadata and executable names without renaming rel
assert.equal(appInfo.productFilename, identity.windowsExecutableName)
assert.equal(config.mac.extendInfo.CFBundleExecutable, config.executableName)
assert.equal(config.artifactName, stable.artifactName)
- assert.equal(
- config.msix.customManifestPath,
- 'build/msix-manifest.xml'
- )
+ assert.equal(config.msix.customManifestPath, 'build/msix-manifest.xml')
const {
appIdentity
diff --git a/apps/desktop/electron/profile-session-routing.test.ts b/apps/desktop/electron/profile-session-routing.test.ts
index baf27b60d17..26d9f0321e2 100644
--- a/apps/desktop/electron/profile-session-routing.test.ts
+++ b/apps/desktop/electron/profile-session-routing.test.ts
@@ -256,9 +256,7 @@ test('remote session reads keep small requests on one call', async () => {
}
)
- assert.deepEqual(calls, [
- { profile: 'remote-work', path: '/api/sessions?limit=20&offset=0&profile=remote-work' }
- ])
+ assert.deepEqual(calls, [{ profile: 'remote-work', path: '/api/sessions?limit=20&offset=0&profile=remote-work' }])
assert.equal(result, expected)
})
@@ -513,9 +511,7 @@ test('remote session reads carry the profile scope against a multi-profile backe
}
)
- assert.deepEqual(calls, [
- { profile: 'wife', path: '/api/sessions?limit=20&offset=0&profile=wife' }
- ])
+ assert.deepEqual(calls, [{ profile: 'wife', path: '/api/sessions?limit=20&offset=0&profile=wife' }])
})
// The same read for the OTHER scope sharing the backend names ITS scope — the
@@ -554,7 +550,7 @@ test('remote session reads fall back to the unscoped list when the remote reject
calls.push(path)
if (path.includes('profile=wife')) {
- const error: any = new Error('404: Profile \'wife\' does not exist.')
+ const error: any = new Error("404: Profile 'wife' does not exist.")
error.statusCode = 404
throw error
}
@@ -563,10 +559,7 @@ test('remote session reads fall back to the unscoped list when the remote reject
}
)
- assert.deepEqual(calls, [
- '/api/sessions?limit=20&offset=0&profile=wife',
- '/api/sessions?limit=20&offset=0'
- ])
+ assert.deepEqual(calls, ['/api/sessions?limit=20&offset=0&profile=wife', '/api/sessions?limit=20&offset=0'])
assert.equal((result.sessions[0] as { id: string }).id, 's-1')
})
@@ -658,10 +651,7 @@ test('per-session remote reads carry the owner profile scope', () => {
pathWithRemoteOwnerScope('/api/sessions/s-1?limit=50', 'wife'),
'/api/sessions/s-1?limit=50&profile=wife'
)
- assert.equal(
- pathWithRemoteOwnerScope('/api/sessions/s-1', 'wife'),
- '/api/sessions/s-1?profile=wife'
- )
+ assert.equal(pathWithRemoteOwnerScope('/api/sessions/s-1', 'wife'), '/api/sessions/s-1?profile=wife')
// Existing pagination params survive the scope.
assert.equal(
pathWithRemoteOwnerScope('/api/sessions/s-1/messages?limit=100&offset=200', 'wife'),
diff --git a/apps/desktop/electron/source-python.test.ts b/apps/desktop/electron/source-python.test.ts
index 1c7079acdbe..1314ccc4011 100644
--- a/apps/desktop/electron/source-python.test.ts
+++ b/apps/desktop/electron/source-python.test.ts
@@ -12,7 +12,7 @@ const ROOT: string = path.join(path.sep, 'checkout')
function checkout(present: string[] = [], exists: boolean = true) {
const files = new Set(present.map(entry => path.join(ROOT, entry)))
- return { root: ROOT, fileExists: (candidate: string): boolean => (exists && files.has(candidate)) }
+ return { root: ROOT, fileExists: (candidate: string): boolean => exists && files.has(candidate) }
}
test('a checkout with no virtualenv resolves to no interpreter, never a PATH Python', (): void => {
@@ -58,12 +58,15 @@ test('an explicit developer interpreter wins, and is only honoured when it exist
const { root, fileExists } = checkout(['venv/bin/python'], true)
const withPreferred = (candidate: string): boolean => candidate === preferred || fileExists(candidate)
- assert.equal(resolveSourcePython(root, { override: preferred, fileExists: withPreferred, isWindows: false }), preferred)
+ assert.equal(
+ resolveSourcePython(root, { override: preferred, fileExists: withPreferred, isWindows: false }),
+ preferred
+ )
// An override naming a file that is gone does not resurrect a PATH Python;
// it falls through to the checkout, then to null.
+ assert.equal(resolveSourcePython(root, { override: preferred, fileExists, isWindows: false }), aged)
assert.equal(
- resolveSourcePython(root, { override: preferred, fileExists, isWindows: false }),
- aged
+ resolveSourcePython(ROOT, { override: preferred, fileExists: checkout().fileExists, isWindows: false }),
+ null
)
- assert.equal(resolveSourcePython(ROOT, { override: preferred, fileExists: checkout().fileExists, isWindows: false }), null)
-})
\ No newline at end of file
+})
diff --git a/apps/desktop/electron/source-python.ts b/apps/desktop/electron/source-python.ts
index 14e3cd1fcf6..84b2d3034df 100644
--- a/apps/desktop/electron/source-python.ts
+++ b/apps/desktop/electron/source-python.ts
@@ -54,4 +54,4 @@ export function resolveSourcePython(
}
return null
-}
\ No newline at end of file
+}
diff --git a/apps/desktop/electron/ssh-connection.test.ts b/apps/desktop/electron/ssh-connection.test.ts
index 4e223cd6ea0..ce3a34c8272 100644
--- a/apps/desktop/electron/ssh-connection.test.ts
+++ b/apps/desktop/electron/ssh-connection.test.ts
@@ -587,17 +587,24 @@ test('open() records what the failed ssh did in the desktop log (#80836)', async
await assert.rejects(conn.open())
fs.rmSync(controlDir, { recursive: true, force: true })
assert.ok(
- logs.some(line => /connect to me@box:22 failed \(kind=unknown, exit=null, signal=SIGTERM\): \(empty\)/.test(line)),
+ logs.some(line =>
+ /connect to me@box:22 failed \(kind=unknown, exit=null, signal=SIGTERM\): \(empty\)/.test(line)
+ ),
`mux=${mux}: ${logs.join(' | ')}`
)
}
const logs: string[] = []
const spawnFn = scriptedSpawn([{ code: 255, stderr: 'me@box: Permission denied (publickey).' }])
- const conn = new SshConnection({ host: 'box', user: 'me' }, { spawnFn, mux: false, rememberLog: line => logs.push(line) })
+ const conn = new SshConnection(
+ { host: 'box', user: 'me' },
+ { spawnFn, mux: false, rememberLog: line => logs.push(line) }
+ )
await assert.rejects(conn.open())
- assert.ok(logs.some(line => /failed \(kind=auth-failed, exit=255, signal=none\): me@box: Permission denied/.test(line)))
+ assert.ok(
+ logs.some(line => /failed \(kind=auth-failed, exit=255, signal=none\): me@box: Permission denied/.test(line))
+ )
})
test('runSsh keeps Node close signal on the result', async () => {
@@ -613,7 +620,10 @@ test('no-mux open() does not classify a signal death with empty stderr as unreac
const spawnFn = scriptedSpawn([{ signal: 'SIGTERM', stderr: '' }])
const conn = new SshConnection({ host: 'box', user: 'me' }, { spawnFn, mux: false })
- await assert.rejects(() => conn.open(), (err: any) => assertSignalDeathNotUnreachable(err, 'SIGTERM'))
+ await assert.rejects(
+ () => conn.open(),
+ (err: any) => assertSignalDeathNotUnreachable(err, 'SIGTERM')
+ )
})
test('mux open() does not classify a signal-killed master with empty stderr as unreachable', async () => {
@@ -627,21 +637,30 @@ test('mux open() does not classify a signal-killed master with empty stderr as u
const conn = new SshConnection({ host: 'box', user: 'me' }, { spawnFn, controlDir: '/tmp/d' })
- await assert.rejects(() => conn.open(), (err: any) => assertSignalDeathNotUnreachable(err, 'SIGHUP'))
+ await assert.rejects(
+ () => conn.open(),
+ (err: any) => assertSignalDeathNotUnreachable(err, 'SIGHUP')
+ )
})
test('exec() does not classify a signal death with empty stderr as unreachable', async () => {
const spawnFn = scriptedSpawn([{ signal: 'SIGKILL', stderr: '' }])
const conn = new SshConnection({ host: 'box', user: 'me' }, { spawnFn, controlDir: '/tmp/d' })
- await assert.rejects(() => conn.exec('uname -s'), (err: any) => assertSignalDeathNotUnreachable(err, 'SIGKILL'))
+ await assert.rejects(
+ () => conn.exec('uname -s'),
+ (err: any) => assertSignalDeathNotUnreachable(err, 'SIGKILL')
+ )
})
test('forward() does not classify a signal death with empty stderr as unreachable', async () => {
const spawnFn = scriptedSpawn([{ signal: 'SIGPIPE', stderr: '' }])
const conn = new SshConnection({ host: 'box', user: 'me' }, { spawnFn, controlDir: '/tmp/d' })
- await assert.rejects(() => conn.forward(5000, 6000), (err: any) => assertSignalDeathNotUnreachable(err, 'SIGPIPE'))
+ await assert.rejects(
+ () => conn.forward(5000, 6000),
+ (err: any) => assertSignalDeathNotUnreachable(err, 'SIGPIPE')
+ )
})
test('close() does not report a signal-killed -O exit with empty stderr as unreachable', async () => {
diff --git a/apps/desktop/electron/updater/app-installer-strategy.test.ts b/apps/desktop/electron/updater/app-installer-strategy.test.ts
index 080ec81b18a..0e087708929 100644
--- a/apps/desktop/electron/updater/app-installer-strategy.test.ts
+++ b/apps/desktop/electron/updater/app-installer-strategy.test.ts
@@ -97,18 +97,19 @@ describe('AppInstallerStrategy.apply', () => {
expect(calls).toEqual(['relaunch-marker', 'teardown', 'quit'])
})
- it.each(['http://external.example/update.appinstaller', 'https://user:[email protected]/update.appinstaller', 'https://registered.example/../update.appinstaller'])(
- 'rejects an unsafe registered source URI before staging: %s',
- async (sourceUri: string): Promise<void> => {
- const { deps, calls } = makeDeps({
- feedBaseUrl: '',
- run: async () => ({ code: 2, stdout: JSON.stringify({ available: true, source_uri: sourceUri }) })
- })
-
- await expect(new AppInstallerStrategy(deps).apply()).rejects.toThrow()
- expect(calls).toEqual([])
- }
- )
+ it.each([
+ 'http://external.example/update.appinstaller',
+ 'https://user:[email protected]/update.appinstaller',
+ 'https://registered.example/../update.appinstaller'
+ ])('rejects an unsafe registered source URI before staging: %s', async (sourceUri: string): Promise<void> => {
+ const { deps, calls } = makeDeps({
+ feedBaseUrl: '',
+ run: async () => ({ code: 2, stdout: JSON.stringify({ available: true, source_uri: sourceUri }) })
+ })
+
+ await expect(new AppInstallerStrategy(deps).apply()).rejects.toThrow()
+ expect(calls).toEqual([])
+ })
it('uses an exact descriptor without a Python check, and rejects unverified prepared packages before teardown', async (): Promise<void> => {
const { deps, calls } = makeDeps({
diff --git a/apps/desktop/electron/updater/channel-protocol.ts b/apps/desktop/electron/updater/channel-protocol.ts
index 4e67c1bb627..348ecdd4622 100644
--- a/apps/desktop/electron/updater/channel-protocol.ts
+++ b/apps/desktop/electron/updater/channel-protocol.ts
@@ -87,7 +87,8 @@ export interface ChannelManifest {
const SHA256 = /^[a-f0-9]{64}$/
const COMMIT = /^[a-f0-9]{40}$/
const BUILD_ID = /^[a-f0-9]{32}$/
-const VERSION = /^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(?:-[0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?(?:\+[0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?$/
+const VERSION =
+ /^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(?:-[0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?(?:\+[0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?$/
// rc.<N>-vX.Y.Z with N >= 1 without leading zeros and a release version whose
// major stays within three digits — one regex matching the Python grammar.
const ARCHIVE_REF = /^rc\.(?:[1-9]\d*)-v(?:0|[1-9]\d{0,2})\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/
@@ -363,8 +364,12 @@ function request(fields: Fields): ChannelRequest {
// Match the build-time allowlist: a channel request cannot inject process flags.
const allowed = new Set([
- 'HERMES_HOME', 'HERMES_DATA_DIR_SUFFIX', 'HERMES_DESKTOP_USER_DATA_DIR',
- 'HERMES_SHARED_AUTH_DIR', 'HERMES_GUEST_ONBOARDING', 'HERMES_SKIP_INTRO'
+ 'HERMES_HOME',
+ 'HERMES_DATA_DIR_SUFFIX',
+ 'HERMES_DESKTOP_USER_DATA_DIR',
+ 'HERMES_SHARED_AUTH_DIR',
+ 'HERMES_GUEST_ONBOARDING',
+ 'HERMES_SKIP_INTRO'
])
for (const key of environment.keys()) {
@@ -387,16 +392,11 @@ function request(fields: Fields): ChannelRequest {
throw new Error('Noncanonical request publicBase')
}
- const releaseTag = fields.optional(
- 'releaseTag',
- /^v\d+\.\d+\.\d+(?:\+canary\.20\d{6}T\d{6}Z)?$/
- )
+ const releaseTag = fields.optional('releaseTag', /^v\d+\.\d+\.\d+(?:\+canary\.20\d{6}T\d{6}Z)?$/)
+
const canaryRelease: boolean = /\+canary\./.test(releaseTag || '')
- const windowsVersion = fields.text(
- 'windowsVersion',
- canaryRelease ? /^\d+\.\d+\.\d+\.\d+$/ : /^\d+\.\d+\.\d+\.0$/
- )
+ const windowsVersion = fields.text('windowsVersion', canaryRelease ? /^\d+\.\d+\.\d+\.\d+$/ : /^\d+\.\d+\.\d+\.0$/)
if (windowsVersion.split('.').some((part: string): boolean => Number(part) > 65535)) {
throw new Error('Invalid Windows version')
diff --git a/apps/desktop/electron/updater/channel.test.ts b/apps/desktop/electron/updater/channel.test.ts
index 4ddc56046ed..f97c3652985 100644
--- a/apps/desktop/electron/updater/channel.test.ts
+++ b/apps/desktop/electron/updater/channel.test.ts
@@ -180,7 +180,9 @@ test.each(['NODE_OPTIONS', 'PATH', 'HERMES_PYTHON'])(
async (key: string): Promise<void> => {
const f = await fixture()
f.manifest.request.bundleEnv[key] = null
- expect((): void => { decodeChannelManifest(JSON.stringify(f.manifest)) }).toThrow('Invalid bundle environment name')
+ expect((): void => {
+ decodeChannelManifest(JSON.stringify(f.manifest))
+ }).toThrow('Invalid bundle environment name')
}
)
@@ -270,12 +272,14 @@ test.each(['rc.1-v0.21.5', 'rc.12-v1.0.0'] as const)(
f.manifest.packages[0].artifact.key = `releases/tag/${attempt}/darwin/Hermes.zip`
f.manifest.packages[0].feed.key = `releases/tag/${attempt}/darwin/stable-mac.yml`
f.publish()
+
const result = await new ChannelResolver({
build: f.build,
platform: 'darwin',
arch: 'arm64',
signer: 'ABCDE12345'
}).resolve()
+
expect(result.kind).toBe('active')
}
)
@@ -304,10 +308,12 @@ test('the protected archive prefix falls back closed to the bare release tag', a
test('archiveRef parses the shared attempt-ref grammar or is refused', async (): Promise<void> => {
const f = await fixture()
const decode = (): unknown => decodeChannelManifest(JSON.stringify(f.manifest))
+
for (const ref of ['rc.1-v0.21.5', 'rc.12-v1.0.0']) {
f.manifest.request.archiveRef = ref
expect(decode).not.toThrow()
}
+
for (const ref of [
'v0.21.5-rc',
'v0.21.5-rc.1',
@@ -320,6 +326,7 @@ test('archiveRef parses the shared attempt-ref grammar or is refused', async ():
f.manifest.request.archiveRef = ref
expect(decode).toThrow(/archiveRef/)
}
+
delete f.manifest.request.archiveRef
expect(decode).not.toThrow()
})
diff --git a/apps/desktop/electron/updater/checkout-handoff.test.ts b/apps/desktop/electron/updater/checkout-handoff.test.ts
index 8e68f16303d..eee5960724b 100644
--- a/apps/desktop/electron/updater/checkout-handoff.test.ts
+++ b/apps/desktop/electron/updater/checkout-handoff.test.ts
@@ -65,7 +65,11 @@ it.each([true, false])(
const spawned: string[][] = []
const spawnOptions: Parameters<typeof updaterProcess.spawnUpdaterProcess>[2][] = []
vi.spyOn(updaterProcess, 'spawnUpdaterProcess').mockImplementation(
- (_command: string, args: string[], options: Parameters<typeof updaterProcess.spawnUpdaterProcess>[2]): updaterProcess.UpdaterChild => {
+ (
+ _command: string,
+ args: string[],
+ options: Parameters<typeof updaterProcess.spawnUpdaterProcess>[2]
+ ): updaterProcess.UpdaterChild => {
spawned.push(args)
spawnOptions.push(options)
diff --git a/apps/desktop/electron/updater/checkout-legacy.test.ts b/apps/desktop/electron/updater/checkout-legacy.test.ts
index 30d2d672eb1..3b908612eb8 100644
--- a/apps/desktop/electron/updater/checkout-legacy.test.ts
+++ b/apps/desktop/electron/updater/checkout-legacy.test.ts
@@ -70,24 +70,37 @@ it('moves a checkout without a source probe to main, but surfaces a broken probe
}
})
-it.skipIf(process.platform === 'win32')('uses the install-scoped PM launcher rather than a system Python for source checks', async (): Promise<void> => {
- const root: string = fs.mkdtempSync(path.join(os.tmpdir(), 'pm-source-check-'))
- const home: string = path.join(root, 'profile')
- const launcher: string = path.join(root, '.hermes', 'bin', 'hermes')
- fs.mkdirSync(path.dirname(launcher), { recursive: true })
- fs.mkdirSync(path.join(root, 'pm'))
- fs.mkdirSync(home)
- fs.writeFileSync(launcher, '#!/bin/sh\n[ "$1" = --run-module ] && [ "$2" = hermes_cli.source_check ] || exit 5\nprintf \'%s\\n\' \'{"supported":true,"channel":"stable","behind":-1}\'\n', { mode: 0o755 })
+it.skipIf(process.platform === 'win32')(
+ 'uses the install-scoped PM launcher rather than a system Python for source checks',
+ async (): Promise<void> => {
+ const root: string = fs.mkdtempSync(path.join(os.tmpdir(), 'pm-source-check-'))
+ const home: string = path.join(root, 'profile')
+ const launcher: string = path.join(root, '.hermes', 'bin', 'hermes')
+ fs.mkdirSync(path.dirname(launcher), { recursive: true })
+ fs.mkdirSync(path.join(root, 'pm'))
+ fs.mkdirSync(home)
+ fs.writeFileSync(
+ launcher,
+ '#!/bin/sh\n[ "$1" = --run-module ] && [ "$2" = hermes_cli.source_check ] || exit 5\nprintf \'%s\\n\' \'{"supported":true,"channel":"stable","behind":-1}\'\n',
+ { mode: 0o755 }
+ )
- try {
- const probe = { python: '/nonexistent/system-python', git: 'git', updateRoot: root, hermesHome: home, channel: 'stable' as const }
- await expect(readSourceUpdate(probe)).resolves.toMatchObject({ supported: true, channel: 'stable', behind: null })
- fs.rmSync(launcher)
- await expect(readSourceUpdate(probe)).rejects.toThrow('installation launcher is missing')
- } finally {
- fs.rmSync(root, { recursive: true, force: true })
+ try {
+ const probe = {
+ python: '/nonexistent/system-python',
+ git: 'git',
+ updateRoot: root,
+ hermesHome: home,
+ channel: 'stable' as const
+ }
+ await expect(readSourceUpdate(probe)).resolves.toMatchObject({ supported: true, channel: 'stable', behind: null })
+ fs.rmSync(launcher)
+ await expect(readSourceUpdate(probe)).rejects.toThrow('installation launcher is missing')
+ } finally {
+ fs.rmSync(root, { recursive: true, force: true })
+ }
}
-})
+)
it.skipIf(process.platform !== 'win32')(
'runs a PM .cmd source check with quoted paths and refuses a missing launcher',
diff --git a/apps/desktop/electron/updater/checkout-source.ts b/apps/desktop/electron/updater/checkout-source.ts
index e15c20ad1ac..19c100ad2f4 100644
--- a/apps/desktop/electron/updater/checkout-source.ts
+++ b/apps/desktop/electron/updater/checkout-source.ts
@@ -118,4 +118,4 @@ export async function readSourceUpdate(probe: SourceUpdateProbe): Promise<Source
}
return selection
-}
\ No newline at end of file
+}
diff --git a/apps/desktop/electron/updater/mac-client.test.ts b/apps/desktop/electron/updater/mac-client.test.ts
index 536c1949591..81f70dce312 100644
--- a/apps/desktop/electron/updater/mac-client.test.ts
+++ b/apps/desktop/electron/updater/mac-client.test.ts
@@ -34,7 +34,9 @@ afterEach((): void => {
})
function deps(
- feedBaseUrl = '', light = false, channel: 'stable' | 'canary' = 'stable'
+ feedBaseUrl = '',
+ light = false,
+ channel: 'stable' | 'canary' = 'stable'
): Parameters<typeof createMacStrategy>[0] {
return {
channel,
@@ -88,8 +90,10 @@ describe('macOS client wiring', () => {
client.checkForUpdates.mockImplementationOnce(async () => {
expect(client.currentVersion.version).toBe('0.0.0')
const info = { version, files: [], releaseDate: '', path: '', sha512: '' }
+
return { isUpdateAvailable: true, updateInfo: info, versionInfo: info }
})
+
const strategy = createMacStrategy({
...deps('https://updates.example', false, 'canary'),
appVersion: '0.21.4+canary.20260922T001400Z',
diff --git a/apps/desktop/electron/updater/mac-client.ts b/apps/desktop/electron/updater/mac-client.ts
index 23979ef7edd..c41a6efac74 100644
--- a/apps/desktop/electron/updater/mac-client.ts
+++ b/apps/desktop/electron/updater/mac-client.ts
@@ -36,13 +36,16 @@ export function createMacStrategy(deps: MacClientDeps): MacStrategy {
const legacy = feedContract.darwinFeed(deps.channel, deps.light)
const channel = deps.feed?.channel ?? legacy.channel
const updater = new electronUpdater.MacUpdater()
+
if (deps.feed) {
// The validated channel sequence, not SemVer precedence, decides whether a
// pinned build is newer. Build metadata is intentionally precedence-neutral.
Object.defineProperty(updater, 'currentVersion', {
- value: new SemVer('0.0.0'), configurable: true
+ value: new SemVer('0.0.0'),
+ configurable: true
})
}
+
updater.autoDownload = false
updater.autoInstallOnAppQuit = false
updater.autoRunAppAfterInstall = true
diff --git a/apps/desktop/electron/window-accelerator.ts b/apps/desktop/electron/window-accelerator.ts
index 933236aefd6..2cfa1014f7a 100644
--- a/apps/desktop/electron/window-accelerator.ts
+++ b/apps/desktop/electron/window-accelerator.ts
@@ -1,11 +1,5 @@
export type WindowAcceleratorAction =
- | 'close-tab'
- | 'reload'
- | 'zoom-in'
- | 'zoom-out'
- | 'zoom-reset'
- | 'swallow'
- | 'ignore'
+ 'close-tab' | 'reload' | 'zoom-in' | 'zoom-out' | 'zoom-reset' | 'swallow' | 'ignore'
/**
* How long after the window gains focus a Close Tab / Reload keyDown is
diff --git a/apps/desktop/electron/window-reveal.test.ts b/apps/desktop/electron/window-reveal.test.ts
index e07d5071b0a..5e7821bfe4a 100644
--- a/apps/desktop/electron/window-reveal.test.ts
+++ b/apps/desktop/electron/window-reveal.test.ts
@@ -251,12 +251,7 @@ function createFailureHarness(): FailureHarness {
clearTimer: () => {}
})
- const emit = (
- target: 'window' | 'webContents',
- kind: 'once' | 'on',
- event: string,
- ...args: unknown[]
- ) => {
+ const emit = (target: 'window' | 'webContents', kind: 'once' | 'on', event: string, ...args: unknown[]) => {
const key = `${kind}:${event}`
const map = target === 'window' ? windowListeners : webContentsListeners
diff --git a/apps/desktop/electron/window-reveal.ts b/apps/desktop/electron/window-reveal.ts
index db289a348fa..654969e7f71 100644
--- a/apps/desktop/electron/window-reveal.ts
+++ b/apps/desktop/electron/window-reveal.ts
@@ -163,14 +163,11 @@ export function wireWindowReveal(
win.on('closed', controller.dispose)
if (onRevealFailed) {
- win.webContents.on(
- 'did-fail-load',
- (_event, errorCode, errorDescription, _validatedURL, isMainFrame) => {
- if (isMainFrame) {
- controller.fail(`main frame failed to load (${errorCode}: ${errorDescription})`)
- }
+ win.webContents.on('did-fail-load', (_event, errorCode, errorDescription, _validatedURL, isMainFrame) => {
+ if (isMainFrame) {
+ controller.fail(`main frame failed to load (${errorCode}: ${errorDescription})`)
}
- )
+ })
win.webContents.on('render-process-gone', (_event, details) => {
controller.fail(`render process gone (${details?.reason ?? 'unknown'})`)
diff --git a/apps/desktop/src/app/artifacts/artifact-utils.ts b/apps/desktop/src/app/artifacts/artifact-utils.ts
index 4609150adf3..d7a86e90c61 100644
--- a/apps/desktop/src/app/artifacts/artifact-utils.ts
+++ b/apps/desktop/src/app/artifacts/artifact-utils.ts
@@ -437,9 +437,8 @@ function collectArtifactsFromMessage(message: SessionMessage, pushValue: PushVal
// their non-index segments, and with no index the shell-output/explicit
// key tests match the last real segment. Do NOT switch this to
// exact-key matching — it would silently stop indexing those shapes.
- const segments = keyPath
- .split('.')
- .filter(segment => segment && !/^\d+$/.test(segment))
+ const segments = keyPath.split('.').filter(segment => segment && !/^\d+$/.test(segment))
+
const shellOutput = terminalTool && segments.some(segment => SHELL_OUTPUT_KEY_RE.test(segment))
if (!shellOutput && !explicitToolArtifactKey(keyPath, producerTool)) {
diff --git a/apps/desktop/src/app/capabilities/catalog/catalog-browser.tsx b/apps/desktop/src/app/capabilities/catalog/catalog-browser.tsx
index 14009de5a11..3845a996d22 100644
--- a/apps/desktop/src/app/capabilities/catalog/catalog-browser.tsx
+++ b/apps/desktop/src/app/capabilities/catalog/catalog-browser.tsx
@@ -83,11 +83,13 @@ function mergeInstalled(
if (!installed) {
return [entry]
}
+
remaining.delete(installed.id)
if (seen.has(installed.id)) {
return []
}
+
seen.add(installed.id)
return [
@@ -153,6 +155,7 @@ export const CatalogBrowser = memo(function CatalogBrowser({
if (!selectedEntryId) {
return
}
+
setSelectedId(selectedEntryId)
setDetailOpen(true)
}, [selectedEntryId])
@@ -162,12 +165,15 @@ export const CatalogBrowser = memo(function CatalogBrowser({
const entries = mergeInstalled(data ?? [], installedEntries ?? [], matchInstalled)
const filtered = sortCatalog(filterCatalog(entries, facets, deferredQuery, isInstalled), sort, kind)
+
const discover =
kind === 'plugins' && !facets.categories.length && !facets.tags.length && !deferredQuery && !facets.installedOnly
+
const sections =
discover && cardView
? groupCatalogPlugins(filtered).map(([key, items]) => ({ key, ...PLUGIN_CATEGORIES[key], entries: items }))
: []
+
const pageOrder = sections.length ? sections.flatMap(section => section.entries) : filtered
const selected = entries.find(entry => entry.id === selectedId) ?? filtered[0]
@@ -195,6 +201,7 @@ export const CatalogBrowser = memo(function CatalogBrowser({
if (custom) {
return custom
}
+
const installed = isInstalled(entry)
return (
@@ -207,6 +214,7 @@ export const CatalogBrowser = memo(function CatalogBrowser({
if (kind === 'plugins') {
setDetailOpen(false)
}
+
onInstall(entry)
}}
/>
diff --git a/apps/desktop/src/app/capabilities/catalog/catalog-detail-dialog.tsx b/apps/desktop/src/app/capabilities/catalog/catalog-detail-dialog.tsx
index 0ce46b73ae2..e7c395f8707 100644
--- a/apps/desktop/src/app/capabilities/catalog/catalog-detail-dialog.tsx
+++ b/apps/desktop/src/app/capabilities/catalog/catalog-detail-dialog.tsx
@@ -34,6 +34,7 @@ export function CatalogDetailDialog({
if (!pageable) {
return
}
+
const index = order.findIndex(entry => entry.id === selectedId)
onSelect(order[(index + delta + order.length) % order.length].id)
}
@@ -82,6 +83,7 @@ export function CatalogDetailDialog({
) {
return
}
+
event.preventDefault()
step(event.key === 'ArrowLeft' ? -1 : 1)
}}
diff --git a/apps/desktop/src/app/capabilities/catalog/catalog-pointer.ts b/apps/desktop/src/app/capabilities/catalog/catalog-pointer.ts
index 5c1ce121cc0..436eb8631fa 100644
--- a/apps/desktop/src/app/capabilities/catalog/catalog-pointer.ts
+++ b/apps/desktop/src/app/capabilities/catalog/catalog-pointer.ts
@@ -25,6 +25,7 @@ export function trackCatalogPointer(root: HTMLElement) {
if (bottom < 0 || top > innerHeight) {
return
}
+
const px = Math.min(Math.max(x, left), right)
const py = Math.min(Math.max(y, top), bottom)
card.style.setProperty('--catalog-x', `${((px - left) / width) * 100}%`)
diff --git a/apps/desktop/src/app/capabilities/catalog/skill-catalog.tsx b/apps/desktop/src/app/capabilities/catalog/skill-catalog.tsx
index 18a89641d6e..49c3f0e1e0b 100644
--- a/apps/desktop/src/app/capabilities/catalog/skill-catalog.tsx
+++ b/apps/desktop/src/app/capabilities/catalog/skill-catalog.tsx
@@ -139,6 +139,7 @@ function ScopedSkillCatalog({
if (!skill.installed) {
continue
}
+
installedIdentifiers.add(skill.identifier)
const installed = installedByName.get(skill.name)
@@ -151,6 +152,7 @@ function ScopedSkillCatalog({
if (entry.source !== 'optional') {
return undefined
}
+
const identifier = entry.installIdentifier ?? entry.identifier
const exact = officialByIdentifier.get(identifier)
@@ -204,11 +206,13 @@ function ScopedSkillCatalog({
if (catalog.skillsById.has(entry.id) || catalog.skillsByName.has(entry.name)) {
return true
}
+
const matched = catalog.matchInstalled(entry)
if (matched && catalog.skillsById.has(matched.id)) {
return true
}
+
const optional = catalog.officialFor(entry)
return catalog.installedIdentifiers.has(optional?.identifier ?? entry.installIdentifier ?? entry.identifier)
diff --git a/apps/desktop/src/app/capabilities/plugins/plugins-tab.test.tsx b/apps/desktop/src/app/capabilities/plugins/plugins-tab.test.tsx
index b5cdd6f701e..19e5cf04343 100644
--- a/apps/desktop/src/app/capabilities/plugins/plugins-tab.test.tsx
+++ b/apps/desktop/src/app/capabilities/plugins/plugins-tab.test.tsx
@@ -737,6 +737,7 @@ describe('PluginsTab catalog UX', () => {
const card = screen
.getAllByRole('article')
.find(article => within(article).queryByRole('button', { name: 'demo-weather' }))!
+
const toggle = within(card).getByRole('switch', { name: 'demo-weather' })
expect(toggle.getAttribute('aria-checked')).toBe('true')
fireEvent.click(toggle)
diff --git a/apps/desktop/src/app/capabilities/plugins/plugins-tab.tsx b/apps/desktop/src/app/capabilities/plugins/plugins-tab.tsx
index d8d06819224..3eb38c632be 100644
--- a/apps/desktop/src/app/capabilities/plugins/plugins-tab.tsx
+++ b/apps/desktop/src/app/capabilities/plugins/plugins-tab.tsx
@@ -597,6 +597,7 @@ export const PluginsTab = memo(function PluginsTab({
(entry: CatalogEntry) => installedByCatalogName.get(entry.name),
[installedByCatalogName]
)
+
const isInstalled = (entry: CatalogEntry) => packageById.has(entry.id)
const handleAgentRemove = useCallback(
diff --git a/apps/desktop/src/app/capabilities/skills/skills-tab.tsx b/apps/desktop/src/app/capabilities/skills/skills-tab.tsx
index 2f003a31668..49085585629 100644
--- a/apps/desktop/src/app/capabilities/skills/skills-tab.tsx
+++ b/apps/desktop/src/app/capabilities/skills/skills-tab.tsx
@@ -79,6 +79,7 @@ function ScopedSkillsTab({
if (mutationBusy.current || installedPending || installedError || targets.length === 0) {
return
}
+
mutationBusy.current = true
setBusy(true)
let done = 0
@@ -90,8 +91,10 @@ function ScopedSkillsTab({
if (!mounted.current) {
break
}
+
const previous =
queryClient.getQueryData<SkillInfo[]>(skillsQueryKey(profile))?.find(skill => skill.name === row.name) ?? row
+
setSkills(current => current?.map(skill => (skill.name === row.name ? { ...skill, enabled } : skill)))
try {
@@ -147,6 +150,7 @@ function ScopedSkillsTab({
if (saving.current || skillEditor?.name === name) {
return
}
+
const request = ++editorRequest.current
try {
@@ -155,6 +159,7 @@ function ScopedSkillsTab({
if (!mounted.current || request !== editorRequest.current) {
return
}
+
setSkillEditor({ name })
setSkillDraft(node.content)
} catch (err) {
@@ -173,6 +178,7 @@ function ScopedSkillsTab({
if (!skillEditor || saving.current) {
return
}
+
const editor = skillEditor
const request = editorRequest.current
saving.current = true
@@ -184,6 +190,7 @@ function ScopedSkillsTab({
if (!result.ok) {
throw new Error(result.message)
}
+
void queryClient.invalidateQueries({ queryKey: ['skill-content', editor.name, profileScopeKey(profile)] })
void queryClient.invalidateQueries({ queryKey: skillsQueryKey(profile), exact: true })
invalidateSlashCompletions()
@@ -191,11 +198,13 @@ function ScopedSkillsTab({
if (!mounted.current) {
return
}
+
notify({ kind: 'success', title: t.skills.skillUpdated, message: t.skills.appliesToNewSessions(editor.name) })
if (request === editorRequest.current) {
setSkillEditor(null)
}
+
onRefresh()
} catch (err) {
if (mounted.current) {
diff --git a/apps/desktop/src/app/chat/composer/hooks/use-slash-completions.ts b/apps/desktop/src/app/chat/composer/hooks/use-slash-completions.ts
index 0f364c5ccd9..4e16dfa3787 100644
--- a/apps/desktop/src/app/chat/composer/hooks/use-slash-completions.ts
+++ b/apps/desktop/src/app/chat/composer/hooks/use-slash-completions.ts
@@ -238,8 +238,7 @@ export function useSlashCompletions(options: {
return { ...item, text: `${prefix}${argText}` }
})
.filter(
- item =>
- isArgCompletion || isDesktopSlashSuggestionWithOptions(item.text, { exactAlias: exactAliasQuery })
+ item => isArgCompletion || isDesktopSlashSuggestionWithOptions(item.text, { exactAlias: exactAliasQuery })
)
.map(item => ({
...item,
diff --git a/apps/desktop/src/app/chat/composer/hooks/use-voice-conversation.test.tsx b/apps/desktop/src/app/chat/composer/hooks/use-voice-conversation.test.tsx
index 446b603ac1c..288841f9ef3 100644
--- a/apps/desktop/src/app/chat/composer/hooks/use-voice-conversation.test.tsx
+++ b/apps/desktop/src/app/chat/composer/hooks/use-voice-conversation.test.tsx
@@ -79,11 +79,13 @@ interface HookProps {
busy: boolean
}
-function renderConversation(overrides: {
- onInterrupt?: () => void
- pendingResponse?: () => { id: string; pending: boolean; text: string } | null
- transcript?: string
-} = {}) {
+function renderConversation(
+ overrides: {
+ onInterrupt?: () => void
+ pendingResponse?: () => { id: string; pending: boolean; text: string } | null
+ transcript?: string
+ } = {}
+) {
const onInterrupt = overrides.onInterrupt ?? vi.fn()
// Mirrors the real app: submitting a turn makes the agent busy.
diff --git a/apps/desktop/src/app/chat/composer/hooks/use-voice-conversation.ts b/apps/desktop/src/app/chat/composer/hooks/use-voice-conversation.ts
index 6deab067fc6..278f42ecaee 100644
--- a/apps/desktop/src/app/chat/composer/hooks/use-voice-conversation.ts
+++ b/apps/desktop/src/app/chat/composer/hooks/use-voice-conversation.ts
@@ -142,7 +142,6 @@ export function useVoiceConversation({
// a torn-down window).
const cancelFallbackPollRef = useRef<(() => void) | null>(null)
-
useEffect(() => () => cancelFallbackPollRef.current?.(), [])
const clearTurnTimeout = () => {
diff --git a/apps/desktop/src/app/chat/hooks/use-composer-actions.ts b/apps/desktop/src/app/chat/hooks/use-composer-actions.ts
index df261df5acb..cc8b9427191 100644
--- a/apps/desktop/src/app/chat/hooks/use-composer-actions.ts
+++ b/apps/desktop/src/app/chat/hooks/use-composer-actions.ts
@@ -84,10 +84,7 @@ async function queuedAttachmentPreview(filePath: string): Promise<{ previewUrl:
* Object URLs skip that read; path-only attaches (paperclip) still fall back
* to the IPC data-URL path.
*/
-export async function resolveImageAttachmentPreview(
- filePath: string,
- previewSource?: Blob | null
-): Promise<string> {
+export async function resolveImageAttachmentPreview(filePath: string, previewSource?: Blob | null): Promise<string> {
if (previewSource && previewSource.size > 0) {
return URL.createObjectURL(previewSource)
}
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 e93de5b2ee9..6bae5752db4 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
@@ -238,6 +238,7 @@ describe('actOnActivePreview (drive_preview tool)', () => {
})
const result = await actOnActivePreview({ kind: 'type', ref: '@e1', text: 'abcdefghij' }, controller.signal)
+
const chars = send.mock.calls
.map(([event]) => event)
.filter(event => event.type === 'char')
diff --git a/apps/desktop/src/app/chat/session-tile.tsx b/apps/desktop/src/app/chat/session-tile.tsx
index 99ca5f4b51c..1ba8f08ef4c 100644
--- a/apps/desktop/src/app/chat/session-tile.tsx
+++ b/apps/desktop/src/app/chat/session-tile.tsx
@@ -131,7 +131,10 @@ export function tileBackendIdentityChanged(
export function unbindTilesForBackendIdentityChange<
T extends { error?: string; ownerRoute?: { connectionId?: string }; runtimeId?: string }
->(tiles: readonly T[], activeConnection: { connectionId?: string | null; mode?: string | null } | null | undefined): T[] {
+>(
+ tiles: readonly T[],
+ activeConnection: { connectionId?: string | null; mode?: string | null } | null | undefined
+): T[] {
let changed = false
const next = tiles.map(tile => {
@@ -526,6 +529,7 @@ export function SessionTilePane({ storedSessionId }: { storedSessionId: string }
const durableSession = await resolveStoredSession(storedSessionId, ownerRoute).catch(() => undefined)
const current = $sessionTiles.get().find(candidate => candidate.storedSessionId === storedSessionId)
const identityChanged = tileBackendIdentityChanged(ownerRoute?.connectionId, $connection.get())
+
const error = sessionTileResumeFailure(
message,
Boolean(durableSession),
diff --git a/apps/desktop/src/app/chat/sidebar/profile-switcher.tsx b/apps/desktop/src/app/chat/sidebar/profile-switcher.tsx
index 20e16d086e1..d341580de5f 100644
--- a/apps/desktop/src/app/chat/sidebar/profile-switcher.tsx
+++ b/apps/desktop/src/app/chat/sidebar/profile-switcher.tsx
@@ -156,10 +156,7 @@ function profileStatusLabel(p: Translations['profiles'], summary: ProfileDotSumm
* (gateway, profile) the square names. `connectionId` is null for this
* machine's primary. The interned summaries keep the selector's bail-out
* intact: a square re-renders only when its own counts change. */
-function useProfileStatus(
- profile: null | string,
- connectionId: null | string | undefined
-): ProfileDotSummary | null {
+function useProfileStatus(profile: null | string, connectionId: null | string | undefined): ProfileDotSummary | null {
return useStoreSelector($profileDotStateByScope, byScope =>
profile ? (profileDotSummaryFor(byScope, connectionId, profile) ?? null) : null
)
diff --git a/apps/desktop/src/app/chat/sidebar/project-filter.ts b/apps/desktop/src/app/chat/sidebar/project-filter.ts
index 4c1fc894fa6..162a6889a50 100644
--- a/apps/desktop/src/app/chat/sidebar/project-filter.ts
+++ b/apps/desktop/src/app/chat/sidebar/project-filter.ts
@@ -32,7 +32,5 @@ export function resolveLiveProjectFilter(
export function filterToSessionBearingProjects<
T extends { isAuto?: boolean; isNoProject?: boolean; sessionCount?: number }
>(projects: readonly T[]): T[] {
- return projects.filter(
- project => !project.isAuto || project.isNoProject || (project.sessionCount ?? 0) > 0
- )
+ return projects.filter(project => !project.isAuto || project.isNoProject || (project.sessionCount ?? 0) > 0)
}
diff --git a/apps/desktop/src/app/contrib/hooks/remembered-session.ts b/apps/desktop/src/app/contrib/hooks/remembered-session.ts
index 3b4a2ac7f6b..450989bcb34 100644
--- a/apps/desktop/src/app/contrib/hooks/remembered-session.ts
+++ b/apps/desktop/src/app/contrib/hooks/remembered-session.ts
@@ -20,5 +20,5 @@ export async function resolveRememberedSessionId(
): Promise<null | string> {
const session = await getSession(id)
- return session.source === 'subagent' ? session.parent_session_id ?? null : session.id
+ return session.source === 'subagent' ? (session.parent_session_id ?? null) : session.id
}
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 7d08c86172c..c7ce8d050e1 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
@@ -310,7 +310,9 @@ describe('useDesktopIntegrations', () => {
})
it('keeps remembering a /branch child: source, not parenthood, is the discriminator', () => {
- const sessions = [session({ id: 'branch-child', parent_session_id: 'parent-session', profile: 'default', source: 'tui' })]
+ const sessions = [
+ session({ id: 'branch-child', parent_session_id: 'parent-session', profile: 'default', source: 'tui' })
+ ]
render({ locationPathname: '/branch-child', profileReady: true, routedSessionId: 'branch-child', sessions })
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 e96b85b2037..4680537f1c8 100644
--- a/apps/desktop/src/app/contrib/hooks/use-desktop-integrations.ts
+++ b/apps/desktop/src/app/contrib/hooks/use-desktop-integrations.ts
@@ -45,10 +45,7 @@ import { appViewForPath, isOverlayView, NEW_CHAT_ROUTE, routeSessionId, sessionR
import { resolveRememberedSessionId } from './remembered-session'
-type RememberedSession = Pick<
- SessionInfo,
- '_lineage_root_id' | 'id' | 'parent_session_id' | 'profile' | 'source'
->
+type RememberedSession = Pick<SessionInfo, '_lineage_root_id' | 'id' | 'parent_session_id' | 'profile' | 'source'>
interface DesktopIntegrationsParams {
activeProfile: string
@@ -178,8 +175,8 @@ export function useDesktopIntegrations({
// the discriminator. A listed row carries its source, so the guard is
// synchronous there; an unlisted id resolves by id below.
const rowFor = (id: string) => sessions.find(session => sessionMatchesStoredId(session, id))
- const restorableRouteSession =
- routeSession && rowFor(routeSession)?.source !== 'subagent' ? routeSession : null
+
+ const restorableRouteSession = routeSession && rowFor(routeSession)?.source !== 'subagent' ? routeSession : null
if (
route &&
@@ -249,6 +246,7 @@ export function useDesktopIntegrations({
// `/branch` children also carry parent_session_id but ARE user-facing —
// source, not parenthood, is the discriminator.
const routedRow = sessions.find(session => sessionMatchesStoredId(session, routedSessionId))
+
const rememberedSessionId =
routedRow?.source === 'subagent' ? routedRow.parent_session_id || null : routedSessionId
diff --git a/apps/desktop/src/app/contrib/onboarding-kickoff.ts b/apps/desktop/src/app/contrib/onboarding-kickoff.ts
index 0153565bd77..34a1a6402f8 100644
--- a/apps/desktop/src/app/contrib/onboarding-kickoff.ts
+++ b/apps/desktop/src/app/contrib/onboarding-kickoff.ts
@@ -204,7 +204,13 @@ export function useOnboardingKickoff({
// Set the title explicitly so the backend does not name the session after the hidden runbook message.
await guideRequest('session.title', { session_id: runtimeId, title: SETUP_CHAT_TITLE }).catch(() => undefined)
- await adoptGuideSession(setupProfile, { id: storedId ?? runtimeId }, record.free_tier, resumeSession, guideRequest)
+ await adoptGuideSession(
+ setupProfile,
+ { id: storedId ?? runtimeId },
+ record.free_tier,
+ resumeSession,
+ guideRequest
+ )
return true
} catch (error) {
diff --git a/apps/desktop/src/app/hooks/use-config-record.test.tsx b/apps/desktop/src/app/hooks/use-config-record.test.tsx
index 681ca3beaf4..3fe33bdc62b 100644
--- a/apps/desktop/src/app/hooks/use-config-record.test.tsx
+++ b/apps/desktop/src/app/hooks/use-config-record.test.tsx
@@ -62,6 +62,7 @@ it('does not share one config record across two gateways', async () => {
const laptop = { display: { theme: 'dark' } }
const devbox = { display: { theme: 'light' } }
let releaseDevbox: (record: typeof devbox) => void = () => undefined
+
const devboxFetch = new Promise<typeof devbox>(resolve => {
releaseDevbox = resolve
})
diff --git a/apps/desktop/src/app/hooks/use-config-record.ts b/apps/desktop/src/app/hooks/use-config-record.ts
index 478cc3eac05..53c5d0240cf 100644
--- a/apps/desktop/src/app/hooks/use-config-record.ts
+++ b/apps/desktop/src/app/hooks/use-config-record.ts
@@ -69,6 +69,7 @@ export const useHermesConfigRecord = (profile?: ProfileScope) => {
// getter-based key would freeze on the first gateway and keep serving its
// record after a switch.
const connectionId = useStore($activeConnectionId)
+
const query = useQuery({
queryKey: hermesConfigKey(profile, connectionId),
// null/undefined both mean "no override" → fetch with undefined so
diff --git a/apps/desktop/src/app/hud/resize-frame.test.tsx b/apps/desktop/src/app/hud/resize-frame.test.tsx
index 735a5db73e9..b3723f39b86 100644
--- a/apps/desktop/src/app/hud/resize-frame.test.tsx
+++ b/apps/desktop/src/app/hud/resize-frame.test.tsx
@@ -40,6 +40,7 @@ describe('HudShell resize-frame engagement gates', () => {
<HudShell />
</MemoryRouter>
)
+
const shell = shellOf(container)
expect(shell.hasAttribute('data-hud-typing')).toBe(false)
@@ -61,6 +62,7 @@ describe('HudShell resize-frame engagement gates', () => {
<HudShell />
</MemoryRouter>
)
+
const shell = shellOf(container)
// useHudGlass stamps data-hud-typing live from the :focus query — the
diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/compaction-event.test.tsx b/apps/desktop/src/app/session/hooks/use-message-stream/compaction-event.test.tsx
index d0498fd596c..41db16bdec1 100644
--- a/apps/desktop/src/app/session/hooks/use-message-stream/compaction-event.test.tsx
+++ b/apps/desktop/src/app/session/hooks/use-message-stream/compaction-event.test.tsx
@@ -3,7 +3,12 @@ import { act, cleanup } from '@testing-library/react'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { createClientSessionState } from '@/lib/chat-runtime'
-import { $compactingSessions, markCompressDeferred, setSessionCompacting, takeCompressDeferred } from '@/store/compaction'
+import {
+ $compactingSessions,
+ markCompressDeferred,
+ setSessionCompacting,
+ takeCompressDeferred
+} from '@/store/compaction'
import { $notifications, clearNotifications } from '@/store/notifications'
import { type MessageStreamHarness, renderMessageStream } from './test-harness'
diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/fallback-switch.test.ts b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/fallback-switch.test.ts
index 43f415fd7a0..eed90e94f1b 100644
--- a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/fallback-switch.test.ts
+++ b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/fallback-switch.test.ts
@@ -7,7 +7,9 @@ function statusContext(text: string, kind = 'lifecycle') {
const updateSessionState = vi.fn((_id: string, updater: (state: { messages: unknown[] }) => unknown) =>
updater({ messages: [] })
)
+
const payload = { kind, text } as GatewayEventContext['payload']
+
const ctx: GatewayEventContext = {
deps: {
compactedTurnRef: { current: new Set<string>() },
@@ -33,7 +35,8 @@ function statusContext(text: string, kind = 'lifecycle') {
function systemText(updateSessionState: ReturnType<typeof statusContext>['updateSessionState']): string {
const updater = updateSessionState.mock.calls[0]?.[1]
- const next = updater?.({ messages: [] }) as { messages: Array<{ parts: Array<{ text?: string }>; role: string }> } | undefined
+ const next = updater?.({ messages: [] }) as
+ { messages: Array<{ parts: Array<{ text?: string }>; role: string }> } | undefined
return next?.messages.find(message => message.role === 'system')?.parts[0]?.text ?? ''
}
@@ -44,7 +47,8 @@ afterEach(() => {
describe('desktop fallback switch', () => {
it('shows a model fallback switch in the transcript', () => {
- const notice = '⚠️ Model fallback: wan2.7-image-pro via alibaba-token-plan unavailable (bad request); using qwen3.8-max via alibaba-token-plan.'
+ const notice =
+ '⚠️ Model fallback: wan2.7-image-pro via alibaba-token-plan unavailable (bad request); using qwen3.8-max via alibaba-token-plan.'
const { ctx, updateSessionState } = statusContext(notice)
expect(handleStatusEvent(ctx)).toBe(true)
diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/transformed-final.test.tsx b/apps/desktop/src/app/session/hooks/use-message-stream/transformed-final.test.tsx
index dd6bff1f93e..e7e3a622510 100644
--- a/apps/desktop/src/app/session/hooks/use-message-stream/transformed-final.test.tsx
+++ b/apps/desktop/src/app/session/hooks/use-message-stream/transformed-final.test.tsx
@@ -37,6 +37,7 @@ function getState(): ClientSessionState {
function assistantTexts(): string[] {
const state = getState()
+
return state.messages
.filter(m => m.role === 'assistant' && !m.hidden)
.map(m => chatMessageText(m))
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 cbb1b97353f..1a82102dcfb 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
@@ -1169,7 +1169,10 @@ describe('usePromptActions /background', () => {
await handle!.submitText('/background anything')
- expect(requestGateway).toHaveBeenCalledWith('slash.exec', expect.objectContaining({ command: 'background anything' }))
+ expect(requestGateway).toHaveBeenCalledWith(
+ 'slash.exec',
+ expect.objectContaining({ command: 'background anything' })
+ )
expect(renderedSeedTexts(seeds).some(text => text.includes('legacy gateway'))).toBe(true)
})
})
diff --git a/apps/desktop/src/app/session/hooks/use-prompt-actions/submit-view-binding.test.ts b/apps/desktop/src/app/session/hooks/use-prompt-actions/submit-view-binding.test.ts
index 0098177af74..62d88d5a58d 100644
--- a/apps/desktop/src/app/session/hooks/use-prompt-actions/submit-view-binding.test.ts
+++ b/apps/desktop/src/app/session/hooks/use-prompt-actions/submit-view-binding.test.ts
@@ -51,10 +51,7 @@ function bindPane({
sessions?: SessionInfo[]
targetStoredSessionId?: string
}): BoundPaneResult {
- const earlier: ChatMessage[] = [
- row('u1', 'user', 'earlier prompt'),
- row('a1', 'assistant', 'earlier reply')
- ]
+ const earlier: ChatMessage[] = [row('u1', 'user', 'earlier prompt'), row('a1', 'assistant', 'earlier reply')]
const paneState: ClientSessionState = { ...createClientSessionState(paneStoredSessionId), messages: earlier }
@@ -62,11 +59,7 @@ function bindPane({
[RESUMED_RUNTIME, createClientSessionState(targetStoredSessionId)]
])
- const updateSessionState: ResumedRuntimeBindingDeps['updateSessionState'] = (
- sessionId,
- updater,
- storedSessionId
- ) => {
+ const updateSessionState: ResumedRuntimeBindingDeps['updateSessionState'] = (sessionId, updater, storedSessionId) => {
const current = states.get(sessionId) ?? createClientSessionState(storedSessionId)
const updated = updater(current)
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 cfa405bf23f..6a991ac1113 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
@@ -38,7 +38,10 @@ import {
import { $sessionStates } from '@/store/session-states'
import type { SessionInfo } from '@/types/hermes'
-import { profileScopeForTranscriptSession, resolveActiveTranscriptSession } from '../../../contrib/hooks/use-background-sync'
+import {
+ profileScopeForTranscriptSession,
+ resolveActiveTranscriptSession
+} from '../../../contrib/hooks/use-background-sync'
import type { ClientSessionState } from '../../../types'
import { sessionContextDrift } from '../session-context-drift'
import { resolveSessionProfile } from '../use-session-actions/utils'
@@ -434,7 +437,6 @@ export function useSubmitPrompt(deps: SubmitPromptDeps) {
}
}
-
// Idempotent optimistic insert — re-running with the resolved sessionId
// after createBackendSessionForSend just overwrites with the same id.
const seedOptimistic = (sid: string) => {
@@ -508,6 +510,7 @@ export function useSubmitPrompt(deps: SubmitPromptDeps) {
// unless a rejected-submit restore already re-loaded the attachments
// into the composer, which re-owns those URLs (#63682 handoff).
revokeDiscardedAttachmentPreviews(attachments, usingComposerAttachments ? $composerAttachments.get() : [])
+
if (!sid) {
if (targetIsCurrentView()) {
scope.setMessages(current => current.filter(m => m.id !== optimisticId))
@@ -834,9 +837,7 @@ export function useSubmitPrompt(deps: SubmitPromptDeps) {
const refreshed = await refreshIfTranscriptStale(guardStoredId, localSnapshot.messages, {
excludeMessageId: optimisticId,
- profile: profileScopeForTranscriptSession(
- resolveActiveTranscriptSession(guardStoredId, liveSessionId)
- )
+ profile: profileScopeForTranscriptSession(resolveActiveTranscriptSession(guardStoredId, liveSessionId))
})
if (sessionDriftReason()) {
diff --git a/apps/desktop/src/app/session/hooks/use-session-actions/resolve-stored-session.test.ts b/apps/desktop/src/app/session/hooks/use-session-actions/resolve-stored-session.test.ts
index fcab3f99e28..0ad61c36569 100644
--- a/apps/desktop/src/app/session/hooks/use-session-actions/resolve-stored-session.test.ts
+++ b/apps/desktop/src/app/session/hooks/use-session-actions/resolve-stored-session.test.ts
@@ -270,10 +270,11 @@ describe('resolveStoredSession profile ownership', () => {
})
)
- const pending = resolveStoredSession(
- 's1',
- { connectionId: 'remote-1', profile: 'meta', targetProfile: 'meta' } as never
- )
+ const pending = resolveStoredSession('s1', {
+ connectionId: 'remote-1',
+ profile: 'meta',
+ targetProfile: 'meta'
+ } as never)
tombstoneSessions(['s1'])
untombstoneSessions(['s1'])
diff --git a/apps/desktop/src/app/session/hooks/use-transcript-peer-sync.ts b/apps/desktop/src/app/session/hooks/use-transcript-peer-sync.ts
index ece07410b7a..e5c71f1790d 100644
--- a/apps/desktop/src/app/session/hooks/use-transcript-peer-sync.ts
+++ b/apps/desktop/src/app/session/hooks/use-transcript-peer-sync.ts
@@ -44,12 +44,7 @@ export function useTranscriptPeerSync({
const selected = selectedStoredSessionIdRef.current
const runtimeId = activeSessionIdRef.current
- if (
- !cancelled &&
- selected === storedSessionId &&
- runtimeId &&
- !busyRef.current
- ) {
+ if (!cancelled && selected === storedSessionId && runtimeId && !busyRef.current) {
await hydrateStoredSessionTranscript({
attempts: 1,
runtimeSessionId: runtimeId,
diff --git a/apps/desktop/src/app/settings/model-settings.tsx b/apps/desktop/src/app/settings/model-settings.tsx
index 43f196caff7..6aae8ebca23 100644
--- a/apps/desktop/src/app/settings/model-settings.tsx
+++ b/apps/desktop/src/app/settings/model-settings.tsx
@@ -295,13 +295,12 @@ export function ModelSettings({ onMainModelChanged, scopeProfile, subpage }: Mod
// hits the configured provider, which can be unreachable) must not
// block the config-backed sections — auxiliary and MOA are fast
// config-file reads — behind a single all-or-nothing Promise.all.
- const [modelInfoResult, modelOptionsResult, auxiliaryModelsResult, moaModelsResult] =
- await Promise.allSettled([
- getGlobalModelInfo(scopeProfile),
- getGlobalModelOptions(undefined, scopeProfile),
- getAuxiliaryModels(scopeProfile),
- getMoaModels(scopeProfile)
- ])
+ const [modelInfoResult, modelOptionsResult, auxiliaryModelsResult, moaModelsResult] = await Promise.allSettled([
+ getGlobalModelInfo(scopeProfile),
+ getGlobalModelOptions(undefined, scopeProfile),
+ getAuxiliaryModels(scopeProfile),
+ getMoaModels(scopeProfile)
+ ])
if (profileEpoch.current !== epoch) {
return
diff --git a/apps/desktop/src/app/settings/providers-settings.test.tsx b/apps/desktop/src/app/settings/providers-settings.test.tsx
index b90dd723d68..8983967182f 100644
--- a/apps/desktop/src/app/settings/providers-settings.test.tsx
+++ b/apps/desktop/src/app/settings/providers-settings.test.tsx
@@ -125,6 +125,7 @@ describe('ProvidersSettings', () => {
}))
)
getEnvVars.mockResolvedValue({ WIDGET_API_KEY: keyVar({ provider: 'widget', provider_label: 'Widget' }) })
+
try {
const { container } = render(<ProvidersSettings onClose={vi.fn()} onViewChange={vi.fn()} view="keys" />)
await screen.findByText('Widget')
diff --git a/apps/desktop/src/app/settings/providers-settings.tsx b/apps/desktop/src/app/settings/providers-settings.tsx
index 135882e2633..3334bc2e2cc 100644
--- a/apps/desktop/src/app/settings/providers-settings.tsx
+++ b/apps/desktop/src/app/settings/providers-settings.tsx
@@ -463,6 +463,7 @@ export function ProvidersSettings({
if (!result?.ok) {
notifyError(new Error('No stored credentials were removed'), t.settings.providers.failedRemove(name))
+
return
}
diff --git a/apps/desktop/src/app/shell/hooks/use-statusbar-items.test.tsx b/apps/desktop/src/app/shell/hooks/use-statusbar-items.test.tsx
index c4c0523bcf6..00f9c604e27 100644
--- a/apps/desktop/src/app/shell/hooks/use-statusbar-items.test.tsx
+++ b/apps/desktop/src/app/shell/hooks/use-statusbar-items.test.tsx
@@ -194,7 +194,6 @@ describe('statusbar session timer — focused since (#103123)', () => {
})
})
-
describe('useStatusbarItems session timer — runtime cache anchor', () => {
it("anchors a focused branch tile to its runtime cache instead of the parent's stored age", () => {
const parentRowStartedAt = 1_600_000_000
diff --git a/apps/desktop/src/app/shell/model-menu-panel.test.tsx b/apps/desktop/src/app/shell/model-menu-panel.test.tsx
index d6e3e92370c..6d0505c57e8 100644
--- a/apps/desktop/src/app/shell/model-menu-panel.test.tsx
+++ b/apps/desktop/src/app/shell/model-menu-panel.test.tsx
@@ -170,9 +170,7 @@ describe('ModelMenuPanel search', () => {
const rowWithText = (content: ReturnType<typeof renderPanel>['content'], pattern: RegExp) =>
content.queryByText(
(_, element) =>
- element?.tagName === 'SPAN' &&
- !element.querySelector('span') &&
- pattern.test(element.textContent ?? '')
+ element?.tagName === 'SPAN' && !element.querySelector('span') && pattern.test(element.textContent ?? '')
)
it('hides the non-matching current model while a query is active', async () => {
diff --git a/apps/desktop/src/components/assistant-ui/catalog-advanced-dialog.tsx b/apps/desktop/src/components/assistant-ui/catalog-advanced-dialog.tsx
index 4d0171de74c..f3a725cac9a 100644
--- a/apps/desktop/src/components/assistant-ui/catalog-advanced-dialog.tsx
+++ b/apps/desktop/src/components/assistant-ui/catalog-advanced-dialog.tsx
@@ -62,6 +62,7 @@ function installEnv(options: InstallEnvOptions): InstallEnv {
force: flag(options.force),
target_profile: options.targetProfile
}
+
if (options.kind === 'skill') {
return env
}
@@ -267,10 +268,7 @@ function InstallControls(props: InstallControlsProps) {
<Section title={props.m.includesHeading}>
<div className="grid gap-2 rounded-lg border border-(--ui-stroke-tertiary) px-3 py-2">
<label className="flex items-start gap-3">
- <Checkbox
- checked={props.agentHalf}
- onCheckedChange={value => props.onAgentHalfChange(value === true)}
- />
+ <Checkbox checked={props.agentHalf} onCheckedChange={value => props.onAgentHalfChange(value === true)} />
<span className="font-medium text-foreground">{props.m.agentLabel}</span>
</label>
<label className="grid gap-1 pl-7">
@@ -280,16 +278,11 @@ function InstallControls(props: InstallControlsProps) {
</div>
{props.hasDesktopHalf ? (
<label className="flex items-start gap-3 rounded-lg border border-(--ui-stroke-tertiary) px-3 py-2">
- <Checkbox
- checked={props.desktopHalf}
- onCheckedChange={value => props.onDesktopHalfChange(value === true)}
- />
+ <Checkbox checked={props.desktopHalf} onCheckedChange={value => props.onDesktopHalfChange(value === true)} />
<span className="font-medium text-foreground">{props.m.desktopLabel}</span>
</label>
) : null}
- {props.nothingSelected ? (
- <p className={cn(CAPTION, 'text-destructive')}>{props.m.selectComponent}</p>
- ) : null}
+ {props.nothingSelected ? <p className={cn(CAPTION, 'text-destructive')}>{props.m.selectComponent}</p> : null}
</Section>
) : (
<label className="grid gap-1">
@@ -305,11 +298,7 @@ function InstallControls(props: InstallControlsProps) {
{props.plugin ? (
<label className="flex items-center justify-between gap-3">
<span className={cn(CAPTION, 'text-foreground')}>{props.m.enableAgent}</span>
- <Switch
- checked={props.enable}
- disabled={!props.agentHalf}
- onCheckedChange={props.onEnableChange}
- />
+ <Switch checked={props.enable} disabled={!props.agentHalf} onCheckedChange={props.onEnableChange} />
</label>
) : null}
<label className="flex items-center justify-between gap-3">
diff --git a/apps/desktop/src/components/assistant-ui/catalog-install-tool.tsx b/apps/desktop/src/components/assistant-ui/catalog-install-tool.tsx
index 8c981821059..f5aa189042b 100644
--- a/apps/desktop/src/components/assistant-ui/catalog-install-tool.tsx
+++ b/apps/desktop/src/components/assistant-ui/catalog-install-tool.tsx
@@ -39,6 +39,7 @@ const KIND_GLYPH = { plugin: Plug, skill: Book } as const
function platformName(platform: string): string {
switch (platform.toLowerCase()) {
case 'darwin':
+
case 'macos':
return 'macOS'
diff --git a/apps/desktop/src/components/assistant-ui/markdown-text.prose-safety.test.tsx b/apps/desktop/src/components/assistant-ui/markdown-text.prose-safety.test.tsx
index bcf4220e4d8..8a0e49b9521 100644
--- a/apps/desktop/src/components/assistant-ui/markdown-text.prose-safety.test.tsx
+++ b/apps/desktop/src/components/assistant-ui/markdown-text.prose-safety.test.tsx
@@ -39,6 +39,7 @@ describe('markdown prose renders tilde ranges and unknown tags literally', () =>
const text =
'The proxy wraps calls in <tool_call> and results in <observation> blocks. ' +
'Keep the rest visible after the tag. The message tail must NOT vanish.'
+
const { container } = render(<MarkdownTextContent isRunning={false} text={text} />)
expect(container.textContent).toContain('<tool_call>')
@@ -49,9 +50,7 @@ describe('markdown prose renders tilde ranges and unknown tags literally', () =>
})
it('leaves math comparisons untouched', () => {
- const { container } = render(
- <MarkdownTextContent isRunning={false} text={'如果 a < b 且 2<3 则原样保留。'} />
- )
+ const { container } = render(<MarkdownTextContent isRunning={false} text={'如果 a < b 且 2<3 则原样保留。'} />)
expect(container.textContent).toContain('a < b')
expect(container.textContent).toContain('2<3')
diff --git a/apps/desktop/src/components/assistant-ui/markdown-text.test.ts b/apps/desktop/src/components/assistant-ui/markdown-text.test.ts
index 3fda5aa94a2..cbe9d479fce 100644
--- a/apps/desktop/src/components/assistant-ui/markdown-text.test.ts
+++ b/apps/desktop/src/components/assistant-ui/markdown-text.test.ts
@@ -543,7 +543,8 @@ describe('preprocessMarkdown', () => {
// punctuation, so remark-math reads it as a literal dollar and the sentence
// renders as prose with recoverable copy-out.
it('does not pair two bare dollars around CJK prose as inline math (#103546)', () => {
- const input = '...的经典嫌疑是 **$connection 被别的写者整包覆盖**(丢了 `isFullscreen` 字段)...搜 `$connection` 的所有写者:'
+ const input =
+ '...的经典嫌疑是 **$connection 被别的写者整包覆盖**(丢了 `isFullscreen` 字段)...搜 `$connection` 的所有写者:'
const output = preprocessMarkdown(input)
diff --git a/apps/desktop/src/components/assistant-ui/thread/list-session-scroll.test.tsx b/apps/desktop/src/components/assistant-ui/thread/list-session-scroll.test.tsx
index 15eb4611c32..a37e8cad504 100644
--- a/apps/desktop/src/components/assistant-ui/thread/list-session-scroll.test.tsx
+++ b/apps/desktop/src/components/assistant-ui/thread/list-session-scroll.test.tsx
@@ -132,6 +132,7 @@ describe('list session-scroll restore', () => {
// so streamed growth paints at the stale scrollTop and the viewport drifts
// up before the re-pin. The transcript ResizeObserver closes that frame.
const previousObserver = globalThis.ResizeObserver
+
const observers = new Set<{
callback: ResizeObserverCallback
targets: Set<Element>
@@ -254,6 +255,7 @@ describe('list session-scroll restore', () => {
const { container, unmount } = render(
<ScrollHarness clampToComposer isRunning messages={sessionMessages('clr')} sessionKey="clr" />
)
+
const vp = viewportEl(container)
const clearance = vp.querySelector('[data-slot="aui_composer-clearance"]')
diff --git a/apps/desktop/src/components/assistant-ui/tool/approval.test.tsx b/apps/desktop/src/components/assistant-ui/tool/approval.test.tsx
index 3a603a0c3c3..c14b65771a1 100644
--- a/apps/desktop/src/components/assistant-ui/tool/approval.test.tsx
+++ b/apps/desktop/src/components/assistant-ui/tool/approval.test.tsx
@@ -6,7 +6,13 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vite
import type { HermesGateway } from '@/hermes'
import { handleApprovalKey, releaseApprovalKey } from '@/lib/keybinds/approval-keys'
import { $gateway } from '@/store/gateway'
-import { $approvalRequest, APPROVAL_RESPOND_REQUEST_TIMEOUT_MS, clearAllPrompts, sessionApprovalRequests, setApprovalRequest } from '@/store/prompts'
+import {
+ $approvalRequest,
+ APPROVAL_RESPOND_REQUEST_TIMEOUT_MS,
+ clearAllPrompts,
+ sessionApprovalRequests,
+ setApprovalRequest
+} from '@/store/prompts'
import { hasOpenServerRequest, rememberServerRequest, resetServerRequestsForTests } from '@/store/server-requests'
import { $activeSessionId } from '@/store/session'
import { stubMenuDomApis, stubResizeObserver } from '@/test/jsdom'
@@ -88,12 +94,13 @@ describe('PendingApprovalStack', () => {
// the description. The card must show what would actually run.
setRequest('<terminal> (plugin approval rule)', undefined, { requestId: 'apr-synth' })
// setRequest stamps a generic description; overwrite with the plugin one.
- $approvalRequest.get() && setApprovalRequest({
- command: '<terminal> (plugin approval rule)',
- description: 'Plugin requires approval for terminal: run\npwd',
- requestId: 'apr-synth',
- sessionId: 'sess-1'
- })
+ $approvalRequest.get() &&
+ setApprovalRequest({
+ command: '<terminal> (plugin approval rule)',
+ description: 'Plugin requires approval for terminal: run\npwd',
+ requestId: 'apr-synth',
+ sessionId: 'sess-1'
+ })
render(<PendingApprovalStack />)
expect(screen.getByText(/Plugin requires approval for terminal: run/)).toBeTruthy()
diff --git a/apps/desktop/src/components/assistant-ui/tool/approval.tsx b/apps/desktop/src/components/assistant-ui/tool/approval.tsx
index 03184dc3b50..72d90f58d29 100644
--- a/apps/desktop/src/components/assistant-ui/tool/approval.tsx
+++ b/apps/desktop/src/components/assistant-ui/tool/approval.tsx
@@ -281,8 +281,9 @@ const ApprovalCard: FC<ApprovalCardProps> = ({ request, total, position, stack }
// on otherwise. Show the description whenever the command is missing or one
// of these synthetic labels; a real command keeps rendering as the command.
const SYNTHETIC_COMMAND_RE = /^<[^>]+> \(/
- const showsDescription =
- !hasCommand || SYNTHETIC_COMMAND_RE.test(request.command.trim())
+
+ const showsDescription = !hasCommand || SYNTHETIC_COMMAND_RE.test(request.command.trim())
+
const details = showsDescription ? request.description.trim() : request.command.trim()
const respond = useCallback(
diff --git a/apps/desktop/src/components/assistant-ui/tool/delegate.test.tsx b/apps/desktop/src/components/assistant-ui/tool/delegate.test.tsx
index a70f9f76f8a..6d1b50cdc6e 100644
--- a/apps/desktop/src/components/assistant-ui/tool/delegate.test.tsx
+++ b/apps/desktop/src/components/assistant-ui/tool/delegate.test.tsx
@@ -37,7 +37,11 @@ function renderCard() {
return render(
<I18nProvider configClient={null} initialLocale="en">
<SessionViewProvider value={view()}>
- <DelegateTool args={{ tasks: [{ goal: 'Inspect the delegate card' }] }} result={undefined} toolCallId="call-1" />
+ <DelegateTool
+ args={{ tasks: [{ goal: 'Inspect the delegate card' }] }}
+ result={undefined}
+ toolCallId="call-1"
+ />
</SessionViewProvider>
</I18nProvider>
)
diff --git a/apps/desktop/src/components/boot-failure-overlay.tsx b/apps/desktop/src/components/boot-failure-overlay.tsx
index 0aff6a0bd86..673c914a90b 100644
--- a/apps/desktop/src/components/boot-failure-overlay.tsx
+++ b/apps/desktop/src/components/boot-failure-overlay.tsx
@@ -353,9 +353,7 @@ export function BootFailureOverlay() {
notify({
kind: 'warning',
title: t.boot.failure.signInIncompleteTitle,
- message: error
- ? `${t.boot.failure.signInIncompleteMessage}: ${error}`
- : t.boot.failure.signInIncompleteMessage
+ message: error ? `${t.boot.failure.signInIncompleteMessage}: ${error}` : t.boot.failure.signInIncompleteMessage
})
} catch (err) {
notifyError(err, t.boot.failure.signInFailed)
diff --git a/apps/desktop/src/components/chat/zoomable-image.tsx b/apps/desktop/src/components/chat/zoomable-image.tsx
index 75270683cc7..d837ccb7008 100644
--- a/apps/desktop/src/components/chat/zoomable-image.tsx
+++ b/apps/desktop/src/components/chat/zoomable-image.tsx
@@ -23,7 +23,15 @@ export interface ImageActionCopy {
savingImage: string
}
-export function ZoomableImage({ className, containerClassName, src, zoomSrc, alt, slot, ...props }: ZoomableImageProps) {
+export function ZoomableImage({
+ className,
+ containerClassName,
+ src,
+ zoomSrc,
+ alt,
+ slot,
+ ...props
+}: ZoomableImageProps) {
const { t } = useI18n()
const copy = t.desktop
// The lightbox and Save action prefer the full-resolution source; the inline
diff --git a/apps/desktop/src/components/onboarding/index.test.tsx b/apps/desktop/src/components/onboarding/index.test.tsx
index ae2e5d698f9..824596c659a 100644
--- a/apps/desktop/src/components/onboarding/index.test.tsx
+++ b/apps/desktop/src/components/onboarding/index.test.tsx
@@ -107,7 +107,15 @@ describe('ApiKeyForm manual local-model fallback', () => {
// for a manual model name instead of dead-ending. Second Connect: the typed
// name is forwarded as the 5th onSave argument.
const onSave = vi
- .fn<(envKey: string, value: string, name: string, apiKey?: string, modelName?: string) => Promise<{ message?: string; needsModelInput?: boolean; ok: boolean }>>()
+ .fn<
+ (
+ envKey: string,
+ value: string,
+ name: string,
+ apiKey?: string,
+ modelName?: string
+ ) => Promise<{ message?: string; needsModelInput?: boolean; ok: boolean }>
+ >()
.mockResolvedValueOnce({
ok: false,
needsModelInput: true,
@@ -115,14 +123,7 @@ describe('ApiKeyForm manual local-model fallback', () => {
})
.mockResolvedValueOnce({ ok: true })
- render(
- <ApiKeyForm
- canGoBack={false}
- initialEnvKey="OPENAI_BASE_URL"
- onBack={() => undefined}
- onSave={onSave}
- />
- )
+ render(<ApiKeyForm canGoBack={false} initialEnvKey="OPENAI_BASE_URL" onBack={() => undefined} onSave={onSave} />)
fireEvent.change(screen.getByPlaceholderText('http://127.0.0.1:8000/v1'), {
target: { value: 'https://api.cohere.ai/compatibility/v1' }
diff --git a/apps/desktop/src/components/onboarding/index.tsx b/apps/desktop/src/components/onboarding/index.tsx
index a8905e1f3bf..f0ccccbaf36 100644
--- a/apps/desktop/src/components/onboarding/index.tsx
+++ b/apps/desktop/src/components/onboarding/index.tsx
@@ -828,6 +828,7 @@ export function ApiKeyForm({
setSaving(true)
setError(null)
+
const result = await onSave(
option.envKey,
value,
diff --git a/apps/desktop/src/components/pane-shell/tree/pane-reload-share.test.ts b/apps/desktop/src/components/pane-shell/tree/pane-reload-share.test.ts
index 657220644b2..bb1724caaf8 100644
--- a/apps/desktop/src/components/pane-shell/tree/pane-reload-share.test.ts
+++ b/apps/desktop/src/components/pane-shell/tree/pane-reload-share.test.ts
@@ -86,9 +86,11 @@ describe('tile split-share memory across a hard reload', () => {
// empty), every persisted tile pane is pruned, then the tiles re-register
// and re-dock in anchor order. The prune pass must not remember shares.
tree.beginLayoutHydration()
+
for (const id of ['session-tile:a', 'session-tile:b', 'session-tile:c', 'session-tile:d']) {
tree.removeTreePane(id)
}
+
tree.endLayoutHydration()
// Persisted shares stay empty — nothing was recorded by the prune.
@@ -105,6 +107,7 @@ describe('tile split-share memory across a hard reload', () => {
// chain. (Group ids are regenerated per insert, so compare the weight
// vector only, against a fresh-boot reference of the same tile set.)
const fresh = await setup()
+
for (const [id, anchor] of [
['session-tile:a', 'workspace'],
['session-tile:b', 'session-tile:a'],
diff --git a/apps/desktop/src/components/pane-shell/tree/store.ts b/apps/desktop/src/components/pane-shell/tree/store.ts
index 6f516d06147..8bc17a10344 100644
--- a/apps/desktop/src/components/pane-shell/tree/store.ts
+++ b/apps/desktop/src/components/pane-shell/tree/store.ts
@@ -251,9 +251,7 @@ const $paneSharePartners = modeLayout.atom<Record<string, string>>(
() => ({}),
Codecs.json(value =>
value && typeof value === 'object'
- ? Object.fromEntries(
- Object.entries(value).filter(([, partner]) => typeof partner === 'string' && partner)
- )
+ ? Object.fromEntries(Object.entries(value).filter(([, partner]) => typeof partner === 'string' && partner))
: {}
)
)
@@ -321,8 +319,8 @@ function rememberPaneShare(tree: LayoutNode, paneId: string) {
// partner-validated, so it records without a partner and falls back to
// even on any mismatched recall.
const partnerGroup = parent.children[partner] as LayoutNode
- const partnerPane =
- partnerGroup.type === 'group' && partnerGroup.panes.length === 1 ? partnerGroup.panes[0] : null
+
+ const partnerPane = partnerGroup.type === 'group' && partnerGroup.panes.length === 1 ? partnerGroup.panes[0] : null
$paneShares.set({ ...$paneShares.get(), [paneId]: share })
@@ -1718,15 +1716,7 @@ export function dockPaneBeside(paneId: string, anchorPaneId: string) {
const next = findGroupOfPane(tree, paneId)
? movePaneOp(tree, paneId, { groupId: anchor.id, pos })
- : insertAtGroup(
- tree,
- anchor.id,
- paneId,
- pos,
- undefined,
- true,
- recalledEdgeWeights(paneId, anchorPaneId)
- )
+ : insertAtGroup(tree, anchor.id, paneId, pos, undefined, true, recalledEdgeWeights(paneId, anchorPaneId))
if (next && next !== tree) {
commit(next)
diff --git a/apps/desktop/src/components/ui/masonry.tsx b/apps/desktop/src/components/ui/masonry.tsx
index f630ec80322..b2a2088a33f 100644
--- a/apps/desktop/src/components/ui/masonry.tsx
+++ b/apps/desktop/src/components/ui/masonry.tsx
@@ -26,12 +26,14 @@ export function Masonry({ children, className, ...props }: ComponentProps<'div'>
if (disposed || !node.clientWidth) {
return
}
+
const style = getComputedStyle(node)
const tracks = style.gridTemplateColumns.split(' ').map(Number.parseFloat)
if (!tracks.length || tracks.some(width => !Number.isFinite(width))) {
return
}
+
const gap = Number.parseFloat(style.columnGap) || 0
const width = tracks[0]
const widthValue = `${width}px`
diff --git a/apps/desktop/src/i18n/de.ts b/apps/desktop/src/i18n/de.ts
index a0e8e76a71a..7a78bd25407 100644
--- a/apps/desktop/src/i18n/de.ts
+++ b/apps/desktop/src/i18n/de.ts
@@ -4449,7 +4449,8 @@ export const deOverrides = {
copyFailure: 'Kriterium konnte nicht in die Zwischenablage kopiert werden',
continuationFailed: 'Ziel-Fortsetzung konnte nicht übermittelt werden',
continuationQueued: 'Ziel fortgesetzt — Fortsetzung in der Warteschlange, bis die aktuelle Runde endet',
- continuationBusy: 'Ziel fortgesetzt — Session ist beschäftigt; stoppe zuerst die aktuelle Antwort (Stopp-Button oder Esc), um fortzufahren',
+ continuationBusy:
+ 'Ziel fortgesetzt — Session ist beschäftigt; stoppe zuerst die aktuelle Antwort (Stopp-Button oder Esc), um fortzufahren',
controlUnavailable: msg => `Session-Steuerung nicht verfügbar: ${msg}`,
dismissError: 'Fehler verwerfen',
add: 'Hinzufügen'
@@ -4505,19 +4506,25 @@ export const deOverrides = {
},
updates: {
discontinuedTitle: 'Dieser Hermes-Build wird nicht mehr unterstützt',
- discontinuedBody: 'Dieser Hermes-Build wird nicht mehr unterstützt und funktioniert möglicherweise nicht mehr — deinstallieren Sie ihn. Ihre Daten bleiben auf dem Datenträger.',
+ discontinuedBody:
+ 'Dieser Hermes-Build wird nicht mehr unterstützt und funktioniert möglicherweise nicht mehr — deinstallieren Sie ihn. Ihre Daten bleiben auf dem Datenträger.',
channels: { stable: 'Stabil', canary: 'Canary' },
appName: 'Hermes',
availableBodyRelease: tag => `Version ${tag} ist bereit zur Installation.`,
releaseAvailable: tag => `Version ${tag} ist verfügbar.`,
checkingShort: 'Wird geprüft…',
- availableBodyAppInstaller: 'Eine neue Hermes-Version ist bereit. Hermes wird geschlossen, Windows schließt das Update ab und Hermes startet automatisch neu.',
- applyingBodyAppInstaller: 'Hermes wird geschlossen und Windows schließt das Update ab. Danach startet Hermes automatisch neu.',
- applyingCloseAppInstaller: 'Dieses Fenster schließt sich, Windows schließt das Update ab und Hermes startet automatisch neu.',
+ availableBodyAppInstaller:
+ 'Eine neue Hermes-Version ist bereit. Hermes wird geschlossen, Windows schließt das Update ab und Hermes startet automatisch neu.',
+ applyingBodyAppInstaller:
+ 'Hermes wird geschlossen und Windows schließt das Update ab. Danach startet Hermes automatisch neu.',
+ applyingCloseAppInstaller:
+ 'Dieses Fenster schließt sich, Windows schließt das Update ab und Hermes startet automatisch neu.',
checkUnknownTitleAppInstaller: 'Update-Check fehlgeschlagen',
- checkUnknownBodyAppInstaller: 'Windows konnte gerade nicht nach Updates suchen. Updates werden auch beim Neustart von Hermes automatisch installiert.',
+ checkUnknownBodyAppInstaller:
+ 'Windows konnte gerade nicht nach Updates suchen. Updates werden auch beim Neustart von Hermes automatisch installiert.',
versionDetailsTitle: 'Versionsdetails',
- versionDetailsBody: 'Diese Installation wird außerhalb der App verwaltet. Aktualisieren Sie sie auf dieselbe Weise, wie Sie sie installiert haben.',
+ versionDetailsBody:
+ 'Diese Installation wird außerhalb der App verwaltet. Aktualisieren Sie sie auf dieselbe Weise, wie Sie sie installiert haben.',
versionDetailsVersion: 'Version',
versionDetailsCommit: 'Commit',
versionDetailsBuildOrigin: 'Build-Ursprung',
@@ -4539,11 +4546,11 @@ export const deOverrides = {
versionUnavailable: 'Version nicht verfügbar',
bundleOutOfSync: 'App-Build ist veraltet',
bundleOutOfSyncDesc:
- 'Die Hermes-Laufzeit wurde aktualisiert, die Desktop-App selbst ist aber noch ein älterer Build – neue Oberflächenfunktionen (wie der Bot-Modus) fehlen, bis sie aktualisiert wird. Führen Sie das Update unten aus, um die App neu zu bauen. Falls das die Warnung nicht behebt, installieren Sie den neuesten Desktop-Installer neu.',
+ 'Die Hermes-Laufzeit wurde aktualisiert, die Desktop-App selbst ist aber noch ein älterer Build – neue Oberflächenfunktionen (wie der Bot-Modus) fehlen, bis sie aktualisiert wird. Führen Sie das Update unten aus, um die App neu zu bauen. Falls das die Warnung nicht behebt, installieren Sie den neuesten Desktop-Installer neu.',
bundleOutOfSyncAction: 'Installer herunterladen',
bundleSwapPending: 'Neustart zum Abschließen des Updates',
bundleSwapPendingDesc:
- 'Die aktualisierte App ist bereits installiert — Hermes muss nur noch neu gestartet werden, um sie zu laden. Chats und Einstellungen bleiben unberührt.',
+ 'Die aktualisierte App ist bereits installiert — Hermes muss nur noch neu gestartet werden, um sie zu laden. Chats und Einstellungen bleiben unberührt.',
bundleSwapPendingAction: 'Hermes neu starten',
checkNow: 'Jetzt prüfen',
seeWhatsNew: 'Neuigkeiten ansehen',
@@ -4601,7 +4608,8 @@ export const deOverrides = {
manualBody:
'Sie haben Hermes über die Befehlszeile installiert, daher laufen Updates auch dort. Fügen Sie dies in Ihr Terminal ein:',
manualPickedUp: 'Hermes übernimmt die neue Version beim nächsten Start.',
- manualBodyBackend: 'Das Hermes-Backend wird außerhalb dieser App verwaltet. Führen Sie dies auf dem Server aus, der es hostet:',
+ manualBodyBackend:
+ 'Das Hermes-Backend wird außerhalb dieser App verwaltet. Führen Sie dies auf dem Server aus, der es hostet:',
manualPickedUpBackend: 'Das Backend lädt die neue Version, sobald das Update abgeschlossen ist.',
guiSkewTitle: 'Desktop-App aktualisieren',
guiSkewBody:
diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts
index efd8febd310..79cf350f74d 100644
--- a/apps/desktop/src/i18n/en.ts
+++ b/apps/desktop/src/i18n/en.ts
@@ -71,37 +71,37 @@ export const en: Translations = {
back: 'Back to results'
},
connectors: {
- title: 'Connect your apps',
- connect: 'Connect',
- skip: 'Not now',
- cancel: 'Stop waiting',
- retry: 'Try again',
- grant: 'Reconnect',
- connected: 'Connected',
- checking: 'Checking your apps…',
- notConnected: 'Not connected',
- skipped: 'Skipped',
- disabled: 'Unavailable',
- failed: 'Could not connect',
- needsAuth: 'Access expired',
- opening: 'Opening sign-in…',
- waiting: 'Waiting for your browser…',
- timeout: 'Still waiting for authorization.',
- refresh: 'Refresh status',
- connectError: 'Could not start authorization. Try again.',
- connectErrorFor: (app: string) => `Could not start authorization for ${app}.`,
- unavailable: 'Connectors are unavailable for this session.',
- ownerMissing: 'Reopen this conversation to manage its connections.',
- search: 'Find an app',
- empty: 'No matching apps',
- disclaimer: 'Connecting is optional. Only authorize the apps you want Hermes to use.',
- execution: 'Connector tools',
- setup: server => `Set up ${server}`,
- openInBrowser: 'Open in browser',
- setupCancel: 'Cancel',
- authorizedToolsUnavailable: 'Authorized. Tools unavailable.',
- required: 'Required'
-},
+ title: 'Connect your apps',
+ connect: 'Connect',
+ skip: 'Not now',
+ cancel: 'Stop waiting',
+ retry: 'Try again',
+ grant: 'Reconnect',
+ connected: 'Connected',
+ checking: 'Checking your apps…',
+ notConnected: 'Not connected',
+ skipped: 'Skipped',
+ disabled: 'Unavailable',
+ failed: 'Could not connect',
+ needsAuth: 'Access expired',
+ opening: 'Opening sign-in…',
+ waiting: 'Waiting for your browser…',
+ timeout: 'Still waiting for authorization.',
+ refresh: 'Refresh status',
+ connectError: 'Could not start authorization. Try again.',
+ connectErrorFor: (app: string) => `Could not start authorization for ${app}.`,
+ unavailable: 'Connectors are unavailable for this session.',
+ ownerMissing: 'Reopen this conversation to manage its connections.',
+ search: 'Find an app',
+ empty: 'No matching apps',
+ disclaimer: 'Connecting is optional. Only authorize the apps you want Hermes to use.',
+ execution: 'Connector tools',
+ setup: server => `Set up ${server}`,
+ openInBrowser: 'Open in browser',
+ setupCancel: 'Cancel',
+ authorizedToolsUnavailable: 'Authorized. Tools unavailable.',
+ required: 'Required'
+ },
// `connectors.*` above stays the onboarding and chat vocabulary; these are the page's own, and the two are not shared.
connectorsPage: {
diff --git a/apps/desktop/src/i18n/es.ts b/apps/desktop/src/i18n/es.ts
index ac8c0714ae5..0bf2c5d85ae 100644
--- a/apps/desktop/src/i18n/es.ts
+++ b/apps/desktop/src/i18n/es.ts
@@ -4439,7 +4439,8 @@ export const esOverrides = {
copyFailure: 'No se pudo copiar el criterio al portapapeles',
continuationFailed: 'No se pudo enviar la continuación del objetivo',
continuationQueued: 'Objetivo reanudado: la continuación queda en cola hasta que termine el turno actual',
- continuationBusy: 'Objetivo reanudado: la sesión está ocupada; detén primero la respuesta actual (botón Stop o Esc) para continuar',
+ continuationBusy:
+ 'Objetivo reanudado: la sesión está ocupada; detén primero la respuesta actual (botón Stop o Esc) para continuar',
controlUnavailable: (msg: string) => `Controles de sesión no disponibles: ${msg}`,
dismissError: 'Descartar error',
add: 'Añadir'
@@ -4495,19 +4496,25 @@ export const esOverrides = {
},
updates: {
discontinuedTitle: 'Esta versión de Hermes ya no tiene soporte',
- discontinuedBody: 'Esta versión de Hermes ya no tiene soporte y podría dejar de funcionar; desinstálala. Tus datos permanecen en el disco.',
+ discontinuedBody:
+ 'Esta versión de Hermes ya no tiene soporte y podría dejar de funcionar; desinstálala. Tus datos permanecen en el disco.',
channels: { stable: 'Estable', canary: 'Canary' },
appName: 'Hermes',
availableBodyRelease: tag => `La versión ${tag} está lista para instalarse.`,
releaseAvailable: tag => `La versión ${tag} está disponible.`,
checkingShort: 'Comprobando…',
- availableBodyAppInstaller: 'Hay una nueva versión de Hermes. Hermes se cerrará, Windows terminará la actualización y Hermes volverá a abrirse automáticamente.',
- applyingBodyAppInstaller: 'Hermes se cerrará y Windows terminará la actualización. Hermes volverá a abrirse al finalizar; no tienes que hacer nada.',
- applyingCloseAppInstaller: 'Esta ventana se cerrará; Windows terminará la actualización y Hermes volverá a abrirse automáticamente.',
+ availableBodyAppInstaller:
+ 'Hay una nueva versión de Hermes. Hermes se cerrará, Windows terminará la actualización y Hermes volverá a abrirse automáticamente.',
+ applyingBodyAppInstaller:
+ 'Hermes se cerrará y Windows terminará la actualización. Hermes volverá a abrirse al finalizar; no tienes que hacer nada.',
+ applyingCloseAppInstaller:
+ 'Esta ventana se cerrará; Windows terminará la actualización y Hermes volverá a abrirse automáticamente.',
checkUnknownTitleAppInstaller: 'No se pudieron buscar actualizaciones',
- checkUnknownBodyAppInstaller: 'Windows no pudo buscar actualizaciones ahora. También se instalan automáticamente al reiniciar Hermes.',
+ checkUnknownBodyAppInstaller:
+ 'Windows no pudo buscar actualizaciones ahora. También se instalan automáticamente al reiniciar Hermes.',
versionDetailsTitle: 'Detalles de la versión',
- versionDetailsBody: 'Esta instalación se administra fuera de la app. Actualízala de la misma forma en que la instalaste.',
+ versionDetailsBody:
+ 'Esta instalación se administra fuera de la app. Actualízala de la misma forma en que la instalaste.',
versionDetailsVersion: 'Versión',
versionDetailsCommit: 'Commit',
versionDetailsBuildOrigin: 'Origen de la compilación',
@@ -4529,11 +4536,11 @@ export const esOverrides = {
versionUnavailable: 'Versión no disponible',
bundleOutOfSync: 'La compilación de la app está desactualizada',
bundleOutOfSyncDesc:
- 'El entorno de ejecución de Hermes se actualizó, pero la app de escritorio sigue siendo una compilación anterior: faltarán funciones nuevas de la interfaz (como el modo Bot) hasta que se actualice. Ejecuta la actualización de abajo para recompilar la app. Si eso no elimina este aviso, reinstala desde el instalador de escritorio más reciente.',
+ 'El entorno de ejecución de Hermes se actualizó, pero la app de escritorio sigue siendo una compilación anterior: faltarán funciones nuevas de la interfaz (como el modo Bot) hasta que se actualice. Ejecuta la actualización de abajo para recompilar la app. Si eso no elimina este aviso, reinstala desde el instalador de escritorio más reciente.',
bundleOutOfSyncAction: 'Obtener el instalador',
bundleSwapPending: 'Reinicia para terminar la actualización',
bundleSwapPendingDesc:
- 'La app actualizada ya está instalada; Hermes solo necesita reiniciarse para cargarla. Los chats y los ajustes no se tocan.',
+ 'La app actualizada ya está instalada; Hermes solo necesita reiniciarse para cargarla. Los chats y los ajustes no se tocan.',
bundleSwapPendingAction: 'Reiniciar Hermes',
checkNow: 'Comprobar ahora',
seeWhatsNew: 'Ver novedades',
@@ -4543,7 +4550,7 @@ export const esOverrides = {
cantReach: 'No pudimos contactar con el servidor de actualizaciones.',
tapCheck: 'Pulsa "Comprobar ahora" para buscar actualizaciones.',
updateReady: count =>
- `Hay una actualización lista (${count} ${count === 1 ? 'cambio incluido' : 'cambios incluidos'}).`,
+ `Hay una actualización lista (${count} ${count === 1 ? 'cambio incluido' : 'cambios incluidos'}).`,
updateReadyUnknown: 'Hay una nueva actualización lista.',
lastChecked: age => `Última comprobación ${age}`,
justNowSuffix: ' · ahora mismo',
diff --git a/apps/desktop/src/i18n/fr.ts b/apps/desktop/src/i18n/fr.ts
index 3dd01898e1e..5fd0e8495f5 100644
--- a/apps/desktop/src/i18n/fr.ts
+++ b/apps/desktop/src/i18n/fr.ts
@@ -4460,7 +4460,8 @@ export const frOverrides = {
copyFailure: 'Impossible de copier le critère dans le presse-papiers',
continuationFailed: "Impossible de soumettre la poursuite de l'objectif",
continuationQueued: 'Objectif repris — poursuite en attente de la fin du tour actuel',
- continuationBusy: "Objectif repris — session occupée, arrêtez d'abord la réponse en cours (bouton Stop ou Échap) pour poursuivre",
+ continuationBusy:
+ "Objectif repris — session occupée, arrêtez d'abord la réponse en cours (bouton Stop ou Échap) pour poursuivre",
controlUnavailable: msg => `Commandes de session indisponibles : ${msg}`,
dismissError: "Masquer l'erreur",
add: 'Ajouter'
@@ -4516,19 +4517,25 @@ export const frOverrides = {
},
updates: {
discontinuedTitle: "Cette version de Hermes n'est plus prise en charge",
- discontinuedBody: "Cette version de Hermes n'est plus prise en charge et risque de ne plus fonctionner — désinstallez-la. Vos données restent sur le disque.",
+ discontinuedBody:
+ "Cette version de Hermes n'est plus prise en charge et risque de ne plus fonctionner — désinstallez-la. Vos données restent sur le disque.",
channels: { stable: 'Stable', canary: 'Canary' },
appName: 'Hermes',
availableBodyRelease: tag => `La version ${tag} est prête à être installée.`,
releaseAvailable: tag => `La version ${tag} est disponible.`,
checkingShort: 'Vérification…',
- availableBodyAppInstaller: "Une nouvelle version de Hermes est prête. Hermes va se fermer, Windows terminera la mise à jour, puis Hermes rouvrira automatiquement.",
- applyingBodyAppInstaller: "Hermes va se fermer et Windows terminera la mise à jour. Hermes rouvrira ensuite automatiquement — vous n'avez rien à faire.",
- applyingCloseAppInstaller: 'Cette fenêtre va se fermer, Windows terminera la mise à jour et Hermes rouvrira automatiquement.',
+ availableBodyAppInstaller:
+ 'Une nouvelle version de Hermes est prête. Hermes va se fermer, Windows terminera la mise à jour, puis Hermes rouvrira automatiquement.',
+ applyingBodyAppInstaller:
+ "Hermes va se fermer et Windows terminera la mise à jour. Hermes rouvrira ensuite automatiquement — vous n'avez rien à faire.",
+ applyingCloseAppInstaller:
+ 'Cette fenêtre va se fermer, Windows terminera la mise à jour et Hermes rouvrira automatiquement.',
checkUnknownTitleAppInstaller: 'Impossible de vérifier les mises à jour',
- checkUnknownBodyAppInstaller: "Windows n'a pas pu rechercher les mises à jour. Elles s'installent également automatiquement au redémarrage de Hermes.",
+ checkUnknownBodyAppInstaller:
+ "Windows n'a pas pu rechercher les mises à jour. Elles s'installent également automatiquement au redémarrage de Hermes.",
versionDetailsTitle: 'Détails de la version',
- versionDetailsBody: "Cette installation est gérée hors de l'application. Mettez-la à jour de la même manière que vous l'avez installée.",
+ versionDetailsBody:
+ "Cette installation est gérée hors de l'application. Mettez-la à jour de la même manière que vous l'avez installée.",
versionDetailsVersion: 'Version',
versionDetailsCommit: 'Commit',
versionDetailsBuildOrigin: 'Origine de la compilation',
@@ -4550,11 +4557,11 @@ export const frOverrides = {
versionUnavailable: 'Version indisponible',
bundleOutOfSync: "Version de l'application obsolète",
bundleOutOfSyncDesc:
- "Le runtime Hermes a été mis à jour, mais l'application Desktop utilise encore une ancienne version. Les nouvelles fonctions de l'interface, comme le mode Bot, resteront absentes jusqu'à sa mise à jour. Lancez la mise à jour ci-dessous pour reconstruire l'application. Si cet avertissement persiste, réinstallez-la avec le dernier installateur Desktop.",
+ "Le runtime Hermes a été mis à jour, mais l'application Desktop utilise encore une ancienne version. Les nouvelles fonctions de l'interface, comme le mode Bot, resteront absentes jusqu'à sa mise à jour. Lancez la mise à jour ci-dessous pour reconstruire l'application. Si cet avertissement persiste, réinstallez-la avec le dernier installateur Desktop.",
bundleOutOfSyncAction: "Obtenir l'installateur",
bundleSwapPending: 'Redémarrez pour terminer la mise à jour',
bundleSwapPendingDesc:
- "L'application mise à jour est déjà installée — Hermes doit seulement redémarrer pour la charger. Vos conversations et paramètres sont préservés.",
+ "L'application mise à jour est déjà installée — Hermes doit seulement redémarrer pour la charger. Vos conversations et paramètres sont préservés.",
bundleSwapPendingAction: 'Redémarrer Hermes',
checkNow: 'Vérifier maintenant',
seeWhatsNew: 'Voir les nouveautés',
@@ -4613,7 +4620,8 @@ export const frOverrides = {
manualBody:
"Vous avez installé Hermes depuis la ligne de commande, les mises à jour s'y effectuent donc aussi. Collez ceci dans votre terminal :",
manualPickedUp: 'Hermes prendra en compte la nouvelle version au prochain lancement.',
- manualBodyBackend: 'Le backend Hermes est géré en dehors de cette app. Exécutez ceci sur le serveur qui l’héberge :',
+ manualBodyBackend:
+ 'Le backend Hermes est géré en dehors de cette app. Exécutez ceci sur le serveur qui l’héberge :',
manualPickedUpBackend: 'Le backend chargera la nouvelle version une fois la mise à jour terminée.',
guiSkewTitle: "Mettre à jour l'application de bureau",
guiSkewBody:
diff --git a/apps/desktop/src/i18n/ja.ts b/apps/desktop/src/i18n/ja.ts
index e7ba3786bab..4d1853e2dce 100644
--- a/apps/desktop/src/i18n/ja.ts
+++ b/apps/desktop/src/i18n/ja.ts
@@ -2939,7 +2939,8 @@ export const ja = defineLocale({
copyFailure: '基準のコピーに失敗しました',
continuationFailed: 'ゴールの継続送信に失敗しました',
continuationQueued: 'ゴールを再開しました — 継続は現在のターン終了後に送信されます',
- continuationBusy: 'ゴールを再開しました — セッションが実行中です。続行するには、まず現在の応答を停止してください(Stop ボタンまたは Esc)',
+ continuationBusy:
+ 'ゴールを再開しました — セッションが実行中です。続行するには、まず現在の応答を停止してください(Stop ボタンまたは Esc)',
controlUnavailable: msg => `セッション制御を利用できません: ${msg}`,
dismissError: 'エラーを閉じる',
add: '追加'
@@ -2994,7 +2995,8 @@ export const ja = defineLocale({
updates: {
discontinuedTitle: 'このHermesビルドはサポートされていません',
- discontinuedBody: 'このHermesビルドはサポートが終了し、動作しなくなる可能性があります。アンインストールしてください。データはディスクに残ります。',
+ discontinuedBody:
+ 'このHermesビルドはサポートが終了し、動作しなくなる可能性があります。アンインストールしてください。データはディスクに残ります。',
channels: { stable: '安定版', canary: '先行版' },
bundleSwapPending: '再起動して更新を完了',
bundleSwapPendingDesc:
diff --git a/apps/desktop/src/i18n/ru.ts b/apps/desktop/src/i18n/ru.ts
index f07cdb5d333..557da71c01a 100644
--- a/apps/desktop/src/i18n/ru.ts
+++ b/apps/desktop/src/i18n/ru.ts
@@ -3178,7 +3178,8 @@ export const ru = defineLocale({
copyFailure: 'Не удалось скопировать критерий в буфер обмена',
continuationFailed: 'Не удалось отправить продолжение цели',
continuationQueued: 'Цель возобновлена — продолжение поставлено в очередь до конца текущего хода',
- continuationBusy: 'Цель возобновлена — сессия занята; сначала остановите текущий ответ (кнопка Stop или Esc), чтобы продолжить',
+ continuationBusy:
+ 'Цель возобновлена — сессия занята; сначала остановите текущий ответ (кнопка Stop или Esc), чтобы продолжить',
controlUnavailable: msg => `Управление сессией недоступно: ${msg}`,
dismissError: 'Скрыть ошибку',
add: 'Добавить'
@@ -3233,7 +3234,8 @@ export const ru = defineLocale({
},
updates: {
discontinuedTitle: 'Эта сборка Hermes больше не поддерживается',
- discontinuedBody: 'Эта сборка Hermes больше не поддерживается и может перестать работать — удалите её. Ваши данные останутся на диске.',
+ discontinuedBody:
+ 'Эта сборка Hermes больше не поддерживается и может перестать работать — удалите её. Ваши данные останутся на диске.',
channels: { stable: 'Стабильный', canary: 'Тестовый' },
bundleSwapPending: 'Перезапустите, чтобы завершить обновление',
bundleSwapPendingDesc:
diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.ts
index 009f158d1bd..86ae415cea9 100644
--- a/apps/desktop/src/i18n/types.ts
+++ b/apps/desktop/src/i18n/types.ts
@@ -64,7 +64,7 @@ export interface Translations {
message: string
copyUrl: string
close: string
- };
+ }
intro: {
stock: Record<string, string[]>
custom: (label: string) => string[]
diff --git a/apps/desktop/src/i18n/zh-hant.ts b/apps/desktop/src/i18n/zh-hant.ts
index 17be495c9f8..8d534d5e5e6 100644
--- a/apps/desktop/src/i18n/zh-hant.ts
+++ b/apps/desktop/src/i18n/zh-hant.ts
@@ -422,7 +422,8 @@ export const zhHant = defineLocale({
plugins: {
openFolder: '開啟桌面外掛資料夾',
installModal: {
- installUncertain: 'Hermes 已停止等待安裝結果,但外掛可能仍在安裝中。請關閉此視窗,重新掃描外掛清單後再嘗試安裝。',
+ installUncertain:
+ 'Hermes 已停止等待安裝結果,但外掛可能仍在安裝中。請關閉此視窗,重新掃描外掛清單後再嘗試安裝。',
installFromGit: '從 Git 安裝',
reviewRepository: '檢查儲存庫',
repoPlaceholder: 'https://github.com/owner/repo',
diff --git a/apps/desktop/src/lib/chat-messages/reconciliation.ts b/apps/desktop/src/lib/chat-messages/reconciliation.ts
index dac288a682a..7f78989f305 100644
--- a/apps/desktop/src/lib/chat-messages/reconciliation.ts
+++ b/apps/desktop/src/lib/chat-messages/reconciliation.ts
@@ -183,10 +183,7 @@ interface PreservedRun {
rows: ChatMessage[]
}
-function mergeStoredAssistantErrors(
- nextMessages: ChatMessage[],
- currentMessages: ChatMessage[]
-): ChatMessage[] {
+function mergeStoredAssistantErrors(nextMessages: ChatMessage[], currentMessages: ChatMessage[]): ChatMessage[] {
const localById = new Map(currentMessages.map(message => [message.id, message]))
return nextMessages.map(message => {
diff --git a/apps/desktop/src/lib/chat-runtime.test.ts b/apps/desktop/src/lib/chat-runtime.test.ts
index d8ab7ef392e..3156b7ef71f 100644
--- a/apps/desktop/src/lib/chat-runtime.test.ts
+++ b/apps/desktop/src/lib/chat-runtime.test.ts
@@ -90,6 +90,7 @@ describe('optimisticAttachmentRef', () => {
it('renders an OS-drop blob: preview as a markdown image (no IPC data URL)', () => {
const blobUrl = 'blob:https://desktop/preview-1'
+
const ref = optimisticAttachmentRef(
attachment({ kind: 'image', label: 'Lattice.png', detail: 'C:\\shot.png', previewUrl: blobUrl })
)
diff --git a/apps/desktop/src/lib/cloud-agent-session.ts b/apps/desktop/src/lib/cloud-agent-session.ts
index d4fa40b97e2..267428a1f1c 100644
--- a/apps/desktop/src/lib/cloud-agent-session.ts
+++ b/apps/desktop/src/lib/cloud-agent-session.ts
@@ -27,10 +27,7 @@ export interface CloudAgentSessionBridge {
* live (call `ensureCloudPortalSession` first); returns whether the gateway
* session cookie landed.
*/
-async function cascadeCloudAgentSession(
- desktop: CloudAgentSessionBridge,
- url: string
-): Promise<boolean> {
+async function cascadeCloudAgentSession(desktop: CloudAgentSessionBridge, url: string): Promise<boolean> {
const result = await desktop.cloud!.agentSignIn(url)
return result.connected === true
@@ -71,4 +68,4 @@ export async function reestablishCloudAgentSession(
}
return (await cascadeCloudAgentSession(desktop, url)) ? 'connected' : 'portal-incomplete'
-}
\ No newline at end of file
+}
diff --git a/apps/desktop/src/lib/desktop-slash-commands.ts b/apps/desktop/src/lib/desktop-slash-commands.ts
index 844cadcb2e5..06182577483 100644
--- a/apps/desktop/src/lib/desktop-slash-commands.ts
+++ b/apps/desktop/src/lib/desktop-slash-commands.ts
@@ -579,10 +579,7 @@ export function isDesktopSlashSuggestion(command: string): boolean {
* executes it (#57641). Gated on `isDesktopSlashCommand` so aliases whose
* canonical has no desktop surface (e.g. `/reload_mcp`) stay hidden.
*/
-export function isDesktopSlashSuggestionWithOptions(
- command: string,
- options: { exactAlias?: string } = {}
-): boolean {
+export function isDesktopSlashSuggestionWithOptions(command: string, options: { exactAlias?: string } = {}): boolean {
const normalized = normalizeCommand(command)
// Aliases stay hidden so the popover isn't cluttered with duplicates.
diff --git a/apps/desktop/src/lib/file-preview-math.render.test.tsx b/apps/desktop/src/lib/file-preview-math.render.test.tsx
index 6a4f6801559..47877216e3d 100644
--- a/apps/desktop/src/lib/file-preview-math.render.test.tsx
+++ b/apps/desktop/src/lib/file-preview-math.render.test.tsx
@@ -69,7 +69,8 @@ describe('file-preview math rendering', () => {
// copy-out, CJK in a serif fallback at 1.21em. After, it renders as prose
// and the source text is recoverable from the DOM.
it('does not typeset a bare dollar pair spanning CJK prose as KaTeX (#103546)', async () => {
- const source = '...的经典嫌疑是 **$connection 被别的写者整包覆盖**(丢了 `isFullscreen` 字段)...搜 `$connection` 的所有写者:'
+ const source =
+ '...的经典嫌疑是 **$connection 被别的写者整包覆盖**(丢了 `isFullscreen` 字段)...搜 `$connection` 的所有写者:'
const { container } = render(
<Streamdown mode="static" plugins={{ math: mathPlugin }}>
diff --git a/apps/desktop/src/lib/markdown-preprocess.ts b/apps/desktop/src/lib/markdown-preprocess.ts
index 8032f37bda3..02436310718 100644
--- a/apps/desktop/src/lib/markdown-preprocess.ts
+++ b/apps/desktop/src/lib/markdown-preprocess.ts
@@ -113,12 +113,61 @@ const DIRECTIVE_LINE_ONLY_RE = /^[ \t]*::[a-z][a-z0-9-]{0,63}\{[^{}\n]{0,1024}\}
const HTML_TAG_RE = /<\/?([A-Za-z][A-Za-z0-9:_-]*)(?:\s+[^<>]*?)?\/?>/g
const SAFE_HTML_TAG_NAMES = new Set([
- 'a', 'abbr', 'b', 'blockquote', 'br', 'cite', 'code', 'data', 'del', 'details',
- 'div', 'em', 'figcaption', 'figure', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr',
- 'i', 'img', 'ins', 'kbd', 'li', 'mark', 'ol', 'p', 'pre', 'q', 'rp', 'rt',
- 'ruby', 's', 'samp', 'small', 'span', 'strong', 'sub', 'summary', 'sup', 'table',
- 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'u', 'ul', 'var', 'wbr'
+ 'a',
+ 'abbr',
+ 'b',
+ 'blockquote',
+ 'br',
+ 'cite',
+ 'code',
+ 'data',
+ 'del',
+ 'details',
+ 'div',
+ 'em',
+ 'figcaption',
+ 'figure',
+ 'h1',
+ 'h2',
+ 'h3',
+ 'h4',
+ 'h5',
+ 'h6',
+ 'hr',
+ 'i',
+ 'img',
+ 'ins',
+ 'kbd',
+ 'li',
+ 'mark',
+ 'ol',
+ 'p',
+ 'pre',
+ 'q',
+ 'rp',
+ 'rt',
+ 'ruby',
+ 's',
+ 'samp',
+ 'small',
+ 'span',
+ 'strong',
+ 'sub',
+ 'summary',
+ 'sup',
+ 'table',
+ 'tbody',
+ 'td',
+ 'tfoot',
+ 'th',
+ 'thead',
+ 'tr',
+ 'u',
+ 'ul',
+ 'var',
+ 'wbr'
])
+
const CITATION_MARKER_RE = /(?<=[\p{L}\p{N})\].,!?:;"'”’])\[(?:\d+(?:\s*,\s*\d+)*)\](?!\()/gu
// Markdown links whose target is a filesystem path on the agent's machine:
// `[report](/home/user/report.md)`, `[notes](file:///srv/notes.txt)`,
@@ -345,6 +394,7 @@ function escapeUnknownHtmlLikeTags(text: string): string {
return tag.replace(/</g, '&lt;').replace(/>/g, '&gt;')
})
}
+
// Rewrite filesystem-path links to the renderer's hash-href door (#82140).
// A plain path/file: href names a file on the AGENT's machine: Streamdown's
// URL hardening blocks `file:`/`~/` outright, and an absolute path renders
diff --git a/apps/desktop/src/plugins/hermes-bots/relay.test.ts b/apps/desktop/src/plugins/hermes-bots/relay.test.ts
index 63088b7cc6c..009f7f8727a 100644
--- a/apps/desktop/src/plugins/hermes-bots/relay.test.ts
+++ b/apps/desktop/src/plugins/hermes-bots/relay.test.ts
@@ -34,6 +34,7 @@ const { clearBotAttentionMock, hostMock, noteBotAttentionMock, UnboundedCache }
get: () => {
try {
const raw = window.localStorage.getItem('hermes.desktop.pluginDecisions.v2')
+
return raw ? (JSON.parse(raw) as Record<string, boolean>) : {}
} catch {
return {}
diff --git a/apps/desktop/src/plugins/kanban/api.events-cursor.test.ts b/apps/desktop/src/plugins/kanban/api.events-cursor.test.ts
index b57b9948065..520ed894c44 100644
--- a/apps/desktop/src/plugins/kanban/api.events-cursor.test.ts
+++ b/apps/desktop/src/plugins/kanban/api.events-cursor.test.ts
@@ -62,9 +62,13 @@ describe('kanban event cursor', () => {
const socket = vi.fn(() => vi.fn())
- const dispose = bindApi(async () => {
- throw new Error('cached snapshot must not refetch')
- }, storage('ops'), socket)
+ const dispose = bindApi(
+ async () => {
+ throw new Error('cached snapshot must not refetch')
+ },
+ storage('ops'),
+ socket
+ )
expect(socket).toHaveBeenCalledWith('/events?board=ops&since=14386', expect.any(Function))
dispose()
diff --git a/apps/desktop/src/store/composer-queue.test.ts b/apps/desktop/src/store/composer-queue.test.ts
index b7b36a0f1cd..371485b47cb 100644
--- a/apps/desktop/src/store/composer-queue.test.ts
+++ b/apps/desktop/src/store/composer-queue.test.ts
@@ -1,11 +1,6 @@
import { beforeEach, describe, expect, it, vi } from 'vitest'
-import {
- $composerAttachments,
- addComposerAttachment,
- type ComposerAttachment,
- mainComposerScope
-} from './composer'
+import { $composerAttachments, addComposerAttachment, type ComposerAttachment, mainComposerScope } from './composer'
import {
$parkedQueueSessions,
$queuedPromptsBySession,
@@ -56,18 +51,21 @@ describe('composer queue store', () => {
// Mirrors use-composer-queue: enqueue → clear({ retainPreviewUrls }).
const revokeObjectURL = stubRevokeObjectURL()
const blobUrl = 'blob:hermes-queued-1'
+
const image = {
id: 'image:drop',
kind: 'image' as const,
label: 'Lattice.png',
previewUrl: blobUrl
}
+
addComposerAttachment(image)
const queued = enqueueQueuedPrompt(SESSION_KEY, {
text: 'look at this',
attachments: $composerAttachments.get()
})
+
mainComposerScope.clear({ retainPreviewUrls: true })
expect(queued).not.toBeNull()
@@ -82,6 +80,7 @@ describe('composer queue store', () => {
it('drain handoff retains blob previews when the queued entry is removed after submit owns them', () => {
const revokeObjectURL = stubRevokeObjectURL()
const blobUrl = 'blob:hermes-drain-1'
+
const queued = enqueueQueuedPrompt(SESSION_KEY, {
text: 'drain me',
attachments: [{ id: 'image:drop', kind: 'image', label: 'shot.png', previewUrl: blobUrl }]
@@ -96,6 +95,7 @@ describe('composer queue store', () => {
const revokeObjectURL = stubRevokeObjectURL()
const oldUrl = 'blob:hermes-old'
const newUrl = 'blob:hermes-new'
+
const queued = enqueueQueuedPrompt(SESSION_KEY, {
text: 'edit me',
attachments: [{ id: 'image:old', kind: 'image', label: 'old.png', previewUrl: oldUrl }]
@@ -341,7 +341,7 @@ describe('cross-window sync (#46732)', () => {
window.dispatchEvent(new StorageEvent('storage', { key, newValue }))
}
- it('adopts another window\'s write from the storage event', () => {
+ it("adopts another window's write from the storage event", () => {
window.localStorage.setItem(
QUEUE_STORAGE_KEY,
JSON.stringify({ 'session-other': [storedEntry('q1', 'from other window')] })
@@ -352,14 +352,17 @@ describe('cross-window sync (#46732)', () => {
expect(getQueuedPrompts('session-other').map(entry => entry.text)).toEqual(['from other window'])
})
- it('does not clobber another window\'s entries when saving its own (same-frame race)', () => {
+ it("does not clobber another window's entries when saving its own (same-frame race)", () => {
enqueueQueuedPrompt(SESSION_KEY, { attachments: [], text: 'mine first' })
// Another window queues into its own session directly in storage, faster
// than any storage event could reach us.
window.localStorage.setItem(
QUEUE_STORAGE_KEY,
- JSON.stringify({ ...JSON.parse(window.localStorage.getItem(QUEUE_STORAGE_KEY)!), 'session-other': [storedEntry('q2', 'theirs')] })
+ JSON.stringify({
+ ...JSON.parse(window.localStorage.getItem(QUEUE_STORAGE_KEY)!),
+ 'session-other': [storedEntry('q2', 'theirs')]
+ })
)
enqueueQueuedPrompt(SESSION_KEY, { attachments: [], text: 'mine second' })
diff --git a/apps/desktop/src/store/composer-queue.ts b/apps/desktop/src/store/composer-queue.ts
index a376bfac869..b83f1b4d305 100644
--- a/apps/desktop/src/store/composer-queue.ts
+++ b/apps/desktop/src/store/composer-queue.ts
@@ -1,11 +1,7 @@
import { SLASH_COMMAND_RE } from '@hermes/shared'
import { atom } from 'nanostores'
-import {
- type ComposerAttachment,
- revokeAttachmentPreviewUrls,
- revokeDiscardedAttachmentPreviews
-} from './composer'
+import { type ComposerAttachment, revokeAttachmentPreviewUrls, revokeDiscardedAttachmentPreviews } from './composer'
export interface RemoveQueuedPromptOptions {
/**
diff --git a/apps/desktop/src/store/composer.test.ts b/apps/desktop/src/store/composer.test.ts
index 94e44bc639c..258f1c65c34 100644
--- a/apps/desktop/src/store/composer.test.ts
+++ b/apps/desktop/src/store/composer.test.ts
@@ -59,9 +59,7 @@ describe('blob preview URL ownership handoff', () => {
// Mirrors use-composer-submit: clone → clear({ retainPreviewUrls }) → dispatch clone.
const revokeObjectURL = stubRevokeObjectURL()
const blobUrl = 'blob:hermes-direct-submit-1'
- addComposerAttachment(
- attachment({ id: 'image:drop', kind: 'image', label: 'Lattice.png', previewUrl: blobUrl })
- )
+ addComposerAttachment(attachment({ id: 'image:drop', kind: 'image', label: 'Lattice.png', previewUrl: blobUrl }))
const submittedAttachments = $composerAttachments.get().map(item => ({ ...item }))
mainComposerScope.clear({ retainPreviewUrls: true })
diff --git a/apps/desktop/src/store/profile-dot-state.test.ts b/apps/desktop/src/store/profile-dot-state.test.ts
index 5e422b920c8..5f17b1603e2 100644
--- a/apps/desktop/src/store/profile-dot-state.test.ts
+++ b/apps/desktop/src/store/profile-dot-state.test.ts
@@ -16,11 +16,7 @@ import {
$unreadFinishedSessionIds,
setSessions
} from './session'
-import {
- clearAllSessionStates,
- publishSessionState,
- recordSessionEventScope
-} from './session-states'
+import { clearAllSessionStates, publishSessionState, recordSessionEventScope } from './session-states'
import { $sessionSeenCounts, $unreadFinishedMarkers } from './session-unread'
const session = (over: Partial<SessionInfo>): SessionInfo => makeSessionInfo({ id: 'live', ...over })
diff --git a/apps/desktop/src/store/profile-dot-state.ts b/apps/desktop/src/store/profile-dot-state.ts
index bd1a8ff48b2..37c0a47a542 100644
--- a/apps/desktop/src/store/profile-dot-state.ts
+++ b/apps/desktop/src/store/profile-dot-state.ts
@@ -86,7 +86,8 @@ function internSummary(needsInputCount: number, workingCount: number, unreadCoun
if (!summary) {
summary = Object.freeze({
- state: needsInputCount > 0 ? ('needs-input' as const) : workingCount > 0 ? ('working' as const) : ('unread' as const),
+ state:
+ needsInputCount > 0 ? ('needs-input' as const) : workingCount > 0 ? ('working' as const) : ('unread' as const),
needsInputCount,
workingCount,
unreadCount
@@ -233,9 +234,7 @@ export const $profileDotStateByScope = computed(
}
if (profiles.some(entry => normalizeProfileKey(entry.name) === profile)) {
- connections.add(
- activeConnectionId && activeConnectionId !== LOCAL_CONNECTION_ID ? activeConnectionId : null
- )
+ connections.add(activeConnectionId && activeConnectionId !== LOCAL_CONNECTION_ID ? activeConnectionId : null)
}
for (const agent of roster?.agents ?? []) {
diff --git a/apps/desktop/src/store/projects.test.ts b/apps/desktop/src/store/projects.test.ts
index 4a7c4a9a3ab..7c63055b389 100644
--- a/apps/desktop/src/store/projects.test.ts
+++ b/apps/desktop/src/store/projects.test.ts
@@ -176,7 +176,11 @@ describe('projects RPC profile forwarding', () => {
const next = payload()
next.projects[1] = { ...next.projects[1], sessionCount: 1, sessionIds: ['s2'] }
- const request = vi.fn().mockResolvedValueOnce(payload()).mockResolvedValueOnce(payload()).mockResolvedValueOnce(next)
+ const request = vi
+ .fn()
+ .mockResolvedValueOnce(payload())
+ .mockResolvedValueOnce(payload())
+ .mockResolvedValueOnce(next)
const gateway = { connectionState: 'open', request }
activeGateway.mockReturnValue(gateway as never)
gatewayAtom.set(gateway as never)
diff --git a/apps/desktop/src/store/prompts.test.ts b/apps/desktop/src/store/prompts.test.ts
index 34c45f5752c..00a3a21009c 100644
--- a/apps/desktop/src/store/prompts.test.ts
+++ b/apps/desktop/src/store/prompts.test.ts
@@ -347,11 +347,7 @@ describe('answerApproval', () => {
rememberServerRequest({ fail: vi.fn(), id: 'srv-1', method: 'approval', params: {}, respond })
const request = vi.fn()
- await answerApproval(
- { request } as never,
- { requestId: 'r1', serverRequestId: 'srv-1', sessionId: 's1' },
- 'once'
- )
+ await answerApproval({ request } as never, { requestId: 'r1', serverRequestId: 'srv-1', sessionId: 's1' }, 'once')
expect(respond).toHaveBeenCalledWith({ choice: 'once' })
expect(request).not.toHaveBeenCalled()
diff --git a/apps/desktop/src/store/session-gone-latch.ts b/apps/desktop/src/store/session-gone-latch.ts
index 17d23ab30c1..83a475043e8 100644
--- a/apps/desktop/src/store/session-gone-latch.ts
+++ b/apps/desktop/src/store/session-gone-latch.ts
@@ -125,14 +125,14 @@ export function resetBackgroundPollingGuardAfterRebind(
* 2-arg call shape exactly (gateway.request callers assert on it); one that
* does (approval.respond, #55433) has the deadline forwarded. */
export function ambientRequestFor(gateway: {
- request: (method: string, params: Record<string, unknown>, timeoutMs?: number, signal?: AbortSignal) => Promise<unknown>
-}): <R>(method: string, params?: Record<string, unknown>, timeoutMs?: number, signal?: AbortSignal) => Promise<R> {
- return <R>(
+ request: (
method: string,
- params?: Record<string, unknown>,
+ params: Record<string, unknown>,
timeoutMs?: number,
signal?: AbortSignal
- ) =>
+ ) => Promise<unknown>
+}): <R>(method: string, params?: Record<string, unknown>, timeoutMs?: number, signal?: AbortSignal) => Promise<R> {
+ return <R>(method: string, params?: Record<string, unknown>, timeoutMs?: number, signal?: AbortSignal) =>
(timeoutMs === undefined && signal === undefined
? gateway.request(method, params ?? {})
: gateway.request(method, params ?? {}, timeoutMs, signal)) as Promise<R>
diff --git a/apps/desktop/src/store/session-states.ts b/apps/desktop/src/store/session-states.ts
index c7923c19b60..1ea50b81059 100644
--- a/apps/desktop/src/store/session-states.ts
+++ b/apps/desktop/src/store/session-states.ts
@@ -390,6 +390,7 @@ const SILENT_TURN_RETRY: ErrorSurface = { code: 'stream_drop', layer: 'streaming
function withSilentTurnRetry(messages: ChatMessage[], streamId: string | null): ChatMessage[] {
const occurredAt = Date.now() / 1000
const error = 'The connection dropped before the reply finished.'
+
const targetId =
(streamId && messages.some(message => message.id === streamId) ? streamId : null) ??
[...messages].reverse().find(message => message.role === 'assistant' && message.pending)?.id ??
@@ -673,7 +674,11 @@ function lightUnreadCompletion(storedId: string, runtimeId?: string) {
const owner = runtimeId ? runtimeSessionOwner(runtimeId) : undefined
const profileHint =
- typeof owner === 'string' ? owner : typeof owner?.profile === 'string' && owner.profile.trim() ? owner.profile : undefined
+ typeof owner === 'string'
+ ? owner
+ : typeof owner?.profile === 'string' && owner.profile.trim()
+ ? owner.profile
+ : undefined
markSessionUnreadFinished(storedId, profileHint)
}
@@ -823,6 +828,7 @@ export function clearAllSessionStates() {
}
sessionWatchdogTimers.clear()
+
for (const timer of sessionEventSilenceTimers.values()) {
clearTimeout(timer)
}
diff --git a/apps/desktop/src/store/session.test.ts b/apps/desktop/src/store/session.test.ts
index a7cd0b394fb..91edde14f66 100644
--- a/apps/desktop/src/store/session.test.ts
+++ b/apps/desktop/src/store/session.test.ts
@@ -615,7 +615,7 @@ describe('mergeSessionPage', () => {
// the incoming page and unmatched by the root-only lineage key, so it
// used to survive as a title-less ghost row the backend never sent.
const previous = [
- session({ id: 'seg2' }), // old segment: no lineage of its own
+ session({ id: 'seg2' }), // old segment: no lineage of its own
session({ id: 'tip', _lineage_root_id: 'fresh-root' }),
session({ id: 'other' })
] as SessionInfo[]
@@ -655,9 +655,7 @@ describe('mergeSessionPage', () => {
// really was absorbed into the projected tip, but the pinned row is a
// different session. Lineage members must be profile-qualified like
// every other key in the survivor predicate.
- const previous = [
- session({ id: 'sess-42', profile: 'quietbot', title: 'Pinned quiet work' })
- ] as SessionInfo[]
+ const previous = [session({ id: 'sess-42', profile: 'quietbot', title: 'Pinned quiet work' })] as SessionInfo[]
const incoming = [
session({
diff --git a/apps/desktop/src/store/updates.ts b/apps/desktop/src/store/updates.ts
index 8356f9e2907..0b53c0cb3b3 100644
--- a/apps/desktop/src/store/updates.ts
+++ b/apps/desktop/src/store/updates.ts
@@ -1172,6 +1172,7 @@ function connectionKey(conn: HermesConnection | null): string {
if (conn?.mode !== 'remote') {
return String(conn?.mode)
}
+
return conn.profile ? `remote:${conn.baseUrl}:${conn.profile}` : `remote:${conn.baseUrl}`
}
diff --git a/apps/desktop/src/themes/backend-sync.test.ts b/apps/desktop/src/themes/backend-sync.test.ts
index b40d43da45b..fe8f5170587 100644
--- a/apps/desktop/src/themes/backend-sync.test.ts
+++ b/apps/desktop/src/themes/backend-sync.test.ts
@@ -5,7 +5,7 @@ import {
$backendThemes,
$pendingSkinApply,
__resetBackendSkinSync,
- ingestBackendSkin,
+ ingestBackendSkin
} from './backend-sync'
const skin = (name: string) => ({
diff --git a/apps/desktop/src/themes/backend-sync.ts b/apps/desktop/src/themes/backend-sync.ts
index e8b21a5581c..dc855b06aca 100644
--- a/apps/desktop/src/themes/backend-sync.ts
+++ b/apps/desktop/src/themes/backend-sync.ts
@@ -34,10 +34,12 @@ const BACKEND_THEMES_KEY = 'hermes-desktop-backend-themes-v1'
// Electron reads the active local `display.skin` before it creates the
// renderer. Seed it alongside the existing cache so an unreachable primary
// gateway cannot leave a first-time custom skin unknown to the theme registry.
-const localSkinPayload = typeof window === 'undefined' ? null : window.hermesDesktop?.localSkin ?? null
+const localSkinPayload = typeof window === 'undefined' ? null : (window.hermesDesktop?.localSkin ?? null)
const localSkin = localSkinPayload?.skin ?? null
export const localDisplaySkinName = (localSkin?.name ?? '').trim() || null
-export const localDisplaySkinProfile = localDisplaySkinName ? (localSkinPayload?.profile ?? '').trim() || 'default' : null
+export const localDisplaySkinProfile = localDisplaySkinName
+ ? (localSkinPayload?.profile ?? '').trim() || 'default'
+ : null
const readCached = (): Record<string, DesktopTheme> =>
Object.fromEntries(
diff --git a/apps/desktop/src/themes/context.test.tsx b/apps/desktop/src/themes/context.test.tsx
index 4bc8f8dc71e..5d5c077385d 100644
--- a/apps/desktop/src/themes/context.test.tsx
+++ b/apps/desktop/src/themes/context.test.tsx
@@ -5,7 +5,6 @@ import { $backendThemes, __resetBackendSkinSync, ingestBackendSkin } from './bac
import { skinPref, ThemeProvider, useTheme } from './context'
import { everforestTheme } from './presets'
-
// The live-authoring loop: Hermes writes/edits one skin file and every surface
// repaints. An in-place edit keeps the NAME — only the palette moves.
const bloomberg = (foreground: string) => ({
@@ -15,8 +14,7 @@ const bloomberg = (foreground: string) => ({
const cssVar = (name: string) => window.document.documentElement.style.getPropertyValue(name)
-const customStyleEl = () =>
- window.document.getElementById('hermes-desktop-custom-css') as HTMLStyleElement | null
+const customStyleEl = () => window.document.getElementById('hermes-desktop-custom-css') as HTMLStyleElement | null
describe('ThemeProvider ← backend skin sync', () => {
beforeEach(() => {
@@ -315,7 +313,11 @@ describe('ThemeProvider customCSS injection', () => {
act(() =>
ingestBackendSkin(
- { name: 'mono', colors: { background: '#ff00ff', ui_text: '#00ff00' }, customCSS: '.status-bar { background: black; }' },
+ {
+ name: 'mono',
+ colors: { background: '#ff00ff', ui_text: '#00ff00' },
+ customCSS: '.status-bar { background: black; }'
+ },
{ apply: true }
)
)
@@ -337,7 +339,10 @@ describe('ThemeProvider customCSS injection', () => {
)
act(() =>
- ingestBackendSkin({ name: 'default', colors: { background: '#123456' }, customCSS: '.chat-input { font-size: 18px; }' }, { apply: true })
+ ingestBackendSkin(
+ { name: 'default', colors: { background: '#123456' }, customCSS: '.chat-input { font-size: 18px; }' },
+ { apply: true }
+ )
)
expect(customStyleEl()?.textContent).toBe('.chat-input { font-size: 18px; }')
diff --git a/apps/desktop/src/themes/context.tsx b/apps/desktop/src/themes/context.tsx
index 0f76a7b7063..add78d7143c 100644
--- a/apps/desktop/src/themes/context.tsx
+++ b/apps/desktop/src/themes/context.tsx
@@ -21,7 +21,13 @@ import { $connection } from '@/store/session'
import { setAppearance } from '@/store/translucency'
import { $accentOverride } from './accent-override'
-import { $backendCustomCSS, $backendThemes, $pendingSkinApply, localDisplaySkinName, localDisplaySkinProfile } from './backend-sync'
+import {
+ $backendCustomCSS,
+ $backendThemes,
+ $pendingSkinApply,
+ localDisplaySkinName,
+ localDisplaySkinProfile
+} from './backend-sync'
import { $chatFontFamily, resolveChatFontFamily } from './chat-font'
import { harmonize, readableInk } from './color'
import { BUILTIN_THEME_LIST, DEFAULT_SKIN_NAME, DEFAULT_TYPOGRAPHY, nousTheme } from './presets'
@@ -95,13 +101,14 @@ export const modePref = profilePref(PROFILE_MODES_KEY, MODE_KEY, normalizeMode)
// into. A desktop-side pick remains the source of truth, and switching to a
// different profile cannot borrow a skin from this machine's initial profile.
const readBootProfileKey = () => normalizeProfileKey(storedString(LAST_PROFILE_KEY))
-const BOOT_PROFILE_KEY = typeof window === 'undefined' ? 'default' : localDisplaySkinProfile ?? readBootProfileKey()
+const BOOT_PROFILE_KEY = typeof window === 'undefined' ? 'default' : (localDisplaySkinProfile ?? readBootProfileKey())
// Provider state keeps the raw pick so a name nothing resolves YET (a backend
// skin the gateway hasn't seeded on this launch) isn't flattened to the default
// for the rest of the session — it paints as soon as the registry can resolve it.
const storedSkin = (profile: string): string =>
- skinPref.stored(profile) ?? (profile === BOOT_PROFILE_KEY ? localDisplaySkinName ?? DEFAULT_SKIN_NAME : DEFAULT_SKIN_NAME)
+ skinPref.stored(profile) ??
+ (profile === BOOT_PROFILE_KEY ? (localDisplaySkinName ?? DEFAULT_SKIN_NAME) : DEFAULT_SKIN_NAME)
/** Everything a peer window could change that this one has to repaint for. */
const APPEARANCE_KEYS = new Set([SKIN_KEY, PROFILE_SKINS_KEY, MODE_KEY, PROFILE_MODES_KEY])
diff --git a/apps/desktop/src/themes/presets.test.ts b/apps/desktop/src/themes/presets.test.ts
index bb49db6e343..3bc94baefe9 100644
--- a/apps/desktop/src/themes/presets.test.ts
+++ b/apps/desktop/src/themes/presets.test.ts
@@ -29,10 +29,13 @@ describe('theme typography emoji fallback (#40364)', () => {
describe('theme typography Latin Extended fallback (#61392)', () => {
const monoStacks: Array<[string, string]> = [
['DEFAULT_TYPOGRAPHY.fontMono', DEFAULT_TYPOGRAPHY.fontMono],
- ...BUILTIN_THEME_LIST.map(theme => [
- `${theme.name}.effectiveFontMono`,
- theme.typography?.fontMono ?? nousTheme.typography?.fontMono ?? DEFAULT_TYPOGRAPHY.fontMono
- ] as [string, string])
+ ...BUILTIN_THEME_LIST.map(
+ theme =>
+ [
+ `${theme.name}.effectiveFontMono`,
+ theme.typography?.fontMono ?? nousTheme.typography?.fontMono ?? DEFAULT_TYPOGRAPHY.fontMono
+ ] as [string, string]
+ )
]
it.each(monoStacks)('%s falls back to bundled JetBrains Mono before generic fonts', (_label, stack) => {
diff --git a/apps/desktop/src/themes/skin.ts b/apps/desktop/src/themes/skin.ts
index db407972876..618942a2d65 100644
--- a/apps/desktop/src/themes/skin.ts
+++ b/apps/desktop/src/themes/skin.ts
@@ -116,6 +116,6 @@ export function skinToDesktopTheme(skin: HermesSkin): DesktopTheme | null {
darkColors: palette,
// Pass through raw CSS so the desktop can inject it as a scoped <style>
// tag — users put CSS in their skin YAML instead of hacking app.asar.
- customCSS: skin.customCSS?.trim() || undefined,
+ customCSS: skin.customCSS?.trim() || undefined
}
}
diff --git a/apps/shared/src/catalog-browse.ts b/apps/shared/src/catalog-browse.ts
index ac3488be292..43dafea8d00 100644
--- a/apps/shared/src/catalog-browse.ts
+++ b/apps/shared/src/catalog-browse.ts
@@ -20,20 +20,25 @@ export function sortCatalogPlugins<T extends { name: string; addedAt?: string |
// its order, including ties, rather than reinterpreting missing star counts.
if (sort === 'stars') { return entries }
const field = sort === 'newest' ? 'addedAt' : 'updatedAt'
+
const date = (value?: string | null) => {
const ms = value ? Date.parse(value) : NaN
+
return Number.isFinite(ms) ? ms : -Infinity
}
+
return [...entries].sort((a, b) => date(b[field]) - date(a[field]) || a.name.localeCompare(b.name))
}
export function groupCatalogPlugins<T extends { category: string }>(entries: T[]): [string, T[]][] {
const buckets = new Map<string, T[]>()
+
for (const entry of entries) {
const key = Object.hasOwn(PLUGIN_CATEGORIES, entry.category) ? entry.category : 'general'
const bucket = buckets.get(key) ?? []
bucket.push(entry)
buckets.set(key, bucket)
}
+
return PLUGIN_CATEGORY_ORDER.filter(key => buckets.has(key)).map(key => [key, buckets.get(key)!])
}
diff --git a/tests-js/scripts/desktop-chat-smoke.ts b/tests-js/scripts/desktop-chat-smoke.ts
index f5cc88a2786..455c776ca06 100644
--- a/tests-js/scripts/desktop-chat-smoke.ts
+++ b/tests-js/scripts/desktop-chat-smoke.ts
@@ -64,11 +64,14 @@ export async function readChatIdentity(page: Page): Promise<ChatIdentity> {
const identity = identitySchema.parse(await page.evaluate(async (): Promise<ChatIdentity> => {
// SAFETY: the driver uses a desktop page; the returned IPC data is parsed outside the renderer.
const bridge = (window as SmokeWindow).hermesDesktop
+
if (!bridge) {
throw new Error('Desktop version bridge is unavailable')
}
+
return bridge.getVersion()
}))
+
return { ...identity, commit: identity.commit ?? null }
}
@@ -77,9 +80,11 @@ export function assertChatCommit(identity: ChatIdentity, expected: string, prove
if (identity.commit !== null && identity.commit !== expected) {
throw new Error(`Running commit ${identity.commit} does not equal expected ${expected}`)
}
+
if (provenanceCommit !== undefined && provenanceCommit !== expected) {
throw new Error(`Verified installation commit ${provenanceCommit} does not equal expected ${expected}`)
}
+
if (identity.commit === null && provenanceCommit !== expected) {
throw new Error('Desktop does not report a commit; verified installation provenance is required')
}
@@ -89,9 +94,11 @@ export async function readMockPrompts(mockUrl: string): Promise<string[]> {
const response = await fetch(`${validateMockUrl(mockUrl)}/__e2e__/prompts`, {
signal: AbortSignal.timeout(5000), redirect: 'error',
})
+
if (!response.ok) {
throw new Error(`Mock request witness returned HTTP ${response.status}`)
}
+
return z.object({ receivedPrompts: z.array(z.string()) }).parse(await response.json()).receivedPrompts
}
@@ -104,9 +111,11 @@ export async function waitForChatReady(page: Page, timeoutMs = 120_000): Promise
// viewport"). Require the editor; keep a textarea fallback only for a real,
// non-hidden input.
const root = page.locator('[data-slot="composer-root"]')
+
const composer = root
.locator('[contenteditable="true"]:visible, textarea:not([aria-hidden="true"]):not(.sr-only):visible')
.first()
+
try {
await composer.waitFor({ state: 'visible', timeout: timeoutMs })
await expect(composer).toBeEditable({ timeout: timeoutMs })
@@ -117,6 +126,7 @@ export async function waitForChatReady(page: Page, timeoutMs = 120_000): Promise
+ `(composer-root=${await root.count()}, contenteditable=${await root.locator('[contenteditable]').count()}): `
+ await composerDiagnostics(root))
}
+
return composer
}
@@ -126,6 +136,7 @@ async function composerDiagnostics(root: Locator): Promise<string> {
if (await root.count() === 0) {
return '(no [data-slot="composer-root"] in the DOM)'
}
+
return (await root.first().evaluate((el: Element): string => el.outerHTML.slice(0, 1500)))
} catch (error) {
return `(diagnostics unavailable: ${(error as Error).message})`
@@ -149,13 +160,16 @@ export function transcriptMessages(viewports: Element[]): TranscriptMessage[] {
// Its full text is stable across remounts, unlike a DOM index/handle.
// The new nonce and ordered, fresh assistant ID remain mandatory.
const legacyUser = !id && role === 'user' && node.getAttribute('data-slot') === 'aui_user-message-root'
+
const message: TranscriptMessage = {
id: legacyUser ? `legacy-user-text:${text}` : id,
role, text,
streaming: node.getAttribute('data-streaming') === 'true' || Boolean(node.querySelector('[data-message-streaming="true"]')),
error: Boolean(node.querySelector('[role="alert"]')),
}
+
if (legacyUser) { message.idSource = 'legacy-user-text' }
+
return message
}))
}
@@ -170,13 +184,16 @@ export function newCompletedPair(
): { user: TranscriptMessage; assistant: TranscriptMessage } | null {
const userIndex = messages.findIndex((message: TranscriptMessage): boolean =>
message.role === 'user' && message.text.includes(prompt) && !beforeIds.includes(message.id))
+
const user = messages[userIndex]
const assistant = messages[userIndex + 1]
+
if (!user || !user.id || !assistant?.id || assistant.role !== 'assistant'
|| beforeIds.includes(assistant.id) || !assistant.text.includes(MOCK_REPLY)
|| assistant.streaming || assistant.error) {
return null
}
+
return { user, assistant }
}
@@ -185,6 +202,7 @@ async function rendererEvidence(page: Page, consoleLines: readonly string[]): Pr
const state = await page.evaluate((): Record<string, unknown> => {
const viewport = document.querySelector('[data-slot="aui_thread-viewport"]')
const composer = document.querySelector('[data-slot="composer-root"]')
+
return {
url: location.href,
threadMessageCount: document.querySelectorAll('[data-message-id][data-role]').length,
@@ -193,6 +211,7 @@ async function rendererEvidence(page: Page, consoleLines: readonly string[]): Pr
alerts: [...document.querySelectorAll('[role="alert"]')].map((node: Element): string => node.textContent?.slice(0, 400) ?? ''),
}
}).catch((error: Error): Record<string, unknown> => ({ error: String(error) }))
+
return ['--- renderer state ---', JSON.stringify(state, null, 2), '--- renderer console ---', ...consoleLines].join('\n')
}
@@ -208,6 +227,7 @@ export async function runDesktopChatSmoke(page: Page, options: DesktopChatSmokeO
// A send the app swallows and a send the app never made look identical from
// the mock's side; the renderer's own console is the only witness to which.
const consoleLines: string[] = []
+
const onConsole = (message: ConsoleMessage): void => {
if (consoleLines.length >= 200) {
return
@@ -227,6 +247,7 @@ export async function runDesktopChatSmoke(page: Page, options: DesktopChatSmokeO
try {
const composer = await waitForChatReady(page)
const identity = await readChatIdentity(page)
+
if (expectCommit) { assertChatCommit(identity, expectCommit, options.provenanceCommit) }
const beforeIds = (await readTranscript(page)).map((message: TranscriptMessage): string => message.id)
const before = (await observe()).length
@@ -257,6 +278,7 @@ export async function runDesktopChatSmoke(page: Page, options: DesktopChatSmokeO
const prompts = await observe()
witnessIndex = prompts.findIndex((text: string, index: number): boolean => index >= before && text.includes(prompt))
receivedPrompt = prompts[witnessIndex] ?? ''
+
return witnessIndex >= before
}, { timeout: 90_000, message: 'The mock must receive this checkpoint prompt after the send' }).toBe(true)
await expect.poll(async (): Promise<boolean> => newCompletedPair(await readTranscript(page), beforeIds, prompt) !== null,
@@ -265,16 +287,21 @@ export async function runDesktopChatSmoke(page: Page, options: DesktopChatSmokeO
// Stop and the streaming marker must settle even when all reply text arrived.
await expect(page.locator('[data-slot="composer-root"] button[aria-label="Start voice conversation"]:visible, [data-slot="composer-root"] button[type="submit"][aria-label="Send"]:visible')).toBeVisible({ timeout: 90_000 })
const pair = newCompletedPair(await readTranscript(page), beforeIds, prompt)
+
if (!pair) {
throw new Error('New transcript pair disappeared before the turn completed')
}
+
await page.screenshot({ path: screenshot })
+
const receipt: DesktopChatReceipt = {
status: 'passed', phase, expectedCommit: expectCommit ?? null, identity, provenanceCommit: options.provenanceCommit ?? null, prompt,
requestWitness: { index: witnessIndex, prompt: receivedPrompt, before },
transcript: { beforeIds, ...pair }, turnComplete: true, screenshot,
}
+
fs.writeFileSync(receiptPath, `${JSON.stringify(receipt, null, 2)}\n`)
+
return receipt
} catch (error) {
await page.screenshot({ path: screenshot }).catch((): void => {})
diff --git a/tests-js/scripts/desktop-smoke-process.ts b/tests-js/scripts/desktop-smoke-process.ts
index 3d6503005f7..d5dc632b921 100644
--- a/tests-js/scripts/desktop-smoke-process.ts
+++ b/tests-js/scripts/desktop-smoke-process.ts
@@ -41,10 +41,12 @@ export function readInstallationCommit(root: string, origin: 'source' | 'bundled
// git off PATH so the product must provision its own, which this observer
// must not depend on.
const git: string = process.env.HERMES_E2E_REAL_GIT || 'git'
+
const commit = origin === 'source' ? nativeText(git, ['-C', root, 'rev-parse', 'HEAD'])
: z.object({ payload: z.literal('bundled'), commit: z.string() }).parse(
JSON.parse(fs.readFileSync(path.join(root, '..', 'install-stamp.json'), 'utf8')),
).commit
+
return z.string().regex(/^[0-9a-f]{40}$/).parse(commit)
}
@@ -56,14 +58,17 @@ const bundleEnvSchema = z.record(z.string(), z.string().nullable())
* stamp carried it, and for source checkpoints. */
export function readBundledBundleEnv(root: string): Record<string, string | null> | undefined {
const stampPath = path.join(root, '..', 'install-stamp.json')
+
// Absent for source checkpoints and artifacts built before the stamp carried
// bundleEnv; treat as "no baked env" and fall back to the pinned home.
if (!fs.existsSync(stampPath)) {
return undefined
}
+
const stamp = z.object({ payload: z.literal('bundled'), bundleEnv: bundleEnvSchema.optional() }).parse(
JSON.parse(fs.readFileSync(stampPath, 'utf8')),
)
+
return stamp.bundleEnv
}
@@ -75,27 +80,35 @@ export function readNativeProcesses(): NativeProcess[] {
if (process.platform === 'win32') {
const rows = windowsProcesses.parse(JSON.parse(nativeText('powershell.exe', ['-NoProfile', '-NonInteractive', '-Command',
'[Console]::OutputEncoding = [Text.UTF8Encoding]::new(); ConvertTo-Json -Compress -InputObject @(Get-CimInstance Win32_Process | Select-Object ProcessId,ParentProcessId,ExecutablePath,CommandLine)'])))
+
return rows.map((row): NativeProcess => ({ pid: row.ProcessId, parentPid: row.ParentProcessId, executable: row.ExecutablePath ?? '', command: row.CommandLine ?? '' }))
}
+
const table = nativeText('ps', ['-axo', 'pid=,ppid=,comm='])
+
return table.split('\n').flatMap((line: string): NativeProcess[] => {
const match = /^\s*(\d+)\s+(\d+)\s+(.+)$/.exec(line)
+
if (!match) {
return []
}
+
return [{ pid: Number(match[1]), parentPid: Number(match[2]), executable: match[3], command: '' }]
})
}
export function descendants(processes: NativeProcess[], parentPid: number): NativeProcess[] {
const owned = new Set<number>([parentPid])
+
for (;;) {
const priorSize = owned.size
+
for (const child of processes) {
if (owned.has(child.parentPid)) {
owned.add(child.pid)
}
}
+
if (priorSize === owned.size) {
return processes.filter((child: NativeProcess): boolean => child.pid !== parentPid && owned.has(child.pid))
}
@@ -104,17 +117,21 @@ export function descendants(processes: NativeProcess[], parentPid: number): Nati
function linuxListeningPid(port: number, candidates: NativeProcess[]): number[] {
const inodes = new Set<string>()
+
for (const filename of ['/proc/net/tcp', '/proc/net/tcp6']) {
for (const line of fs.readFileSync(filename, 'utf8').split('\n').slice(1)) {
const fields = line.trim().split(/\s+/)
+
if (fields[3] === '0A' && Number.parseInt(fields[1].split(':')[1], 16) === port) {
inodes.add(`socket:[${fields[9]}]`)
}
}
}
+
return candidates.filter((candidate: NativeProcess): boolean => {
try {
const dir = `/proc/${candidate.pid}/fd`
+
return fs.readdirSync(dir).some((fd: string): boolean => {
try { return inodes.has(fs.readlinkSync(path.join(dir, fd))) } catch { return false }
})
@@ -127,8 +144,10 @@ export function localBackendProcess(port: number, electronPid: number): NativePr
if (!Number.isInteger(port) || port <= 0 || port > 65535) {
throw new Error('Invalid backend port')
}
+
const children = descendants(readNativeProcesses(), electronPid)
let pids: number[]
+
if (process.platform === 'win32') {
pids = z.array(z.number()).parse(JSON.parse(nativeText('powershell.exe', ['-NoProfile', '-NonInteractive', '-Command',
`ConvertTo-Json -Compress -InputObject @((Get-NetTCPConnection -State Listen -LocalPort ${port} -ErrorAction Stop).OwningProcess | Sort-Object -Unique)`])))
@@ -138,11 +157,15 @@ export function localBackendProcess(port: number, electronPid: number): NativePr
} else {
pids = linuxListeningPid(port, children)
}
+
const matches = children.filter((child: NativeProcess): boolean => pids.includes(child.pid))
+
if (matches.length !== 1) {
throw new Error(`Expected one Electron-owned backend listener on port ${port}; found ${matches.length}`)
}
+
const backend = matches[0]
+
if (process.platform === 'linux') {
backend.executable = fs.readlinkSync(`/proc/${backend.pid}/exe`)
backend.cwd = fs.readlinkSync(`/proc/${backend.pid}/cwd`)
@@ -158,6 +181,7 @@ export function localBackendProcess(port: number, electronPid: number): NativePr
backend.pythonPath = psEnvValue(environment, 'PYTHONPATH')
backend.virtualEnv = psEnvValue(environment, 'VIRTUAL_ENV')
}
+
return backend
}
@@ -167,29 +191,37 @@ export function assertBackendOrigin(backend: NativeProcess, root: string, origin
if (path.basename(root) !== 'agent-payload' || !within(root, backend.executable)) {
throw new Error('Bundled backend listener is not running the installed agent-payload interpreter')
}
+
return
}
+
// PM's Windows .cmd fallback encodes the installation-bound bootstrap;
// POSIX launchers pass that same script directly as Python's -c argument.
const encoded = /base64\.b64decode\('([A-Za-z0-9+/=]+)'\)/.exec(backend.command)?.[1]
const command = encoded ? Buffer.from(encoded, 'base64').toString('utf8') : backend.command
// Source venvs may resolve to system Python; their entry script still lives in the installation.
const spellings = [root, fs.realpathSync(root)].flatMap((value: string): string[] => [value, JSON.stringify(value).slice(1, -1)])
+
const namesInstallRoot = spellings.some((value: string): boolean => {
const escaped = value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
+
return new RegExp(`(?:^|[\\s"'])${escaped}(?:[/\\\\]|[\\s"']|$)`, process.platform === 'win32' ? 'i' : '').test(command)
})
+
const sameTree = (value?: string): boolean => {
if (value === undefined) {
return false
}
+
// An unreadable path is no evidence, not a crash: a process cwd can be gone.
try { return fs.realpathSync(value) === fs.realpathSync(root) } catch { return false }
}
+
// A Python -m entry has no source path in argv. Its live import root is
// either the captured editable root (Nix) or the process's working directory.
const moduleLaunch = /(?:^|\s)"?-m"?\s+"?hermes_cli\.main"?(?:\s|$)/.test(command)
&& /^python(?:w|\d+(?:\.\d+)*)?(?:\.exe)?$/i.test(path.basename(backend.executable))
+
if (moduleLaunch) {
// A captured root is authoritative: the launcher told us which tree it bound.
if (backend.sourceRoot !== undefined) {
@@ -197,8 +229,10 @@ export function assertBackendOrigin(backend: NativeProcess, root: string, origin
throw new Error('Source backend listener imports a different source tree'
+ ` (HERMES_PYTHON_SRC_ROOT=${backend.sourceRoot}, expected=${root}, command=${backend.command})`)
}
+
return
}
+
// Without a captured root the backend's cwd is NOT sufficient on its own --
// the app hands the backend ITS OWN directory (the smoke's home), so a
// cwd-only inference calls a backend running the installation's own venv
@@ -212,9 +246,11 @@ export function assertBackendOrigin(backend: NativeProcess, root: string, origin
// platform that cannot (Windows) stays strict.
const joinsInstall = (value?: string): boolean => value !== undefined
&& value.split(path.delimiter).some((entry: string): boolean => entry !== '' && sameTree(entry))
+
const usesInstallEnvironment = joinsInstall(backend.pythonPath)
|| (backend.virtualEnv !== undefined && backend.virtualEnv.trim() !== ''
&& sameTree(path.dirname(backend.virtualEnv)))
+
// Some platforms expose no way to read another process's environment or cwd, so a
// module-launched backend there can never name its tree in argv (Windows: the venv
// launcher hands the interpreter over as a system python). The listener has already
@@ -224,16 +260,20 @@ export function assertBackendOrigin(backend: NativeProcess, root: string, origin
// that can read one.
const processEvidenceUnreadable = backend.cwd === undefined
&& backend.pythonPath === undefined && backend.virtualEnv === undefined
+
const appOwnsBackend = processEvidenceUnreadable
&& evidence.appReportedRoot !== undefined && sameTree(evidence.appReportedRoot)
+
if (!sameTree(backend.cwd) && !namesInstallRoot && !usesInstallEnvironment && !appOwnsBackend) {
throw new Error('Source backend listener imports a different source tree'
+ ` (cwd=${backend.cwd ?? '(unreadable)'}, HERMES_PYTHON_SRC_ROOT=(unset),`
+ ` executable=${backend.executable}, expected=${root},`
+ ` appReportedRoot=${evidence.appReportedRoot ?? '(unreported)'}, command=${backend.command})`)
}
+
return
}
+
if (!namesInstallRoot) {
throw new Error('Source backend listener command does not name the expected installed source tree')
}
diff --git a/tests-js/scripts/desktop-smoke.test.ts b/tests-js/scripts/desktop-smoke.test.ts
index 5ef73fda5df..cd4521a3970 100644
--- a/tests-js/scripts/desktop-smoke.test.ts
+++ b/tests-js/scripts/desktop-smoke.test.ts
@@ -18,13 +18,16 @@ import { MOCK_REPLY, startMockServer } from './mock-server.ts'
test('one server owns inference and a fresh, per-server prompt witness', async (): Promise<void> => {
const first = await startMockServer()
const second = await startMockServer()
+
try {
expect(await readMockPrompts(first.url)).toEqual([])
const prompt = 'unique request from the OLD checkpoint'
+
const response = await fetch(`${first.url}/v1/chat/completions`, {
method: 'POST', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ model: 'mock-model', messages: [{ role: 'user', content: prompt }] }),
})
+
expect(await response.json()).toMatchObject({ choices: [{ message: { content: MOCK_REPLY } }] })
expect(await readMockPrompts(first.url)).toEqual(first.receivedPrompts)
expect(first.receivedPrompts).toEqual([prompt])
@@ -33,6 +36,7 @@ test('one server owns inference and a fresh, per-server prompt witness', async (
body: JSON.stringify({ messages: [{ role: 'user', content: [{ type: 'text', text: 'NEW multipart prompt' }] }] }),
})
expect(await readMockPrompts(first.url)).toEqual([prompt, 'NEW multipart prompt'])
+
// A body shape the witness does not recognize records nothing rather than a
// half-parsed string — that is the empty-witness case the desktop smoke
// reports as a poll timeout, so the mock logs the parsed shape on this path.
@@ -42,6 +46,7 @@ test('one server owns inference and a fresh, per-server prompt witness', async (
body: JSON.stringify({ messages: [{ role: 'user', content }] }),
})
}
+
// No user turn at all leaves `lastUserMessage` undefined — the shape the
// diagnostic must still describe without throwing.
await fetch(`${first.url}/v1/chat/completions`, {
@@ -54,11 +59,13 @@ test('one server owns inference and a fresh, per-server prompt witness', async (
await first.close()
await second.close()
}
+
await expect(readMockPrompts(first.url)).rejects.toThrow()
})
test('provider reconfiguration preserves feed, plugins, history and explicit fixture options', (): void => {
const home = fs.mkdtempSync(path.join(os.tmpdir(), 'smoke-config-'))
+
try {
const feed = { desktop_feed_base_url: 'http://127.0.0.1:8123/feed' }
fs.writeFileSync(path.join(home, 'config.yaml'), yaml.dump({ updates: feed, plugins: { witness: true }, model: { temperature: 0.7 } }))
@@ -89,20 +96,24 @@ test('OLD history, partial/wrong replies, active streams and errors cannot satis
const before = old.map((row: TranscriptMessage): string => row.id)
const user = message('new-user', 'user', 'new nonce')
const reply = message('new-reply', 'assistant', MOCK_REPLY)
+
for (const rows of [old, [...old, user], [...old, user, { ...reply, id: 'old-reply' }],
[...old, user, { ...reply, text: 'boot chain is working' }], [...old, user, { ...reply, text: 'wrong' }],
[...old, user, { ...reply, streaming: true }], [...old, user, { ...reply, error: true }],
[...old, user, message('other-user', 'user', 'unrelated'), reply]]) {
expect(newCompletedPair(rows, before, 'new nonce')).toBeNull()
}
+
expect(newCompletedPair([...old, user, reply], before, 'new nonce')).toEqual({ user, assistant: reply })
})
test.runIf(process.platform !== 'win32')('shell wrapper exports the live witness URL without losing journey config', (): void => {
const home = fs.mkdtempSync(path.join(os.tmpdir(), 'smoke-wrapper-'))
const assets = path.resolve(import.meta.dirname, '../../tests/install/e2e-assets')
+
try {
fs.writeFileSync(path.join(home, 'config.yaml'), 'updates:\n desktop_feed_base_url: http://127.0.0.1:1234/feed\n')
+
const result = spawnSync('bash', ['-c', `
set -eu
ok() { printf '%s\\n' "$*"; }
@@ -113,6 +124,7 @@ test.runIf(process.platform !== 'win32')('shell wrapper exports the live witness
mock_start "$HERMES_HOME"
node --input-type=module -e 'const r=await fetch(process.env.HERMES_E2E_MOCK_URL+"/__e2e__/prompts"); if(!r.ok || (await r.json()).receivedPrompts.length!==0)process.exit(1)'
`], { env: { ...process.env, ASSETS: assets, HERMES_HOME: home, LOG_DIR: home }, encoding: 'utf8', timeout: 20_000 })
+
expect(result.status, result.stdout + result.stderr).toBe(0)
expect(yaml.load(fs.readFileSync(path.join(home, 'config.yaml'), 'utf8'))).toMatchObject({ updates: { desktop_feed_base_url: 'http://127.0.0.1:1234/feed' } })
} finally { fs.rmSync(home, { recursive: true, force: true }) }
@@ -120,11 +132,13 @@ test.runIf(process.platform !== 'win32')('shell wrapper exports the live witness
test.runIf(process.platform === 'linux')('origin proof finds the live child listener and rejects a package impostor', async (): Promise<void> => {
const child = spawn(process.execPath, ['-e', 'const s=require("node:net").createServer();s.listen(0,"127.0.0.1",()=>console.log(s.address().port))'], { stdio: ['ignore', 'pipe', 'pipe'] })
+
try {
const port = await new Promise<number>((resolve, reject): void => {
child.once('error', reject)
child.stdout.once('data', (data: Buffer): void => resolve(Number(data.toString().trim())))
})
+
const backend = localBackendProcess(port, process.pid)
expect(backend.pid).toBe(child.pid)
expect(backend.executable).toBe(fs.realpathSync(process.execPath))
@@ -136,6 +150,7 @@ test.runIf(process.platform === 'linux')('origin proof finds the live child list
test('a backend bound to the tree by environment needs no root in argv', (): void => {
const home = fs.mkdtempSync(path.join(os.tmpdir(), 'smoke-env-origin-'))
+
try {
const root = path.join(home, 'hermes-agent')
fs.mkdirSync(path.join(root, 'venv'), { recursive: true })
@@ -145,8 +160,10 @@ test('a backend bound to the tree by environment needs no root in argv', (): voi
const resolvedPython = fs.realpathSync(process.execPath)
const interpreter = path.join(home, 'python3.11')
fs.symlinkSync(resolvedPython, interpreter)
+
const base = { pid: process.pid, parentPid: 1, executable: interpreter, cwd: home,
command: `"${resolvedPython}" "-m" "hermes_cli.main" serve --host 127.0.0.1 --port 0` }
+
// Control: with no environment evidence this is still a different tree.
expect((): void => { assertBackendOrigin(base, root, 'source') }).toThrow('source tree')
expect((): void => {
@@ -167,11 +184,13 @@ test('a backend bound to the tree by environment needs no root in argv', (): voi
test('a platform that cannot read the backend environment proves ownership by the app', (): void => {
const home = fs.mkdtempSync(path.join(os.tmpdir(), 'smoke-owner-origin-'))
+
try {
const root = path.join(home, 'hermes-agent')
const other = path.join(home, 'other-tree')
fs.mkdirSync(root, { recursive: true })
fs.mkdirSync(other, { recursive: true })
+
// The Windows shape: the app's venv launcher hands the interpreter over as a system
// python, so argv never names the tree, and this platform exposes neither the
// backend's cwd nor its environment.
@@ -181,6 +200,7 @@ test('a platform that cannot read the backend environment proves ownership by th
executable: path.join(home, 'python.exe'),
command: `"${path.join(home, 'python.exe')}" "-m" "hermes_cli.main" serve --host 127.0.0.1 --port 0`,
}
+
// Control row: with nothing readable and no report from the app, this is still a
// different tree.
expect((): void => { assertBackendOrigin(backend, root, 'source') }).toThrow('source tree')
@@ -203,13 +223,16 @@ test('a platform that cannot read the backend environment proves ownership by th
test('OLD update-window source provenance carries its verified app identity to the listener check', (): void => {
const home = fs.mkdtempSync(path.join(os.tmpdir(), 'smoke-old-owner-origin-'))
+
try {
const root = path.join(home, 'hermes-agent')
const other = path.join(home, 'other-tree')
fs.mkdirSync(root, { recursive: true })
fs.mkdirSync(other, { recursive: true })
+
const backend = { pid: 2, parentPid: 1, executable: path.join(home, 'python.exe'),
command: `"${path.join(home, 'python.exe')}" -m hermes_cli.main dashboard --port 0` }
+
expect((): void => {
assertUpdateWindowBackendOrigin(backend, { hermesRoot: root }, root, 'source')
}).not.toThrow()
@@ -224,21 +247,26 @@ test('source launch restores only an explicitly captured exact editable root', (
const specPath = path.join(home, 'launch.json')
const childRoot = path.join(home, 'child')
fs.mkdirSync(childRoot)
+
const options = { exe: process.execPath, root: home, origin: 'source' as const, home,
'user-data': path.join(home, 'user-data'), out: home, phase: 'old' as const,
'expect-commit': 'a'.repeat(40), 'launch-spec': specPath }
+
const writeSpec = (sourceRoot: string): void => {
// oxlint-disable-next-line anti-slop/no-shape-in-symbol-names -- This is the existing launch-capture wire field.
fs.writeFileSync(specPath, JSON.stringify({ argv: [process.execPath], cwd: home, matchedShape: 'packaged',
env: { HERMES_DESKTOP_PYTHON: process.execPath, HERMES_PYTHON_SRC_ROOT: sourceRoot } }))
}
+
try {
writeSpec(home)
expect(resolveSmokeLaunch(options).env.HERMES_PYTHON_SRC_ROOT).toBe(home)
+
for (const wrong of [childRoot, path.dirname(home), 'relative-root']) {
writeSpec(wrong)
expect((): void => { resolveSmokeLaunch(options) }).toThrow('expected source installation')
}
+
expect(smokeEnvironment({ HERMES_PYTHON_SRC_ROOT: home }, home, options['user-data']).HERMES_PYTHON_SRC_ROOT).toBeUndefined()
} finally { fs.rmSync(home, { recursive: true, force: true }) }
})
@@ -248,14 +276,17 @@ test.runIf(process.platform === 'linux')('module-launched source listener proves
fs.mkdirSync(path.join(home, 'hermes_cli'))
fs.writeFileSync(path.join(home, 'hermes_cli', '__init__.py'), '')
fs.writeFileSync(path.join(home, 'hermes_cli', 'main.py'), 'import socket, time\ns = socket.socket()\ns.bind(("127.0.0.1", 0))\ns.listen()\nprint(s.getsockname()[1], flush=True)\ntime.sleep(60)\n')
+
const child = spawn('python3', ['-m', 'hermes_cli.main'], {
cwd: home, env: { ...process.env, HERMES_PYTHON_SRC_ROOT: home }, stdio: ['ignore', 'pipe', 'pipe'],
})
+
try {
const port = await new Promise<number>((resolve, reject): void => {
child.once('error', reject)
child.stdout.once('data', (data: Buffer): void => resolve(Number(data.toString().trim())))
})
+
const backend = localBackendProcess(port, process.pid)
expect(backend.sourceRoot).toBe(home)
expect(backend.cwd).toBe(home)
@@ -271,10 +302,13 @@ test.runIf(process.platform === 'linux')('module-launched source listener proves
test('a module launch proves its tree without leaning on the app-owned cwd', (): void => {
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'smoke-venv-root-'))
+
try {
const python = path.join(root, 'venv', 'bin', 'python')
+
const launched = (executable: string, command: string): Parameters<typeof assertBackendOrigin>[0] =>
({ pid: 1, parentPid: 1, executable, command, cwd: path.join(os.tmpdir(), 'app-owned-cwd') })
+
const venv = launched(python, `"${python}" "-m" "hermes_cli.main" "serve" --host 127.0.0.1 --port 0`)
// The app owns the backend's cwd; the installation's own venv interpreter is the evidence.
expect((): void => assertBackendOrigin(venv, root, 'source')).not.toThrow()
@@ -296,6 +330,7 @@ test('historical identity needs verified provenance and never overrides an app-r
const resources = fs.mkdtempSync(path.join(os.tmpdir(), 'smoke-stamp-'))
const payload = path.join(resources, 'agent-payload')
fs.mkdirSync(payload)
+
try {
fs.writeFileSync(path.join(resources, 'install-stamp.json'), JSON.stringify({ payload: 'bundled', commit: expected }))
expect(readInstallationCommit(payload, 'bundled')).toBe(expected)
@@ -306,14 +341,18 @@ test('historical identity needs verified provenance and never overrides an app-r
test('driver strips caller secrets and records missing executables as failure without launching', async (): Promise<void> => {
const home = fs.mkdtempSync(path.join(os.tmpdir(), 'smoke-admission-'))
+
try {
const env = smokeEnvironment({ PATH: '/usr/bin', DISPLAY: ':1', OPENAI_API_KEY: 'secret', HERMES_DESKTOP_BOOT_FAKE: '1',
HERMES_DESKTOP_HERMES_ROOT: '/wrong', PYTHONPATH: '/wrong', NODE_OPTIONS: '--inspect', HERMES_HOME: '/wrong' }, home, path.join(home, 'user-data'))
+
expect(env).toMatchObject({ PATH: '/usr/bin', DISPLAY: ':1', HERMES_HOME: home,
HERMES_DESKTOP_SKIP_QUIT_CONFIRM: '1' })
+
for (const key of ['OPENAI_API_KEY', 'HERMES_DESKTOP_BOOT_FAKE', 'HERMES_DESKTOP_HERMES_ROOT', 'PYTHONPATH', 'NODE_OPTIONS']) {
expect(env[key]).toBeUndefined()
}
+
await expect(runInstalledDesktopSmoke({ exe: path.join(home, 'missing'), root: home, origin: 'bundled', home,
'user-data': path.join(home, 'user-data'), out: home, phase: 'installed', 'expect-commit': 'a'.repeat(40) })).rejects.toThrow()
expect(JSON.parse(fs.readFileSync(path.join(home, 'desktop-chat-installed.json'), 'utf8'))).toMatchObject({ status: 'failed', origin: 'bundled' })
@@ -368,6 +407,7 @@ printf 'clean source runtime settled\\n'
test('Windows source settle bypasses the current cmd launcher beside a stale historical exe', (): void => {
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'smoke-windows-settle-'))
+
try {
const bin = path.join(root, '.hermes', 'bin')
fs.mkdirSync(bin, { recursive: true })
@@ -393,6 +433,7 @@ test('Windows source settle bypasses the current cmd launcher beside a stale his
test('Windows source settle bypasses the generated cmd command line', (): void => {
const workspace = fs.mkdtempSync(path.join(os.tmpdir(), 'smoke-windows-settle-live-'))
const root = path.join(workspace, 'source with spaces')
+
try {
const bin = path.join(root, '.hermes', 'bin')
const witness = path.join(workspace, 'settled.txt')
@@ -406,10 +447,12 @@ test('Windows source settle bypasses the generated cmd command line', (): void =
fs.writeFileSync(prepareLaunch, `from pathlib import Path\ndef prepare_launch(root, args):\n Path(${JSON.stringify(witness)}).write_text(str(root) + '\\n' + '\\n'.join(args))\n`)
fs.writeFileSync(path.join(bin, 'hermes.exe'), 'locked historical launcher')
const invocation = sourceRuntimeSettleCommand(root, process.env, 'win32')
+
const result = spawnSync(invocation.command, invocation.args, {
cwd: root, env: process.env, encoding: 'utf8', windowsHide: true,
windowsVerbatimArguments: invocation.windowsVerbatimArguments,
})
+
expect(result.status, result.stderr || String(result.error)).toBe(0)
expect(fs.readFileSync(witness, 'utf8').split(/\r?\n/)).toEqual([
root,
@@ -420,6 +463,7 @@ test('Windows source settle bypasses the generated cmd command line', (): void =
test('update-window process checks use the isolated launch environment, not the driver environment', (): void => {
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'smoke-update-window-process-'))
+
try {
const executable = path.join(root, 'Hermes')
const isolated = path.join(root, 'isolated-user-data')
@@ -429,6 +473,7 @@ test('update-window process checks use the isolated launch environment, not the
fs.mkdirSync(driver)
const prior = process.env.HERMES_DESKTOP_USER_DATA_DIR
process.env.HERMES_DESKTOP_USER_DATA_DIR = driver
+
try {
expect(() => assertUpdateWindowProcess(
{ executable, resources: root, userData: isolated },
@@ -462,6 +507,7 @@ test('predictSmokeHermesHome replays the bundle banner through the shared resolv
test('readBundledBundleEnv reads the stamped defaults/clears and is absent when unstamped', (): void => {
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'smoke-bundlenv-'))
+
try {
expect(readBundledBundleEnv(path.join(root, 'agent-payload'))).toBeUndefined()
fs.writeFileSync(path.join(root, 'install-stamp.json'), JSON.stringify({ payload: 'bundled', commit: 'a'.repeat(40), bundleEnv: { HERMES_HOME: null, SUFFIX: 'x' } }))
@@ -480,15 +526,19 @@ test('a bundle-env HERMES_HOME clear cannot strand the mock config outside the r
fs.mkdirSync(path.join(root, 'root'), { recursive: true })
fs.writeFileSync(exe, '#!/bin/sh\nexit 1\n')
fs.chmodSync(exe, 0o755)
+
const refuseLaunch = async (): Promise<never> => { throw new Error('launch refused by test') }
+
try {
const mock = await startMockServer()
+
try {
// The bundled app's banner turns HERMES_HOME=null into HERMES_HOME='', so
// resolveDesktopHermesHome falls to <userData>/hermes-home. The driver must
// have seeded THAT home, not only the --home the caller named.
await expect(runInstalledDesktopSmoke({ exe, root: path.join(root, 'root'), origin: 'bundled', home,
'user-data': userData, out: root, phase: 'installed', 'expect-commit': 'a'.repeat(40) }, refuseLaunch)).rejects.toThrow('launch refused by test')
+
for (const candidate of candidateSmokeHermesHomes(home, userData)) {
expect(yaml.load(fs.readFileSync(path.join(candidate, 'config.yaml'), 'utf8'))).toMatchObject({ model: { provider: 'custom' } })
const env = fs.readFileSync(path.join(candidate, '.env'), 'utf8')
@@ -496,6 +546,7 @@ test('a bundle-env HERMES_HOME clear cannot strand the mock config outside the r
expect(env).toMatch(/OPENAI_API_KEY=/)
expect(env).toMatch(/OPENAI_BASE_URL=http:\/\/127\.0\.0\.1:\d+\/v1/)
}
+
// Electron resolves shell folders before 'ready'; the sandboxed AppData/XDG
// dirs must exist or Windows applyDesktopIdentity crashes at launch.
for (const dir of ['AppData/Roaming', 'AppData/Local', '.config', '.local/share', '.cache']) {
@@ -514,6 +565,7 @@ test('writeEnvFile without a URL keeps the journey provider endpoint', (): void
// meant to record -- the upgrade's own .env sync later put it back, and the leg
// failed as "the upgrade changed the user's own state".
const home = fs.mkdtempSync(path.join(os.tmpdir(), 'smoke-env-'))
+
try {
writeEnvFile(home, 'e2e-mock-key', 'http://127.0.0.1:9000')
expect(fs.readFileSync(path.join(home, '.env'), 'utf8')).toContain('OPENAI_BASE_URL=http://127.0.0.1:9000/v1')
@@ -532,6 +584,7 @@ test('re-writing the same provider config is byte-identical', (): void => {
// entries on every call: same keys, same values, different bytes -- which the
// user-state verifier reported as "0 deleted, 1 modified ... no key differs".
const home = fs.mkdtempSync(path.join(os.tmpdir(), 'smoke-env-order-'))
+
try {
// The key is deliberately NOT last, with a comment after it: filtering the
// managed keys out and re-appending them moved them past the journey's own
diff --git a/tests-js/scripts/desktop-transcript.test.ts b/tests-js/scripts/desktop-transcript.test.ts
index 7b7d3d0a17e..09ac6fdfd40 100644
--- a/tests-js/scripts/desktop-transcript.test.ts
+++ b/tests-js/scripts/desktop-transcript.test.ts
@@ -16,6 +16,7 @@ function transcript(legacy: boolean): TranscriptFixture {
user.dataset.slot = 'aui_user-message-root'
user.dataset.role = 'user'
user.textContent = 'new checkpoint nonce'
+
// v2026.6.19 StickyHumanMessageContainer drops MessagePrimitive.Root's ID.
if (!legacy) { user.dataset.messageId = 'new-user' }
const assistant = document.createElement('div')
@@ -23,6 +24,7 @@ function transcript(legacy: boolean): TranscriptFixture {
assistant.dataset.messageId = 'new-assistant'
assistant.textContent = MOCK_REPLY
viewport.append(user, assistant)
+
return { viewport, user, assistant }
}
@@ -33,6 +35,7 @@ test('historical and current user bubbles retain ordered fresh-turn proof', ():
const pair = newCompletedPair(read(), [], 'new checkpoint nonce')
expect(pair?.user.text).toBe(user.textContent)
expect(pair?.assistant.id).toBe('new-assistant')
+
if (legacy) {
expect(pair?.user.id).toBe(`legacy-user-text:${user.textContent}`)
expect(pair?.user.idSource).toBe('legacy-user-text')
@@ -40,11 +43,13 @@ test('historical and current user bubbles retain ordered fresh-turn proof', ():
expect(pair?.user.id).toBe('new-user')
expect(pair?.user.idSource).toBeUndefined()
}
+
// Remounting preserved history cannot turn it into a new checkpoint.
const before = read().map((message: TranscriptMessage): string => message.id)
const remounted = transcript(legacy)
expect(newCompletedPair(transcriptMessages([remounted.viewport]), before, 'new checkpoint nonce')).toBeNull()
user.textContent = 'next checkpoint nonce'
+
if (!legacy) { user.dataset.messageId = 'next-user' }
// A fresh user still cannot reuse the previous assistant's real ID.
expect(newCompletedPair(read(), before, 'next checkpoint nonce')).toBeNull()
diff --git a/tests-js/scripts/mock-provider-config.ts b/tests-js/scripts/mock-provider-config.ts
index f604772290a..c63dfcfaeb4 100644
--- a/tests-js/scripts/mock-provider-config.ts
+++ b/tests-js/scripts/mock-provider-config.ts
@@ -6,6 +6,7 @@ import yaml from 'js-yaml'
import { z } from 'zod'
const section = z.object({}).passthrough()
+
const configSchema = z.object({
model: section.optional(),
providers: section.optional(),
@@ -21,10 +22,12 @@ const MOCK_PROVIDER_NAME = 'Mock'
export function validateMockUrl(value: string): string {
const url = new URL(value)
+
if (url.protocol !== 'http:' || url.hostname !== '127.0.0.1' || !url.port
|| url.username || url.password || url.search || url.hash || url.pathname !== '/') {
throw new Error('Mock URL must be a credential-free http://127.0.0.1:PORT origin')
}
+
return url.origin
}
@@ -42,6 +45,7 @@ export function writeMockProviderConfig(
const config = configSchema.parse(fs.existsSync(configPath) ? yaml.load(fs.readFileSync(configPath, 'utf8')) ?? {} : {})
const extra = configSchema.parse(extraConfig ? yaml.load(extraConfig) ?? {} : {})
const display = section.parse(extraDisplayConfig ? yaml.load(extraDisplayConfig) ?? {} : {})
+
const merged = {
...config,
// The endpoint must live in config.yaml: runtime_provider's bare-`custom`
@@ -66,9 +70,11 @@ export function writeMockProviderConfig(
approvals: { ...config.approvals, mode: 'off' },
...extra,
}
+
if (extraDisplayConfig) {
merged.display = { ...config.display, ...extra.display, ...display }
}
+
fs.writeFileSync(configPath, yaml.dump(merged), 'utf8')
}
@@ -77,13 +83,16 @@ export function writeEnvFile(hermesHome: string, apiKey = 'e2e-mock-key', mockUr
if (!/^[\w-]+$/.test(apiKey)) {
throw new Error('Mock key must be an inert single-line test value')
}
+
const envPath = path.join(hermesHome, '.env')
const prior = fs.existsSync(envPath) ? fs.readFileSync(envPath, 'utf8') : ''
const reps = new Map<string, string>([['MOCK_API_KEY', `MOCK_API_KEY=${apiKey}`]])
+
if (mockUrl) {
reps.set('OPENAI_BASE_URL', `OPENAI_BASE_URL=${mockUrl}/v1`)
reps.set('OPENAI_API_KEY', `OPENAI_API_KEY=${apiKey}`)
}
+
// Rewrite each key IN PLACE and append only the ones that are missing. Filtering
// the keys out and re-appending them at the end moved a journey's own entries on
// every call: same keys, same values, different bytes -- which the user-state
@@ -91,35 +100,44 @@ export function writeEnvFile(hermesHome: string, apiKey = 'e2e-mock-key', mockUr
// same pair twice is byte-identical now.
const seen = new Set<string>()
const kept: string[] = []
+
for (const line of prior.split(/\r?\n/)) {
const key = /^\s*(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)\s*=/.exec(line)?.[1]
+
if (!key || !reps.has(key)) {
kept.push(line)
+
continue
}
+
if (!seen.has(key)) {
kept.push(reps.get(key)!)
seen.add(key)
}
}
+
// Drop the prior file's trailing blank lines BEFORE appending: trimEnd() runs
// after the appended keys, so it cannot reach a blank line that they now follow.
while (kept.length > 0 && kept[kept.length - 1].trim() === '') {
kept.pop()
}
+
for (const [key, line] of reps) {
if (!seen.has(key)) {
kept.push(line)
}
}
+
fs.writeFileSync(envPath, `${kept.join('\n').trimEnd()}\n`, { mode: 0o600 })
}
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
const [home, url] = process.argv.slice(2)
+
if (!home || !url || !path.isAbsolute(home)) {
throw new Error('usage: node mock-provider-config.ts ABSOLUTE_HERMES_HOME MOCK_URL')
}
+
writeMockProviderConfig(home, url)
writeEnvFile(home, 'e2e-mock-key', url)
}
\ No newline at end of file
diff --git a/ui-tui/src/components/appLayout.tsx b/ui-tui/src/components/appLayout.tsx
index 9c243945dc1..b84914f97ed 100644
--- a/ui-tui/src/components/appLayout.tsx
+++ b/ui-tui/src/components/appLayout.tsx
@@ -191,54 +191,52 @@ const TranscriptPane = memo(function TranscriptPane({
<Box flexDirection="column" paddingX={1}>
{transcript.virtualHistory.topSpacer > 0 ? <Box height={transcript.virtualHistory.topSpacer} /> : null}
- {transcript.virtualRows
- .slice(transcript.virtualHistory.start, transcript.virtualHistory.end)
- .map(row => (
- <Box flexDirection="column" key={row.key} ref={transcript.virtualHistory.measureRef(row.key)}>
- {row.msg.role === 'user' && firstUserIdx >= 0 && row.index > firstUserIdx && (
- <Box marginTop={1}>
- <Text color={ui.theme.color.border}>───</Text>
- </Box>
- )}
+ {transcript.virtualRows.slice(transcript.virtualHistory.start, transcript.virtualHistory.end).map(row => (
+ <Box flexDirection="column" key={row.key} ref={transcript.virtualHistory.measureRef(row.key)}>
+ {row.msg.role === 'user' && firstUserIdx >= 0 && row.index > firstUserIdx && (
+ <Box marginTop={1}>
+ <Text color={ui.theme.color.border}>───</Text>
+ </Box>
+ )}
- {row.msg.kind === 'intro' ? (
- nativeMode ? null : (
- <Box flexDirection="column" paddingTop={1}>
- <Banner maxWidth={Math.max(1, composer.cols - 2)} t={ui.theme} />
-
- {row.msg.info && (
- <SessionPanel
- info={row.msg.info}
- maxWidth={Math.max(1, composer.cols - 2)}
- sid={ui.sid}
- t={ui.theme}
- />
- )}
- </Box>
- )
- ) : row.msg.kind === 'panel' && row.msg.panelData ? (
- <Panel sections={row.msg.panelData.sections} t={ui.theme} title={row.msg.panelData.title} />
- ) : (
- <MessageLine
- cols={bodyCols}
- compact={ui.compact}
- detailsMode={ui.detailsMode}
- detailsModeCommandOverride={ui.detailsModeCommandOverride}
- msg={row.msg}
- prev={prevRenderedMsg(i => transcript.virtualRows[i]?.msg, row.index, {
- commandOverride: ui.detailsModeCommandOverride,
- detailsMode: ui.detailsMode,
- sections: ui.sections
- })}
- sections={ui.sections}
- t={ui.theme}
- timestamps={ui.timestamps}
- />
- )}
+ {row.msg.kind === 'intro' ? (
+ nativeMode ? null : (
+ <Box flexDirection="column" paddingTop={1}>
+ <Banner maxWidth={Math.max(1, composer.cols - 2)} t={ui.theme} />
+
+ {row.msg.info && (
+ <SessionPanel
+ info={row.msg.info}
+ maxWidth={Math.max(1, composer.cols - 2)}
+ sid={ui.sid}
+ t={ui.theme}
+ />
+ )}
+ </Box>
+ )
+ ) : row.msg.kind === 'panel' && row.msg.panelData ? (
+ <Panel sections={row.msg.panelData.sections} t={ui.theme} title={row.msg.panelData.title} />
+ ) : (
+ <MessageLine
+ cols={bodyCols}
+ compact={ui.compact}
+ detailsMode={ui.detailsMode}
+ detailsModeCommandOverride={ui.detailsModeCommandOverride}
+ msg={row.msg}
+ prev={prevRenderedMsg(i => transcript.virtualRows[i]?.msg, row.index, {
+ commandOverride: ui.detailsModeCommandOverride,
+ detailsMode: ui.detailsMode,
+ sections: ui.sections
+ })}
+ sections={ui.sections}
+ t={ui.theme}
+ timestamps={ui.timestamps}
+ />
+ )}
- {row.index === lastUserIdx && <LiveTodoPanel />}
- </Box>
- ))}
+ {row.index === lastUserIdx && <LiveTodoPanel />}
+ </Box>
+ ))}
{transcript.virtualHistory.bottomSpacer > 0 ? <Box height={transcript.virtualHistory.bottomSpacer} /> : null}
diff --git a/ui-tui/src/entry.tsx b/ui-tui/src/entry.tsx
index c9f5c48e055..d4670ea6019 100644
--- a/ui-tui/src/entry.tsx
+++ b/ui-tui/src/entry.tsx
@@ -38,6 +38,7 @@ resetTerminalModes()
// graceful-exit cleanups is safe.
process.on('exit', () => {
resetTerminalModes()
+
if (NATIVE_MODE) {
clearNativeTuiFrame()
}
diff --git a/ui-tui/src/lib/terminalModes.ts b/ui-tui/src/lib/terminalModes.ts
index a2c1371fbf3..9c658990cb2 100644
--- a/ui-tui/src/lib/terminalModes.ts
+++ b/ui-tui/src/lib/terminalModes.ts
@@ -33,6 +33,7 @@ export function clearNativeTuiFrame(stream: ResettableStream = process.stdout):
try {
stream.write('\x1b[2J\x1b[H')
+
return true
} catch {
return false
diff --git a/ui-tui/src/lib/termux.ts b/ui-tui/src/lib/termux.ts
index c2cfe915c13..0bae8c39cde 100644
--- a/ui-tui/src/lib/termux.ts
+++ b/ui-tui/src/lib/termux.ts
@@ -28,4 +28,4 @@ export const isTermuxTuiMode = (env: NodeJS.ProcessEnv = process.env): boolean =
}
return true
-}
\ No newline at end of file
+}