diff --git a/.changeset/compact-session-start-recovery.md b/.changeset/compact-session-start-recovery.md new file mode 100644 index 0000000000..55b04bffd5 --- /dev/null +++ b/.changeset/compact-session-start-recovery.md @@ -0,0 +1,5 @@ +--- +"@roomote/web": patch +--- + +Show Session start failures in a compact inline row with a clear Retry action instead of an oversized error panel and technical transport message. diff --git a/apps/web/src/app/(authenticated)/home/Home.client.test.tsx b/apps/web/src/app/(authenticated)/home/Home.client.test.tsx index 5454389105..f799fc5aed 100644 --- a/apps/web/src/app/(authenticated)/home/Home.client.test.tsx +++ b/apps/web/src/app/(authenticated)/home/Home.client.test.tsx @@ -902,7 +902,9 @@ describe('Home', () => { it('reuses the client conversation identity after an ambiguous start failure', async () => { mockStartFastSession - .mockRejectedValueOnce(new Error('Connection lost')) + .mockRejectedValueOnce( + new Error('Stream closed before head was received'), + ) .mockResolvedValueOnce({ sessionId: '11111111-1111-4111-8111-111111111111', fastConversationId: '22222222-2222-4222-8222-222222222222', @@ -911,8 +913,11 @@ describe('Home', () => { fireEvent.click(screen.getByRole('button', { name: 'Submit prompt' })); expect(await screen.findByRole('alert')).toHaveTextContent( - 'Connection lost', + 'Couldn’t start this session.', ); + expect( + screen.queryByText('Stream closed before head was received'), + ).not.toBeInTheDocument(); expect(screen.queryByRole('dialog')).not.toBeInTheDocument(); // Editing the composer after the failure must not change what Retry sends. fireEvent.change(screen.getByRole('textbox', { name: 'Task prompt' }), { @@ -938,7 +943,7 @@ describe('Home', () => { fireEvent.click(screen.getByRole('button', { name: 'Submit prompt' })); expect(await screen.findByRole('alert')).toHaveTextContent( - 'Connection lost', + 'Couldn’t start this session.', ); submittedPromptText = 'Corrected prompt'; fireEvent.click(screen.getByRole('button', { name: 'Submit prompt' })); diff --git a/apps/web/src/components/tasks/NewTaskForm.tsx b/apps/web/src/components/tasks/NewTaskForm.tsx index e51ccb04ff..ba6aee9627 100644 --- a/apps/web/src/components/tasks/NewTaskForm.tsx +++ b/apps/web/src/components/tasks/NewTaskForm.tsx @@ -23,10 +23,10 @@ import { TaskPromptInput, } from '@/components/tasks'; import { + AlertCircle, BasicTooltip, Button, HatGlasses, - RetryableLoadError, } from '@/components/system'; const DEFAULT_PROMPT_PLACEHOLDER = 'What do you want to do?'; @@ -269,13 +269,23 @@ export function NewTaskForm({ } /> {fastSessionError ? ( -
- void retryFastSession()} +
+
) : null}