The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(desktop): drop pool-limit notification wiring main added after the pool subsystem was removed
Tekniumc3632fcca363
diff --git a/apps/desktop/src/app/chat/composer/hooks/use-composer-submit.test.tsx b/apps/desktop/src/app/chat/composer/hooks/use-composer-submit.test.tsxindex d6e9ab9a1c2..4e797856b27 100644--- a/apps/desktop/src/app/chat/composer/hooks/use-composer-submit.test.tsx+++ b/apps/desktop/src/app/chat/composer/hooks/use-composer-submit.test.tsx@@ -62,8 +62,6 @@ function renderSubmitHook({const onSteer = vi.fn(async () => true)const onSteerHidden = vi.fn(async () => true)const onSubmit = vi.fn(async () => true)- const loadIntoComposer = vi.fn()- const stashAt = vi.fn()const queueCurrentDraft = vi.fn(() => true)let updatePaneVisible: Dispatch<SetStateAction<boolean>> | undefined@@ -140,8 +138,6 @@ function renderSubmitHook({onSteer,onSteerHidden,onSubmit,- loadIntoComposer,- stashAt,queueCurrentDraft,composerSurfaceId: resolvedSurfaceId,setPaneVisible(nextVisible: boolean) {@@ -184,6 +180,8 @@ describe('useComposerSubmit external request routing', () => {await waitFor(() => expect(h.onSubmit).toHaveBeenCalledWith('keep guidance', expect.objectContaining({ fromQueue: true, sessionId: 'runtime-session', storedSessionId: 'stored-session' })))expect(getQueuedPrompts('stored-session')).toEqual([])} finally { $connection.set(null); $queuedPromptsBySession.set({}) }+ })+it.each([true, false])('steers a busy external visible submit and queues only on rejection (%s)', async accepted => {const { onSteer, onSubmit, clearDraft } = renderSubmitHook({ busy: true, text: 'unsent draft' })onSteer.mockResolvedValue(accepted)diff --git a/apps/desktop/src/app/contrib/wiring-routing.ts b/apps/desktop/src/app/contrib/wiring-routing.tsindex 0c6fef02a51..b7cd694d1e1 100644--- a/apps/desktop/src/app/contrib/wiring-routing.ts+++ b/apps/desktop/src/app/contrib/wiring-routing.ts@@ -7,10 +7,6 @@import type { SessionOwnerRoute } from '@/store/session-request-router'-import { SETTINGS_ROUTE } from '../routes'--/** The in-app destination for pool-cap recovery. */-export const POOL_LIMITS_SETTINGS_ROUTE = `${SETTINGS_ROUTE}?tab=config:advanced`/*** Resolve a runtime session id back to its stored id by reverse-scanning thediff --git a/apps/desktop/src/app/contrib/wiring.tsx b/apps/desktop/src/app/contrib/wiring.tsxindex 185e73588ef..2fb0ed2bde2 100644--- a/apps/desktop/src/app/contrib/wiring.tsx+++ b/apps/desktop/src/app/contrib/wiring.tsx@@ -51,7 +51,6 @@ import { $cronReviewRequest, setCronFocusJobId } from '@/store/cron'import { requestGatewayForProfile } from '@/store/gateway'import { $pinnedSessionIds, pinSession, restoreWorktree, unpinSession } from '@/store/layout'import { notifyError } from '@/store/notifications'-import { $poolLimitsSettingsRequest } from '@/store/pool-limits'import { $previewTarget } from '@/store/preview'import {$activeGatewayProfile,@@ -164,7 +163,6 @@ import { $restartPreviewServer, useTitlebarToolContributions } from './panes'import { type AmbientGatewayRequest, createSessionRpcDispatcher } from './session-rpc-dispatcher'import { ChatRoutesSurface, SidebarSurface, StatusbarSurface, TerminalSurface } from './surfaces'import type { WiringActions, WiringApi } from './types'-import { POOL_LIMITS_SETTINGS_ROUTE } from './wiring-routing'// Overlay views the controller mounts over the shell — lazy, load on demand.// The workspace-route full-page views (skills/messaging/artifacts) are the@@ -196,7 +194,6 @@ export function ContribWiring({ children }: { children: ReactNode }) {// context (the sticky toast). The shell owns `navigate`, so it consumes the// intent counter here; the ref skips the initial mount value.const billingSettingsSeenRef = useRef(0)- const poolLimitsSettingsSeenRef = useRef(0)const cronReviewSeenRef = useRef(0)const activeTranscriptSignatureRef = useRef(new Map<string, string>())const activeTranscriptRequestSequenceRef = useRef(0)@@ -207,7 +204,6 @@ export function ContribWiring({ children }: { children: ReactNode }) {const gatewayState = useStore($gatewayState)const activeSessionId = useStore($activeSessionId)const billingSettingsRequest = useStore($billingSettingsRequest)- const poolLimitsSettingsRequest = useStore($poolLimitsSettingsRequest)const cronReviewRequest = useStore($cronReviewRequest)const currentCwd = useStore($currentCwd)@@ -224,22 +220,6 @@ export function ContribWiring({ children }: { children: ReactNode }) {}}, [billingSettingsRequest, navigate])- // Pool-cap recovery is fired by the notification action, which has no router- // context. Keep navigation user-initiated: the counter changes only when the- // user clicks "Open Advanced Settings" on a pool-slot failure.- // eslint-disable-next-line no-restricted-syntax -- one-shot request-seen sentinel, not an atom mirror- useEffect(() => {- if (poolLimitsSettingsRequest === poolLimitsSettingsSeenRef.current) {- return- }-- poolLimitsSettingsSeenRef.current = poolLimitsSettingsRequest-- if (poolLimitsSettingsRequest > 0) {- navigate(POOL_LIMITS_SETTINGS_ROUTE)- }- }, [navigate, poolLimitsSettingsRequest])-// eslint-disable-next-line no-restricted-syntax -- one-shot request-seen sentinel, not an atom mirroruseEffect(() => {if (cronReviewRequest === cronReviewSeenRef.current) {diff --git a/apps/desktop/src/components/notifications.test.tsx b/apps/desktop/src/components/notifications.test.tsxindex 2608f41a980..2c4e15d5ce7 100644--- a/apps/desktop/src/components/notifications.test.tsx+++ b/apps/desktop/src/components/notifications.test.tsx@@ -1,9 +1,8 @@-import { cleanup, fireEvent, render, screen } from '@testing-library/react'+import { cleanup, render, screen } from '@testing-library/react'import { afterEach, beforeEach, describe, expect, it } from 'vitest'import { I18nProvider } from '@/i18n'-import { $notifications, clearNotifications, notify, notifyError } from '@/store/notifications'-import { $poolLimitsSettingsRequest } from '@/store/pool-limits'+import { clearNotifications, notify } from '@/store/notifications'import { NotificationStack, toastTitleClassName } from './notifications'@@ -13,13 +12,11 @@ const DETAIL = 'target user message is no longer in session history'describe('toast titles', () => {beforeEach(() => {clearNotifications()- $poolLimitsSettingsRequest.set(0)})afterEach(() => {cleanup()clearNotifications()- $poolLimitsSettingsRequest.set(0)})it('drops the one-line clamp so a long error title can wrap', () => {@@ -51,37 +48,5 @@ describe('toast titles', () => {expect(screen.getByText(DETAIL)).toBeTruthy()})- it('makes a local pool-slot timeout actionable without changing ordinary errors', () => {- notifyError(- new Error(- `Error invoking remote method 'hermes:connection': Error: Local backend start for "research" timed out while waiting for a free slot.`- ),- 'Failed to switch to profile "research"'- )-- render(- <I18nProvider configClient={null} initialLocale="en">- <NotificationStack />- </I18nProvider>- )-- expect(screen.getByText(/All local profile backend slots are busy/)).toBeTruthy()- fireEvent.click(screen.getByRole('button', { name: 'Open Advanced Settings' }))-- expect($poolLimitsSettingsRequest.get()).toBe(1)- expect($notifications.get()).toHaveLength(0)-- notifyError(new Error('gateway unavailable'), 'Failed to switch profile')- expect($notifications.get()[0]?.action).toBeUndefined()- })-- it('keeps background pool-slot timeouts quiet if they reach the renderer', () => {- notifyError(- new Error('Local backend start for "background" timed out while waiting for a free slot. (background)'),- 'Background profile warm-up failed'- )-- expect($notifications.get()[0]?.action).toBeUndefined()- })})diff --git a/apps/desktop/src/store/notifications.ts b/apps/desktop/src/store/notifications.tsindex 55ce13f047e..919c5cade20 100644--- a/apps/desktop/src/store/notifications.ts+++ b/apps/desktop/src/store/notifications.ts@@ -1,7 +1,6 @@import { atom } from 'nanostores'import { translateNow } from '@/i18n'-import { isLocalBackendSlotWaitTimeout, requestPoolLimitsSettings } from '@/store/pool-limits'export type NotificationKind = 'error' | 'warning' | 'info' | 'success'@@ -196,19 +195,12 @@ export function notify(input: NotificationInput): string {export function notifyError(error: unknown, fallback: string): string {const readable = readableError(error, fallback)- const poolSlotTimeout = isLocalBackendSlotWaitTimeout(error)return notify({- action: poolSlotTimeout- ? {- label: translateNow('desktop.poolSlotTimeoutOpenSettings'),- onClick: requestPoolLimitsSettings- }- : undefined,kind: 'error',title: fallback,- message: poolSlotTimeout ? translateNow('desktop.poolSlotTimeoutBody') : readable.message,- detail: poolSlotTimeout ? readable.message : readable.detail+ message: readable.message,+ detail: readable.detail})}