Skip to content

The agent that grows with you

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

hermes-seaeye[bot]b9eb37e5ebb6
diff --git a/apps/desktop/src/app/chat/right-rail/preview-pane.tsx b/apps/desktop/src/app/chat/right-rail/preview-pane.tsx
index bd2123c2a48..31def253333 100644
--- a/apps/desktop/src/app/chat/right-rail/preview-pane.tsx
+++ b/apps/desktop/src/app/chat/right-rail/preview-pane.tsx
@@ -18,12 +18,7 @@ import { reachablePreviewUrl } from '@/lib/preview-reach'
import { rafCoalesce } from '@/lib/raf-coalesce'
import { cn } from '@/lib/utils'
import { notify, notifyError } from '@/store/notifications'
-import {
- $previewServerRestart,
- failPreviewServerRestart,
- noteBrowserPage,
- type PreviewTarget
-} from '@/store/preview'
+import { $previewServerRestart, failPreviewServerRestart, noteBrowserPage, type PreviewTarget } from '@/store/preview'
import { ArtifactPreview } from './preview-artifact'
import { PreviewBrowserBar } from './preview-browser-bar'
diff --git a/apps/desktop/src/app/session/hooks/use-session-actions.test.tsx b/apps/desktop/src/app/session/hooks/use-session-actions.test.tsx
index 1cef8496248..aafafcad026 100644
--- a/apps/desktop/src/app/session/hooks/use-session-actions.test.tsx
+++ b/apps/desktop/src/app/session/hooks/use-session-actions.test.tsx
@@ -92,7 +92,11 @@ const RUNTIME_SESSION_ID = 'rt-new-001'
type HarnessHandle = Pick<
ReturnType<typeof useSessionActions>,
- 'createBackendSessionForSend' | 'openNewSessionTile' | 'removeSession' | 'selectSidebarItem' | 'startFreshSessionDraft'
+ | 'createBackendSessionForSend'
+ | 'openNewSessionTile'
+ | 'removeSession'
+ | 'selectSidebarItem'
+ | 'startFreshSessionDraft'
>
function storedSession(overrides: Partial<SessionInfo> = {}): SessionInfo {
@@ -2827,6 +2831,7 @@ describe('openNewSessionTile workspace target', () => {
])
let createParams: Record<string, unknown> | undefined
+
const requestGateway = vi.fn(async (method: string, params?: Record<string, unknown>) => {
if (method === 'session.create') {
createParams = params
diff --git a/apps/desktop/src/app/session/hooks/use-session-actions/index.ts b/apps/desktop/src/app/session/hooks/use-session-actions/index.ts
index 727242428ea..95708f282a7 100644
--- a/apps/desktop/src/app/session/hooks/use-session-actions/index.ts
+++ b/apps/desktop/src/app/session/hooks/use-session-actions/index.ts
@@ -624,17 +624,15 @@ export function useSessionActions({
// occupied (openTab path for "New session in Home").
const capturedRoute = options?.route === undefined ? $newChatRoute.get() : options.route
const workspaceScope = options?.workspaceScope ?? { workspaceMode: 'sessions' }
+
const cwd =
- options?.cwd === null
- ? ''
- : typeof options?.cwd === 'string'
- ? options.cwd.trim()
- : resolveNewSessionCwd()
+ options?.cwd === null ? '' : typeof options?.cwd === 'string' ? options.cwd.trim() : resolveNewSessionCwd()
const params = {
...(await desktopSessionCreateParams(cwd, capturedRoute)),
...(workspaceScope.workspaceMode === 'bots' ? { hidden: true } : {})
}
+
const created = capturedRoute
? await requestGatewayForAgent<SessionCreateResponse>(
capturedRoute.connectionId,
diff --git a/apps/desktop/src/app/session/workspace-session-target.test.ts b/apps/desktop/src/app/session/workspace-session-target.test.ts
index bbe22859b0c..852f83ab97f 100644
--- a/apps/desktop/src/app/session/workspace-session-target.test.ts
+++ b/apps/desktop/src/app/session/workspace-session-target.test.ts
@@ -89,6 +89,7 @@ describe('startWorkspaceSession', () => {
const requestGateway = vi.fn()
const activeSessionIdRef = { current: null }
+
const startFreshSessionDraft = vi.fn((options?: { workspaceTarget: NewChatWorkspaceTarget }) => {
setNewChatWorkspaceTarget(options?.workspaceTarget)
setCurrentCwd(options?.workspaceTarget || '')
diff --git a/apps/desktop/src/app/session/workspace-session-target.ts b/apps/desktop/src/app/session/workspace-session-target.ts
index d41aad375f5..868b7c404ac 100644
--- a/apps/desktop/src/app/session/workspace-session-target.ts
+++ b/apps/desktop/src/app/session/workspace-session-target.ts
@@ -42,6 +42,7 @@ export function startWorkspaceSession({
const target = explicitTarget || resolveNewSessionCwd()
startFreshSessionDraft(target ? { workspaceTarget: target } : undefined)
+
if (!target) {
return
}