diff --git a/mobile/src/session/mobile-structured-queued-message-cards.test.ts b/mobile/src/session/mobile-structured-queued-message-cards.test.ts index 2c6173b54a5a..44d1e0b9729f 100644 --- a/mobile/src/session/mobile-structured-queued-message-cards.test.ts +++ b/mobile/src/session/mobile-structured-queued-message-cards.test.ts @@ -239,6 +239,28 @@ describe('mobileQueuedMessageCards', () => { expect(card?.caption).toBe('Words for a kind a newer host added.') }) + it("shows the host's sentence for a fact this build cannot read all of, as the desktop card", () => { + const reason = "Claude couldn't start. Start a new chat to continue." + // As a newer host sends it: a known code with a reason this build doesn't know. + const newer = { + kind: 'startFailed', + refusal: { code: 'agent_session_conflict', details: { reason: 'newerReason' } } + } + const [card] = mobileQueuedMessageCards( + [ + draft({ + messageId: 'a', + state: 'returned', + returnedReason: reason, + returnedRejection: newer + }) + ], + [], + { pendingPrompt: false } + ) + expect(card?.caption).toBe(reason) + }) + it('maps the send-failed pause marker to English and an unknown marker to a plain pause', () => { const cards = mobileQueuedMessageCards( [ diff --git a/mobile/src/session/mobile-structured-queued-message-cards.ts b/mobile/src/session/mobile-structured-queued-message-cards.ts index 16393dbbf8ba..f3edb13e53c8 100644 --- a/mobile/src/session/mobile-structured-queued-message-cards.ts +++ b/mobile/src/session/mobile-structured-queued-message-cards.ts @@ -2,7 +2,7 @@ // The wire carries no hold copy on purpose: the caption is derived here from the // draft's own state plus the live facts the client already holds. -import { readAgentSessionFailureFact } from '../../../src/shared/agent-session-failure' +import { readWholeAgentSessionFailureFact } from '../../../src/shared/agent-session-failure' import type { AgentJournalSubmission } from '../../../src/shared/agent-session-journal-types' import { agentSessionWriteNoticeEnglish } from '../../../src/shared/agent-session-refusal-notice' import { dispatchWasWithdrawn } from '../../../src/shared/structured-agent-session-dispatch-rejection' @@ -37,13 +37,13 @@ function returnedCaption( if (dispatchWasWithdrawn({ dispatchState: 'rejected', reason, rejection })) { return 'Stopped before it was sent' } - // Worded as the desktop card words it: the fact decides, the reason is the fallback, and the - // card's own Send is the retry, so the words leave out sending again. + // Worded as the desktop card words it: a fact read whole decides, the host's reason is the + // fallback, and the card's own Send is the retry, so the words leave out sending again. return agentSessionWriteNoticeEnglish( structuredAgentSessionAttemptFailureParts( { kind: 'rejected', reason }, { retryControl: true }, - readAgentSessionFailureFact(rejection) + readWholeAgentSessionFailureFact(rejection) ) ) } diff --git a/src/renderer/src/components/native-chat/NativeChatEmptyState.tsx b/src/renderer/src/components/native-chat/NativeChatEmptyState.tsx index ec84f554cd76..d6c7094a2961 100644 --- a/src/renderer/src/components/native-chat/NativeChatEmptyState.tsx +++ b/src/renderer/src/components/native-chat/NativeChatEmptyState.tsx @@ -1,13 +1,17 @@ import { MessageSquare, TriangleAlert } from 'lucide-react' import { translate } from '@/i18n/i18n' import { formatAgentTypeLabel } from '@/lib/agent-status' -import { NATIVE_CHAT_EMPTY_STATE_COPY } from '../../../../shared/native-chat-empty-state' +import { + NATIVE_CHAT_EMPTY_STATE_COPY, + NATIVE_CHAT_KEEPS_TRYING_COPY +} from '../../../../shared/native-chat-empty-state' import type { NativeChatSession } from '../../../../shared/native-chat-types' export function NativeChatEmptyState({ kind, message, headline, + headlineSaysUnread = false, agent, retrying = false }: { @@ -15,12 +19,15 @@ export function NativeChatEmptyState({ message?: string /** The chat's own sentence for the failure, said once: it takes the generic title's place. */ headline?: string + /** The headline already says the history didn't load, so the retrying line says only that + * Orca keeps trying. */ + headlineSaysUnread?: boolean agent?: NativeChatSession['agent'] /** The read retries on its own (structured chat), so the error says so instead of pointing * back to the terminal. */ retrying?: boolean }): React.JSX.Element { - const copy = emptyStateCopy(kind, { message, headline }, agent, retrying) + const copy = emptyStateCopy(kind, { message, headline, headlineSaysUnread }, agent, retrying) return (
- {message} - {cause ? ` ${cause}` : null} + {cause ? joinSentences([message, cause]) : message}