fmt(js): npm run fix on merge (#105451)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
hermes-seaeye[bot]
2026-09-08 00:13:36 +00:00
committed by GitHub
parent aa1a546a22
commit 966637323e
15 changed files with 61 additions and 23 deletions
+6 -1
View File
@@ -335,7 +335,12 @@ test('the merged-tail seed recovers a sentinel spliced onto a partial stderr lin
test('the merged-tail seed does not match prose that merely names the sentinel', async () => {
const child = makeFakeChild()
const wait = waitForDashboardPort(child, 50, () => '', () => 'still waiting for HERMES_BACKEND_READY from the backend\n')
const wait = waitForDashboardPort(
child,
50,
() => '',
() => 'still waiting for HERMES_BACKEND_READY from the backend\n'
)
await assert.rejects(wait, /Timed out waiting/)
})
+1 -1
View File
@@ -36,7 +36,7 @@ const LOCKFILE_SCHEMA_VERSION = 2
// an old running dashboard unsafe to reattach to (token handling, readiness/spawn
// args, served-token reconciliation). A mismatch forces a clean respawn.
const PROTOCOL_VERSION = 1
const READY_RE = READY_IN_MERGED_OUTPUT_RE // the remote log is `>> log 2>&1`: merged, not line-accurate
const READY_RE = READY_IN_MERGED_OUTPUT_RE // the remote log is `>> log 2>&1`: merged, not line-accurate
const REMOTE_LOCK_DIR = '~/.hermes/desktop-ssh'
const SUPPORTED_REMOTE_OS = new Set(['Linux', 'Darwin'])
const DEFAULT_READY_TIMEOUT_MS = 45_000
@@ -153,7 +153,9 @@ describe('ComposerDirectiveActions', () => {
const button = screen.getByRole('button')
fireEvent.pointerOut(button, { relatedTarget: button.firstElementChild })
act(() => { vi.advanceTimersByTime(750) })
act(() => {
vi.advanceTimersByTime(750)
})
expect(pillValue()).toBe('https://example.com')
})
@@ -167,9 +169,13 @@ describe('ComposerDirectiveActions', () => {
fireEvent.pointerOut(chip, { relatedTarget: null })
fireEvent.mouseEnter(screen.getByRole('button').parentElement!)
fireEvent.mouseLeave(screen.getByRole('button').parentElement!)
act(() => { vi.advanceTimersByTime(300) })
act(() => {
vi.advanceTimersByTime(300)
})
fireEvent.pointerOut(document.body, { relatedTarget: document.documentElement })
act(() => { vi.advanceTimersByTime(200) })
act(() => {
vi.advanceTimersByTime(200)
})
expect(pillValue()).toBeNull()
})
@@ -135,7 +135,8 @@ function RepoFlatSection({
// Discovery may resurrect a removed worktree, never an explicit sidebar hide.
const ordered = overlaidGroups.filter(
group =>
group.isMain || !dismissedWorktrees.includes(group.id) ||
group.isMain ||
!dismissedWorktrees.includes(group.id) ||
(removedWorktrees.includes(group.id) && group.path && discoveredWorktreePaths.has(group.path))
)
@@ -154,7 +154,11 @@ function renderEnteredProjectWithLiveWorktree() {
<EnteredProjectContent
project={project({ repos: [{ groups: [group()], id: '/repo', label: 'Repo', path: '/repo', sessionCount: 0 }] })}
renderRows={() => null}
repoWorktrees={{ '/repo': [{ branch: 'feature', detached: false, isMain: false, locked: false, path: '/repo/.worktrees/feature' }] }}
repoWorktrees={{
'/repo': [
{ branch: 'feature', detached: false, isMain: false, locked: false, path: '/repo/.worktrees/feature' }
]
}}
/>
)
}
@@ -446,7 +450,6 @@ describe('flat-list date-divider new-session drag source', () => {
})
})
describe('explicit worktree dismissal', () => {
it('resurfaces removed worktrees on discovery but not a subsequent explicit hide', async () => {
dismissWorktree('/repo/.worktrees/feature', { removed: true })
@@ -106,6 +106,7 @@ describe('ContextUsagePanel', () => {
const { container, unmount } = render(
<ContextUsagePanel breakdown={breakdown} loading={false} usage={{ ...usage, context_estimated: estimated }} />
)
const header = container.querySelector('[data-slot="context-usage-panel"] > div')?.textContent ?? ''
expect(header.includes('~')).toBe(estimated)
@@ -40,11 +40,17 @@ export function ContextUsagePanel({ breakdown, loading, usage }: ContextUsagePan
<p className="font-medium text-foreground">{copy.title}</p>
<span className="text-[0.6875rem] text-muted-foreground">
{copy.tokenSummary(`${usage.context_estimated ? "~" : ""}${compactNumber(contextUsed)}`, compactNumber(contextMax))}
{copy.tokenSummary(
`${usage.context_estimated ? '~' : ''}${compactNumber(contextUsed)}`,
compactNumber(contextMax)
)}
</span>
</div>
<p className="text-[0.6875rem] text-foreground">{usage.context_estimated ? '~' : ''}{copy.percentFull(contextPercent)}</p>
<p className="text-[0.6875rem] text-foreground">
{usage.context_estimated ? '~' : ''}
{copy.percentFull(contextPercent)}
</p>
<ContextUsageBar categories={categories} segmentTotal={segmentTotal} />
+1 -1
View File
@@ -43,7 +43,7 @@ export function contextBar(percent: number | undefined, width = 10): string {
export function usageContextLabel(usage: UsageStats): string {
if (usage.context_max) {
return `${usage.context_estimated ? "~" : ""}${compactNumber(usage.context_used ?? 0)}/${compactNumber(usage.context_max)}`
return `${usage.context_estimated ? '~' : ''}${compactNumber(usage.context_used ?? 0)}/${compactNumber(usage.context_max)}`
}
return usage.total > 0 ? `${compactNumber(usage.total)} tok` : ''
@@ -62,6 +62,7 @@ const { $profiles } = await import('./profile')
const { $activeSessionId, _resetSessionOwnerHintsForTests, setSessionOwnerHint, setSessions } =
await import('./session')
const { $gateway } = await import('./gateway')
const { clearAllPrompts } = await import('./prompts')
+1 -5
View File
@@ -208,11 +208,7 @@ export const $dismissedWorktreeIds = persistentAtom(
)
// Only successful git removals may reappear on discovery. Explicit hides,
// including legacy dismissals without provenance, remain hidden.
export const $removedWorktreeIds = persistentAtom(
'hermes.desktop.removedWorktrees',
[] as string[],
Codecs.stringArray
)
export const $removedWorktreeIds = persistentAtom('hermes.desktop.removedWorktrees', [] as string[], Codecs.stringArray)
export const $sidebarPinsOpen = atom(true)
export const $sidebarRecentsOpen = atom(true)
// Cron-job sessions live in their own section below recents, collapsed by
@@ -83,6 +83,7 @@ describe('refreshOnboarding', () => {
it('keeps onboarding work in its initiating lifetime and profile', async () => {
const { startManualOnboarding, startProviderOAuth, saveOnboardingApiKey, closeManualOnboarding } =
await import('./onboarding')
const requests: { path: string; profile?: string }[] = []
let release!: () => void
let delayKey = true
+12
View File
@@ -344,6 +344,7 @@ async function completeWithModelConfirm(
if (generation !== flowGeneration) {
return
}
const defaults = await fetchProviderDefaultModel(preferredSlugs, ctx.profile)
if (generation !== flowGeneration) {
@@ -369,11 +370,13 @@ async function completeWithModelConfirm(
if (generation !== flowGeneration) {
return
}
notifyGatewayTools(res.gateway_tools)
} catch (error) {
if (generation !== flowGeneration) {
return
}
onFail(error instanceof Error ? error.message : 'Hermes could not save the selected model.')
return
@@ -433,11 +436,13 @@ async function refreshProviders() {
if (generation !== flowGeneration) {
return
}
patch({ mode: providers.length > 0 ? 'oauth' : 'apikey', providers })
} catch {
if (generation !== flowGeneration) {
return
}
patch({ mode: 'apikey', providers: [] })
} finally {
if (generation === flowGeneration) {
@@ -725,6 +730,7 @@ export async function startProviderOAuth(provider: OAuthProvider, ctx: Onboardin
if (generation !== flowGeneration) {
return
}
setFlow({ status: 'error', provider, message: `Could not start sign-in: ${errMessage(error)}` })
}
}
@@ -756,6 +762,7 @@ async function pollSession(provider: OAuthProvider, start: DeviceStart, ctx: Onb
if (generation !== flowGeneration) {
return
}
clearPoll()
setFlow({ status: 'error', provider, start, message: `Polling failed: ${errMessage(error)}` })
}
@@ -805,6 +812,7 @@ export async function submitOnboardingCode(ctx: OnboardingContext) {
if (generation !== flowGeneration) {
return
}
setFlow({ status: 'error', provider, start, message: errMessage(error) })
}
}
@@ -925,6 +933,7 @@ export async function saveOnboardingApiKey(
if (generation !== flowGeneration) {
return { ok: false }
}
// For API-key flows we don't have a definitive provider id (the
// user picked which API key they're entering, but the corresponding
// backend slug — e.g. OPENROUTER_API_KEY → "openrouter" — is the
@@ -1008,6 +1017,7 @@ export async function saveOnboardingLocalEndpoint(baseUrl: string, apiKey: strin
if (generation !== flowGeneration) {
return { ok: false }
}
await ctx.requestGateway('reload.env').catch(() => undefined)
if (generation !== flowGeneration) {
@@ -1064,6 +1074,7 @@ export async function setOnboardingModel(model: string) {
if (generation !== flowGeneration) {
return
}
const current = $desktopOnboarding.get().flow
if (current.status === 'confirming_model') {
@@ -1073,6 +1084,7 @@ export async function setOnboardingModel(model: string) {
if (generation !== flowGeneration) {
return
}
notifyError(error, 'Could not change model')
const current = $desktopOnboarding.get().flow
@@ -108,11 +108,14 @@ describe('StatusRule session title', () => {
it('marks only estimated context occupancy at every visible width', () => {
for (const cols of [80, 120, 200]) {
for (const estimated of [true, false]) {
const text = textContent(StatusRule({
...baseProps, cols,
statusBarFields: new Set(['context_detail']),
usage: { ...baseProps.usage, context_estimated: estimated }
}))
const text = textContent(
StatusRule({
...baseProps,
cols,
statusBarFields: new Set(['context_detail']),
usage: { ...baseProps.usage, context_estimated: estimated }
})
)
const context = text.match(/(~?\d+(?:\.\d+)?k(?:\/\d+k| tok))/)?.[1]
+3 -1
View File
@@ -744,7 +744,9 @@ export const sessionCommands: SlashCommand[] = [
if (r.context_max) {
const mark = r.context_estimated ? '~' : ''
sections.push({ text: `Context: ${mark}${f(r.context_used)} / ${f(r.context_max)} (${mark}${r.context_percent}%)` })
sections.push({
text: `Context: ${mark}${f(r.context_used)} / ${f(r.context_max)} (${mark}${r.context_percent}%)`
})
}
if (r.compressions) {
+2 -1
View File
@@ -731,7 +731,8 @@ export function StatusRule({
{showBar ? (
<Text color={t.color.muted} wrap="truncate-end">
{' │ '}
<Text color={barColor}>[{bar}]</Text> <Text color={barColor}>{pct != null ? `${contextMark}${pct}%` : ''}</Text>
<Text color={barColor}>[{bar}]</Text>{' '}
<Text color={barColor}>{pct != null ? `${contextMark}${pct}%` : ''}</Text>
</Text>
) : null}
{showDuration ? (