Skip to content

The agent that grows with you

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

hermes-seaeye[bot]2e627917a65e
diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts
index 8ebdd506d40..91822574999 100644
--- a/apps/desktop/electron/main.ts
+++ b/apps/desktop/electron/main.ts
@@ -46,7 +46,13 @@ import {
} from './api-transport'
import { appIconCandidates, resolveAppIcon, shouldOverrideDockIcon } from './app-icon'
import { stageAppInstallerFile } from './app-installer-file'
-import { appVersionInfo, type AppVersionInfo, assertSourceUpdateChannel, nativeAboutVersion, packagedReleaseChannel } from './app-version'
+import {
+ appVersionInfo,
+ type AppVersionInfo,
+ assertSourceUpdateChannel,
+ nativeAboutVersion,
+ packagedReleaseChannel
+} from './app-version'
import { runAppInstallerChecker } from './appinstaller-checker'
import { installApplicationMenuAfterFirstWindow } from './application-menu-startup'
import { stopBackendChild as stopBackendChildImpl, waitForBackendExit } from './backend-child'
diff --git a/apps/desktop/src/app/chat/session-tile.tsx b/apps/desktop/src/app/chat/session-tile.tsx
index 550b8e38ca9..e94f862bb2d 100644
--- a/apps/desktop/src/app/chat/session-tile.tsx
+++ b/apps/desktop/src/app/chat/session-tile.tsx
@@ -29,7 +29,11 @@ import { formatRefValue } from '@/components/assistant-ui/directive-text'
import { CenteredThreadSpinner } from '@/components/assistant-ui/thread/status'
import { findGroupOfPane } from '@/components/pane-shell/tree/model'
import { $layoutTree, closeTreePane, moveTreePane, setTreeGroupTabStrip } from '@/components/pane-shell/tree/store'
-import { $workspaceOwnerLabels, workspaceOwnerTitle, workspaceSessionRenameable } from '@/components/pane-shell/workspace-scope'
+import {
+ $workspaceOwnerLabels,
+ workspaceOwnerTitle,
+ workspaceSessionRenameable
+} from '@/components/pane-shell/workspace-scope'
import { Button } from '@/components/ui/button'
import { ConfirmDialog } from '@/components/ui/confirm-dialog'
import { transcribeAudio } from '@/hermes'
@@ -774,10 +778,16 @@ export function stackSessionTilesIntoMain(): void {
* updates in other sessions) — for a context menu that's almost never open.
* Same class as the TreeGroup fix (#72245): derive narrowly, bail out unless
* the derived values change. */
-function useTileMenuRow(storedSessionId: string): { pinId: string; profile?: string; renameable: boolean; title: string } {
- const cache = useRef<
- { key: string; value: { pinId: string; profile?: string; renameable: boolean; title: string } } | null
- >(null)
+function useTileMenuRow(storedSessionId: string): {
+ pinId: string
+ profile?: string
+ renameable: boolean
+ title: string
+} {
+ const cache = useRef<{
+ key: string
+ value: { pinId: string; profile?: string; renameable: boolean; title: string }
+ } | null>(null)
const subscribe = useCallback((onChange: () => void) => {
const offSessions = $sessions.listen(onChange)
diff --git a/apps/desktop/src/app/chat/sidebar/profile-rail-fleet.test.tsx b/apps/desktop/src/app/chat/sidebar/profile-rail-fleet.test.tsx
index ba87ee48b55..5eff2d6a3ee 100644
--- a/apps/desktop/src/app/chat/sidebar/profile-rail-fleet.test.tsx
+++ b/apps/desktop/src/app/chat/sidebar/profile-rail-fleet.test.tsx
@@ -293,7 +293,9 @@ describe('ProfileRail overflow', () => {
})
it('maps negative RTL offsets to physical clipped edges and scrolls toward hidden profiles', () => {
- profiles.set(Array.from({ length: 8 }, (_, index) => ({ is_default: index === 0, name: index ? `agent${index}` : 'default' })))
+ profiles.set(
+ Array.from({ length: 8 }, (_, index) => ({ is_default: index === 0, name: index ? `agent${index}` : 'default' }))
+ )
render(<ProfileRail />)
const scroller = screen.getByRole('button', { name: 'agent1' }).closest('.overflow-x-auto') as HTMLDivElement
scroller.style.direction = 'rtl'
diff --git a/apps/desktop/src/app/chat/sidebar/profile-switcher.tsx b/apps/desktop/src/app/chat/sidebar/profile-switcher.tsx
index 975ac63e203..50bded8ec5b 100644
--- a/apps/desktop/src/app/chat/sidebar/profile-switcher.tsx
+++ b/apps/desktop/src/app/chat/sidebar/profile-switcher.tsx
@@ -315,9 +315,7 @@ export function ProfileRail() {
clientHeight: el.clientWidth,
scrollHeight: el.scrollWidth,
scrollTop:
- getComputedStyle(el).direction === 'rtl'
- ? el.scrollWidth - el.clientWidth + el.scrollLeft
- : el.scrollLeft
+ getComputedStyle(el).direction === 'rtl' ? el.scrollWidth - el.clientWidth + el.scrollLeft : el.scrollLeft
}),
'x'
)
diff --git a/apps/desktop/src/app/settings/helpers.test.ts b/apps/desktop/src/app/settings/helpers.test.ts
index a8a61db1def..570c3eec5b5 100644
--- a/apps/desktop/src/app/settings/helpers.test.ts
+++ b/apps/desktop/src/app/settings/helpers.test.ts
@@ -281,6 +281,7 @@ describe('settings helpers', () => {
for (const builtin of BUILTIN_PERSONALITIES) {
expect(opts).toContain(builtin)
}
+
expect(opts).toContain('') // the "unset" sentinel
expect(opts).toContain('root_persona')
})
@@ -290,6 +291,7 @@ describe('settings helpers', () => {
personalities: { root_persona: {}, shared: {} },
agent: { personalities: { agent_persona: {}, shared: {} } }
}
+
const opts = enumOptionsFor('display.personality', '', config)!
expect(opts).toContain('root_persona')
expect(opts).toContain('agent_persona')
@@ -302,6 +304,7 @@ describe('settings helpers', () => {
const opts = enumOptionsFor('display.personality', '', { personalities: bad } as HermesConfigRecord)!
// still the built-ins + empty sentinel, no crash on a malformed block
expect(opts).toContain('')
+
for (const builtin of BUILTIN_PERSONALITIES) {
expect(opts).toContain(builtin)
}
@@ -316,6 +319,7 @@ describe('settings helpers', () => {
const config: HermesConfigRecord = {
personalities: { Catgirl: {}, ' Spaced ': {}, none: {}, Default: {}, NEUTRAL: {} }
} as HermesConfigRecord
+
const opts = enumOptionsFor('display.personality', '', config)!
// `Catgirl` folds to the built-in `catgirl` (offered once, not twice).
@@ -324,6 +328,7 @@ describe('settings helpers', () => {
// whitespace folded to the canonical key.
expect(opts).toContain('spaced')
expect(opts).not.toContain(' Spaced ')
+
// neutral spellings never surface as selectable rows (only the '' sentinel remains).
for (const neutral of ['none', 'Default', 'NEUTRAL', 'default', 'neutral']) {
expect(opts).not.toContain(neutral)
diff --git a/apps/desktop/src/app/settings/helpers.ts b/apps/desktop/src/app/settings/helpers.ts
index a792829b4e0..bb99f61f8a3 100644
--- a/apps/desktop/src/app/settings/helpers.ts
+++ b/apps/desktop/src/app/settings/helpers.ts
@@ -266,11 +266,14 @@ function personalityOptions(config: HermesConfigRecord): string[] {
// whitespace-padded, or neutral-named block never surfaces a row the runtime can't
// resolve, and a root/agent case clash dedupes to one canonical name (#123297).
const customNames: string[] = []
+
for (const key of ['personalities', 'agent.personalities']) {
const block = getNested(config, key)
+
if (isPlainObject(block)) {
for (const name of Object.keys(block)) {
const folded = foldPersonalityName(name)
+
if (folded) {
customNames.push(folded)
}
diff --git a/apps/desktop/src/lib/chat-runtime.ts b/apps/desktop/src/lib/chat-runtime.ts
index 8fac835cb38..7f8380c9d58 100644
--- a/apps/desktop/src/lib/chat-runtime.ts
+++ b/apps/desktop/src/lib/chat-runtime.ts
@@ -294,10 +294,12 @@ export function personalityNamesFromConfig(config: unknown): string[] {
// whitespace-padded, or neutral-named block doesn't surface a row the runtime
// can never resolve, and a root/agent case clash dedupes to one canonical name.
const names = new Set<string>()
+
for (const block of [root.personalities, agent.personalities]) {
if (block && typeof block === 'object' && !Array.isArray(block)) {
for (const name of Object.keys(block as Record<string, unknown>)) {
const key = foldPersonalityName(name)
+
if (key) {
names.add(key)
}
diff --git a/apps/desktop/src/lib/markdown-preprocess.ts b/apps/desktop/src/lib/markdown-preprocess.ts
index b1f5caf63a1..e36256690b3 100644
--- a/apps/desktop/src/lib/markdown-preprocess.ts
+++ b/apps/desktop/src/lib/markdown-preprocess.ts
@@ -684,6 +684,7 @@ function escapeCjkProseDollars(text: string): string {
if (!CJK_RE.test(body)) {
cursor = closingIndex
+
continue
}
diff --git a/apps/desktop/src/lib/personalities.ts b/apps/desktop/src/lib/personalities.ts
index eab2ea1ce41..f94473441a8 100644
--- a/apps/desktop/src/lib/personalities.ts
+++ b/apps/desktop/src/lib/personalities.ts
@@ -34,6 +34,9 @@ export const NEUTRAL_PERSONALITY_NAMES = new Set(['', 'none', 'default', 'neutra
* Returns '' for a neutral/blank name (caller skips it).
*/
export function foldPersonalityName(name: unknown): string {
- const key = String(name ?? '').trim().toLowerCase()
+ const key = String(name ?? '')
+ .trim()
+ .toLowerCase()
+
return NEUTRAL_PERSONALITY_NAMES.has(key) ? '' : key
}
diff --git a/apps/desktop/src/plugins/kanban/drawer.test.tsx b/apps/desktop/src/plugins/kanban/drawer.test.tsx
index 6b7f72bd839..d627664d7ff 100644
--- a/apps/desktop/src/plugins/kanban/drawer.test.tsx
+++ b/apps/desktop/src/plugins/kanban/drawer.test.tsx
@@ -427,7 +427,10 @@ describe('blocked task detail', () => {
fireEvent.click(await screen.findByRole('button', { name: 'Unblock task' }))
await waitFor(() =>
- expect(rest).toHaveBeenCalledWith('/tasks/t_example', expect.objectContaining({ method: 'PATCH', body: { status: 'ready' } }))
+ expect(rest).toHaveBeenCalledWith(
+ '/tasks/t_example',
+ expect.objectContaining({ method: 'PATCH', body: { status: 'ready' } })
+ )
)
})
})
diff --git a/apps/desktop/src/plugins/kanban/drawer.tsx b/apps/desktop/src/plugins/kanban/drawer.tsx
index 4235c8c8400..2bfc53d6cc3 100644
--- a/apps/desktop/src/plugins/kanban/drawer.tsx
+++ b/apps/desktop/src/plugins/kanban/drawer.tsx
@@ -232,7 +232,15 @@ function WorkspaceValue({ kind, path }: { kind: null | string | undefined; path:
/** The dashboard's diagnostics panel: severity-toned, plain-English, with the
* backend's structured recovery actions as buttons. `reassign` is skipped —
* the Assignee control in the meta table IS that action, inline. */
-function Diagnostics({ items, onReclaim, onUnblock }: { items: Diagnostic[]; onReclaim: () => void; onUnblock: () => void }) {
+function Diagnostics({
+ items,
+ onReclaim,
+ onUnblock
+}: {
+ items: Diagnostic[]
+ onReclaim: () => void
+ onUnblock: () => void
+}) {
const k = useKanban()
const act = (action: DiagnosticAction) => {
@@ -250,7 +258,9 @@ function Diagnostics({ items, onReclaim, onUnblock }: { items: Diagnostic[]; onR
<div className="flex flex-col gap-2">
{items.map(diag => {
const tone = SEVERITY_TONE[diag.severity]
- const actions = diag.actions.filter(action => action.kind === 'reclaim' || action.kind === 'unblock' || action.kind === 'cli_hint')
+ const actions = diag.actions.filter(
+ action => action.kind === 'reclaim' || action.kind === 'unblock' || action.kind === 'cli_hint'
+ )
return (
<Callout
@@ -1050,7 +1060,12 @@ export function TaskDrawer({
<Diagnostics
items={task.diagnostics}
onReclaim={() => void mutate(() => reclaimTask(task.id))()}
- onUnblock={() => void mutate(() => patchTask(task.id, { status: 'ready' }), () => host.notify({ kind: 'success', message: k.unblockedMessage(shortId(task.id)) }))()}
+ onUnblock={() =>
+ void mutate(
+ () => patchTask(task.id, { status: 'ready' }),
+ () => host.notify({ kind: 'success', message: k.unblockedMessage(shortId(task.id)) })
+ )()
+ }
/>
</Section>
)}