Skip to content

The agent that grows with you

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

hermes-seaeye[bot]a51912c25b44
diff --git a/apps/desktop/src/lib/chat-messages.codex-json-sidecar.test.ts b/apps/desktop/src/lib/chat-messages.codex-json-sidecar.test.ts
index 4bbe8a3e309..984d193be12 100644
--- a/apps/desktop/src/lib/chat-messages.codex-json-sidecar.test.ts
+++ b/apps/desktop/src/lib/chat-messages.codex-json-sidecar.test.ts
@@ -3,15 +3,21 @@ import { expect, it } from 'vitest'
import { chatMessageText, toChatMessages } from './chat-messages'
it('hydrates the SQLite JSON-text sidecar returned by REST like the decoded RPC sidecar', () => {
- const items = [{
- type: 'message',
- role: 'assistant',
- phase: 'final_answer',
- content: [{ type: 'output_text', text: 'Durable reply' }]
- }]
+ const items = [
+ {
+ type: 'message',
+ role: 'assistant',
+ phase: 'final_answer',
+ content: [{ type: 'output_text', text: 'Durable reply' }]
+ }
+ ]
const row = {
- id: 1, role: 'assistant' as const, content: '', timestamp: 1, reasoning: 'Thinking before tool',
+ id: 1,
+ role: 'assistant' as const,
+ content: '',
+ timestamp: 1,
+ reasoning: 'Thinking before tool',
tool_calls: [{ id: 'call-1', type: 'function', function: { name: 'terminal', arguments: '{}' } }]
}
@@ -28,5 +34,9 @@ it('hydrates the SQLite JSON-text sidecar returned by REST like the decoded RPC
expect(toChatMessages([{ ...empty, codex_message_items: JSON.stringify([{ ...items[0], phase }]) }])).toEqual([])
}
- expect(chatMessageText(toChatMessages([{ ...row, content: 'Canonical reply', codex_message_items: JSON.stringify(items) }])[0])).toBe('Canonical reply')
+ expect(
+ chatMessageText(
+ toChatMessages([{ ...row, content: 'Canonical reply', codex_message_items: JSON.stringify(items) }])[0]
+ )
+ ).toBe('Canonical reply')
})
diff --git a/apps/desktop/src/lib/generated-images.ts b/apps/desktop/src/lib/generated-images.ts
index 05572752ee0..9a9243796fe 100644
--- a/apps/desktop/src/lib/generated-images.ts
+++ b/apps/desktop/src/lib/generated-images.ts
@@ -83,9 +83,7 @@ export function stripGeneratedImageEchoes(text: string, sources: readonly string
}
// Remove only attachment spans; surrounding whitespace may be Markdown syntax.
- let next = text
- .replace(/!\[[^\]\n]*\]\([^)\n]*\)/g, '')
- .replace(/\[[^\]\n]*\]\(\s*#media:[^)\n]*\)/g, '')
+ let next = text.replace(/!\[[^\]\n]*\]\([^)\n]*\)/g, '').replace(/\[[^\]\n]*\]\(\s*#media:[^)\n]*\)/g, '')
for (const source of unique([...sources])) {
next = next.replace(new RegExp(String.raw`(^|[\s([{])<?${regexEscape(source)}>?(?=$|[\s)\]},.!?])`, 'g'), '$1')
diff --git a/apps/desktop/src/lib/markdown-whitespace.test.ts b/apps/desktop/src/lib/markdown-whitespace.test.ts
index d8b889640b4..3a03789f141 100644
--- a/apps/desktop/src/lib/markdown-whitespace.test.ts
+++ b/apps/desktop/src/lib/markdown-whitespace.test.ts
@@ -24,6 +24,7 @@ describe('Markdown whitespace semantics', () => {
it('preserves text outside removed media and preview spans', () => {
const image = 'data:image/png;base64,' + 'A'.repeat(64)
+
for (const input of samples) {
expect(assistantTextPart(input)).toMatchObject({ type: 'text', text: input })
expect(renderMediaTags(input)).toBe(input)
@@ -33,7 +34,9 @@ describe('Markdown whitespace semantics', () => {
expect(stripGeneratedImageEchoes('![result](/tmp/image.png)\n' + input, ['/tmp/image.png'])).toBe('\n' + input)
expect(extractImageRefs('@image:/tmp/image.png\n' + input).cleanedText).toBe(input)
expect(extractEmbeddedImages(input + '\n\n' + image).cleanedText).toBe(input + '\n\n')
- expect(stripGeneratedImageEchoes(input + '\n\n![result](/tmp/image.png)', ['/tmp/image.png'])).toBe(input + '\n\n')
+ expect(stripGeneratedImageEchoes(input + '\n\n![result](/tmp/image.png)', ['/tmp/image.png'])).toBe(
+ input + '\n\n'
+ )
}
})
})
diff --git a/apps/desktop/src/store/voice-prefs.test.ts b/apps/desktop/src/store/voice-prefs.test.ts
index 60be68c1615..be3576670b9 100644
--- a/apps/desktop/src/store/voice-prefs.test.ts
+++ b/apps/desktop/src/store/voice-prefs.test.ts
@@ -17,7 +17,11 @@ it('keeps the desktop toggle local across config refreshes', async () => {
const prefs = await import('./voice-prefs')
const write = vi.spyOn(localStorage, 'setItem')
- if (fails) {write.mockImplementation(() => { throw new DOMException('Full', 'QuotaExceededError') })}
+ if (fails) {
+ write.mockImplementation(() => {
+ throw new DOMException('Full', 'QuotaExceededError')
+ })
+ }
vi.mocked(saveHermesConfig).mockClear()
try {
@@ -41,7 +45,11 @@ it('migrates the legacy preference once, not on every refresh', async () => {
const prefs = await import('./voice-prefs')
const write = vi.spyOn(localStorage, 'setItem')
- if (fails) {write.mockImplementation(() => { throw new DOMException('Denied', 'SecurityError') })}
+ if (fails) {
+ write.mockImplementation(() => {
+ throw new DOMException('Denied', 'SecurityError')
+ })
+ }
try {
prefs.applyAutoSpeakFromConfig(null)
diff --git a/ui-tui/src/__tests__/messages.test.ts b/ui-tui/src/__tests__/messages.test.ts
index 5dd3d1a700d..c85aaf87598 100644
--- a/ui-tui/src/__tests__/messages.test.ts
+++ b/ui-tui/src/__tests__/messages.test.ts
@@ -80,9 +80,11 @@ describe('toTranscriptMessages', () => {
it('uses the display-only completion title without exposing the model payload', () => {
const text = '[ASYNC DELEGATION BATCH COMPLETE — private]\nFull result evidence'
const title = 'Subagent Task Failed: Review changes'
+
const [message] = toTranscriptMessages([
{ role: 'user', text, display_kind: 'async_delegation_complete', display_metadata: { display_text: title } }
])
+
expect(message).toMatchObject({ kind: 'event', role: 'system', text: title })
expect(toTranscriptMessages([{ role: 'user', text }])[0]?.text).toBe(text)
})