diff --git a/apps/desktop/src/app/desktop-controller.tsx b/apps/desktop/src/app/desktop-controller.tsx index 9df44d628cec..47b55c180080 100644 --- a/apps/desktop/src/app/desktop-controller.tsx +++ b/apps/desktop/src/app/desktop-controller.tsx @@ -414,7 +414,9 @@ export function DesktopController() { // still resolves into the Pinned section via sessionByAnyId. const refreshCronSessions = useCallback(async () => { try { - const { sessions } = await listAllProfileSessions(CRON_SECTION_LIMIT, 1, 'exclude', 'recent', 'all', { + const cronProfile = profileScope === ALL_PROFILES ? 'all' : profileScope + + const { sessions } = await listAllProfileSessions(CRON_SECTION_LIMIT, 1, 'exclude', 'recent', cronProfile, { source: 'cron' }) @@ -422,7 +424,7 @@ export function DesktopController() { } catch { // Non-fatal: the cron section just stays empty/stale. } - }, []) + }, [profileScope]) // Messaging-platform sessions as their own slice, fetched separately from // local recents so each platform renders a self-managed section and never @@ -430,7 +432,9 @@ export function DesktopController() { // seeds every platform; the sidebar splits the rows per source. const refreshMessagingSessions = useCallback(async () => { try { - const result = await listAllProfileSessions(MESSAGING_SECTION_LIMIT, 1, 'exclude', 'recent', 'all', { + const msgProfile = profileScope === ALL_PROFILES ? 'all' : profileScope + + const result = await listAllProfileSessions(MESSAGING_SECTION_LIMIT, 1, 'exclude', 'recent', msgProfile, { excludeSources: MESSAGING_EXCLUDED_SOURCES }) @@ -445,7 +449,7 @@ export function DesktopController() { } catch { // Non-fatal: the messaging sections just stay empty/stale. } - }, []) + }, [profileScope]) // Page a single platform's section independently (mirrors the per-profile // pager): fetch that source's next window and merge it back in place, leaving @@ -453,8 +457,9 @@ export function DesktopController() { const loadMoreMessagingForPlatform = useCallback(async (platform: string) => { const inPlatform = (s: SessionInfo) => normalizeSessionSource(s.source) === platform const loaded = $messagingSessions.get().filter(inPlatform).length + const loadProfile = profileScope === ALL_PROFILES ? 'all' : profileScope - const result = await listAllProfileSessions(loaded + SIDEBAR_SESSIONS_PAGE_SIZE, 1, 'exclude', 'recent', 'all', { + const result = await listAllProfileSessions(loaded + SIDEBAR_SESSIONS_PAGE_SIZE, 1, 'exclude', 'recent', loadProfile, { source: platform }) @@ -467,7 +472,7 @@ export function DesktopController() { const total = result.total ?? incoming.length setMessagingPlatformTotals(prev => ({ ...prev, [platform]: Math.max(total, incoming.length) })) - }, []) + }, [profileScope]) // Cron *jobs* drive the sidebar "Cron jobs" section. Jobs are created // synchronously (agent tool call or the cron UI), so refreshing here right diff --git a/apps/desktop/src/hermes.ts b/apps/desktop/src/hermes.ts index 8e0656a9e7ab..0c1da4099ab8 100644 --- a/apps/desktop/src/hermes.ts +++ b/apps/desktop/src/hermes.ts @@ -585,8 +585,10 @@ export function testMessagingPlatform(platformId: string): Promise { + const qs = _apiProfile ? `?profile=${encodeURIComponent(_apiProfile)}` : '' + return window.hermesDesktop.api({ - path: '/api/cron/jobs' + path: `/api/cron/jobs${qs}` }) }