Skip to content

The agent that grows with you

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

hermes-seaeye[bot]d07be6e1650a
diff --git a/apps/desktop/electron/remote-lifecycle.test.ts b/apps/desktop/electron/remote-lifecycle.test.ts
index a7f60be45d2..865e12d705f 100644
--- a/apps/desktop/electron/remote-lifecycle.test.ts
+++ b/apps/desktop/electron/remote-lifecycle.test.ts
@@ -321,15 +321,7 @@ test('pidIsOurDashboard accepts the venv entrypoint an installer wrapper execs i
])
assert.equal(
- await pidIsOurDashboard(
- ssh,
- 5,
- SPAWN_NONCE,
- '~/.local/bin/hermes',
- '/Users/cd9c/.hermes',
- OWNERSHIP_ID,
- 'ops'
- ),
+ await pidIsOurDashboard(ssh, 5, SPAWN_NONCE, '~/.local/bin/hermes', '/Users/cd9c/.hermes', OWNERSHIP_ID, 'ops'),
true
)
assert.match(ownershipProbe, /hermes-agent.*venv.*bin.*hermes/)
@@ -356,9 +348,14 @@ test.skipIf(process.platform === 'win32')(
await chmod(launcher, 0o755)
const backendFlags = [
- '--host', '127.0.0.1', '--port', '0',
- '--ssh-session-token-file', tokenPath,
- '--ssh-owner-nonce', SPAWN_NONCE
+ '--host',
+ '127.0.0.1',
+ '--port',
+ '0',
+ '--ssh-session-token-file',
+ tokenPath,
+ '--ssh-owner-nonce',
+ SPAWN_NONCE
]
const children: ReturnType<typeof spawn>[] = []
@@ -398,11 +395,27 @@ test.skipIf(process.platform === 'win32')(
true
)
assert.equal(
- await pidIsOurDashboard(ssh, child.pid, SPAWN_NONCE, launcher, '/unrelated/hermes-home', 'fedcba9876543210fedcba9876543210', 'ops'),
+ await pidIsOurDashboard(
+ ssh,
+ child.pid,
+ SPAWN_NONCE,
+ launcher,
+ '/unrelated/hermes-home',
+ 'fedcba9876543210fedcba9876543210',
+ 'ops'
+ ),
false
)
assert.equal(
- await pidIsOurDashboard(ssh, child.pid, SPAWN_NONCE, launcher, '/unrelated/hermes-home', OWNERSHIP_ID, 'wrong-profile'),
+ await pidIsOurDashboard(
+ ssh,
+ child.pid,
+ SPAWN_NONCE,
+ launcher,
+ '/unrelated/hermes-home',
+ OWNERSHIP_ID,
+ 'wrong-profile'
+ ),
false
)
@@ -410,18 +423,40 @@ test.skipIf(process.platform === 'win32')(
assert.equal(await waitForEntrypoint(misplacedIsolated), true)
assert.equal(
- await pidIsOurDashboard(ssh, misplacedIsolated.pid, SPAWN_NONCE, launcher, '/unrelated/hermes-home', OWNERSHIP_ID, 'ops'),
+ await pidIsOurDashboard(
+ ssh,
+ misplacedIsolated.pid,
+ SPAWN_NONCE,
+ launcher,
+ '/unrelated/hermes-home',
+ OWNERSHIP_ID,
+ 'ops'
+ ),
false,
'--isolated before serve must remain foreign'
)
const conflictingProfile = spawnInstaller([
- '--profile', 'ops', 'serve', '--isolated', ...backendFlags, '--profile', 'foreign'
+ '--profile',
+ 'ops',
+ 'serve',
+ '--isolated',
+ ...backendFlags,
+ '--profile',
+ 'foreign'
])
assert.equal(await waitForEntrypoint(conflictingProfile), true)
assert.equal(
- await pidIsOurDashboard(ssh, conflictingProfile.pid, SPAWN_NONCE, launcher, '/unrelated/hermes-home', OWNERSHIP_ID, 'ops'),
+ await pidIsOurDashboard(
+ ssh,
+ conflictingProfile.pid,
+ SPAWN_NONCE,
+ launcher,
+ '/unrelated/hermes-home',
+ OWNERSHIP_ID,
+ 'ops'
+ ),
false,
'a duplicate conflicting profile must remain foreign'
)
diff --git a/apps/desktop/electron/remote-lifecycle.ts b/apps/desktop/electron/remote-lifecycle.ts
index 9634323f169..501786863c9 100644
--- a/apps/desktop/electron/remote-lifecycle.ts
+++ b/apps/desktop/electron/remote-lifecycle.ts
@@ -425,9 +425,7 @@ async function pidIsOurDashboard(
'expected_entries={expected}\n' +
'if hermes_home:\n' +
' expected_entries.add(os.path.join(hermes_home,"hermes-agent","venv","bin","hermes"))\n' +
- `expected_token=os.path.expanduser(${shq(
- ownershipId ? spawnTokenPath(ownershipId, spawnNonce) : ''
- )})\n` +
+ `expected_token=os.path.expanduser(${shq(ownershipId ? spawnTokenPath(ownershipId, spawnNonce) : '')})\n` +
`expected_profile=${shq(profile)}\n` +
`nonce=${shq(spawnNonce)}\n` +
'try:\n' +
diff --git a/apps/desktop/src/app/session/hooks/use-route-resume.test.tsx b/apps/desktop/src/app/session/hooks/use-route-resume.test.tsx
index 5b872a32dd7..b2463699868 100644
--- a/apps/desktop/src/app/session/hooks/use-route-resume.test.tsx
+++ b/apps/desktop/src/app/session/hooks/use-route-resume.test.tsx
@@ -338,12 +338,7 @@ describe('useRouteResume', () => {
const { rerender } = render(<RouteResumeHarness {...props} />)
expect(resumeSession).not.toHaveBeenCalled()
- rerender(
- <RouteResumeHarness
- {...props}
- sessionResumeRequest={{ sequence: 1, sessionId: 'session-1' }}
- />
- )
+ rerender(<RouteResumeHarness {...props} sessionResumeRequest={{ sequence: 1, sessionId: 'session-1' }} />)
expect(resumeSession).toHaveBeenCalledTimes(1)
expect(resumeSession).toHaveBeenCalledWith('session-1', true)
diff --git a/apps/desktop/src/sdk/index.ts b/apps/desktop/src/sdk/index.ts
index a84afe55098..e91e0b65ca8 100644
--- a/apps/desktop/src/sdk/index.ts
+++ b/apps/desktop/src/sdk/index.ts
@@ -459,10 +459,7 @@ export const host = {
ensureAgent: async (connectionId: null | string, profile: string): Promise<void> =>
ensureGatewayAgent(connectionId, (profile ?? '').trim() || 'default'),
- openSession: async (
- storedSessionId: string,
- options: PluginOpenSessionOptions = {}
- ): Promise<void> => {
+ openSession: async (storedSessionId: string, options: PluginOpenSessionOptions = {}): Promise<void> => {
const generation = ++openSessionGeneration
const profile = (options.profile ?? '').trim()
const targetProfile = normalizeProfileKey(profile || $activeGatewayProfile.get())
diff --git a/apps/desktop/src/sdk/profile-routing.test.ts b/apps/desktop/src/sdk/profile-routing.test.ts
index c3c37eed02e..2b44afbd8fd 100644
--- a/apps/desktop/src/sdk/profile-routing.test.ts
+++ b/apps/desktop/src/sdk/profile-routing.test.ts
@@ -101,23 +101,13 @@ const { openSession: openSessionCore } = await import('@/app/open-session')
const { deleteProfile } = await import('@/hermes')
const { requestGatewayForAgent, requestGatewayForProfile, retireLocalProfileGateways } = await import('@/store/gateway')
-const {
- $activeGatewayProfile,
- $gatewaySwapTarget,
- $profiles,
- ensureGatewayProfile,
- refreshProfiles
-} = await import('@/store/profile')
+const { $activeGatewayProfile, $gatewaySwapTarget, $profiles, ensureGatewayProfile, refreshProfiles } =
+ await import('@/store/profile')
const { $focusedRuntimeId, $focusedSessionState, $focusedStoredSessionId } = await import('@/store/session-states')
-const {
- $activeSessionId,
- $messages,
- $selectedStoredSessionId,
- requestSessionResume,
- setResumeExhaustedSessionId
-} = await import('@/store/session')
+const { $activeSessionId, $messages, $selectedStoredSessionId, requestSessionResume, setResumeExhaustedSessionId } =
+ await import('@/store/session')
const setMockAtom = <T>(store: unknown, value: T) => (store as { set(next: T): void }).set(value)
@@ -448,7 +438,10 @@ describe('profile-aware plugin session opens', () => {
expectHistory: true,
hydrationTimeoutMs: 1_000
})
- .then(() => 'resolved', error => String(error))
+ .then(
+ () => 'resolved',
+ error => String(error)
+ )
await Promise.resolve()