diff --git a/mobile/src/i18n/en-runtime-required.json b/mobile/src/i18n/en-runtime-required.json
index fce4c01117f..d4bf64852c2 100644
--- a/mobile/src/i18n/en-runtime-required.json
+++ b/mobile/src/i18n/en-runtime-required.json
@@ -56,6 +56,9 @@
}
},
"chat": {
+ "notice": {
+ "modelFallback": "Claude switched models: {{from}} → {{to}}."
+ },
"subagentGroup": {
"ran_one": "Ran {{count}} subagent",
"ran_other": "Ran {{count}} subagents",
diff --git a/mobile/src/i18n/locales/en.json b/mobile/src/i18n/locales/en.json
index 9bc958a6d93..38281951493 100644
--- a/mobile/src/i18n/locales/en.json
+++ b/mobile/src/i18n/locales/en.json
@@ -2901,7 +2901,8 @@
"plan": "Plan",
"permissionDenied": "{{agent}} denied permission. View details.",
"safetyReview": "{{agent}} reported a safety review warning. View details.",
- "truncatedResponse": "Provider response truncated (original size: {{bytes}} bytes)."
+ "truncatedResponse": "Provider response truncated (original size: {{bytes}} bytes).",
+ "modelFallback": "Claude switched models: {{from}} → {{to}}."
},
"nativeChatProse": {
"attachedImage": "Attached image",
diff --git a/mobile/src/i18n/locales/ru.json b/mobile/src/i18n/locales/ru.json
index e370e866802..ff63d73a687 100644
--- a/mobile/src/i18n/locales/ru.json
+++ b/mobile/src/i18n/locales/ru.json
@@ -291,7 +291,8 @@
"stoppedManually": "Остановлено вручную",
"permissionDenied": "{{agent}} отказал в разрешении. Подробнее.",
"safetyReview": "{{agent}} сообщил о предупреждении проверки безопасности. Подробнее.",
- "truncatedResponse": "Ответ поставщика обрезан (исходный размер: {{bytes}} байт)."
+ "truncatedResponse": "Ответ поставщика обрезан (исходный размер: {{bytes}} байт).",
+ "modelFallback": "Claude переключил модель: {{from}} → {{to}}."
},
"orcaStop": {
"canContinue": "Вы можете продолжить этот разговор.",
diff --git a/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionPickers.test.ts b/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionPickers.test.ts
index aad9565ee6a..d233f03f04d 100644
--- a/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionPickers.test.ts
+++ b/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionPickers.test.ts
@@ -339,6 +339,24 @@ describe('MobileNativeChatSessionOptionPickers', () => {
})
})
+ it('shows the current fallback model without making a model write', () => {
+ const descriptor: SessionOptionDescriptor = {
+ ...MODEL_DESCRIPTOR,
+ transport: 'agent-session',
+ valueSource: 'applied',
+ reportedModel: 'claude-opus-4-8',
+ kind: {
+ type: 'select',
+ currentValue: 'claude-opus-5-5',
+ choices: [{ value: 'claude-opus-5-5', label: 'Opus 5.5' }]
+ }
+ }
+ mount([descriptor], true)
+ expect(pill('Model').props.accessibilityLabel).toBe('Model, Opus 4.8')
+ expect(descriptor.kind.currentValue).toBe('claude-opus-5-5')
+ expect(setOption).not.toHaveBeenCalled()
+ })
+
it('opens the model sheet and applies a picked model', async () => {
mount([MODEL_DESCRIPTOR, EFFORT_DESCRIPTOR])
await act(async () => pill('Model').props.onPress())
diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatMessage.status-notices.test.ts b/mobile/src/session/native-chat/transcript/MobileNativeChatMessage.status-notices.test.ts
index 2aff78856ac..df4353e014c 100644
--- a/mobile/src/session/native-chat/transcript/MobileNativeChatMessage.status-notices.test.ts
+++ b/mobile/src/session/native-chat/transcript/MobileNativeChatMessage.status-notices.test.ts
@@ -125,6 +125,35 @@ describe('MobileNativeChatMessage status notices', () => {
)[0]!
}
+ it.each([
+ ['en', 'Claude switched models: Claude Opus 5.5 → Claude Opus 4.8.'],
+ ['ru', 'Claude переключил модель: Claude Opus 5.5 → Claude Opus 4.8.']
+ ] as const)(
+ 'renders a saved fallback notice in %s without a raw JSON card',
+ async (locale, words) => {
+ await activateMobileUiLocale(locale)
+ const head = JSON.stringify({
+ type: 'fallback',
+ from: { model: 'claude-opus-5-5' },
+ to: { model: 'claude-opus-4-8' }
+ })
+ const text = renderNotice(
+ {
+ kind: 'status',
+ text: 'Claude sent content Orca cannot display yet',
+ providerFrame: {
+ provider: 'claude',
+ kind: 'message:assistant:content:fallback',
+ payload: { head, byteLength: head.length, digest: 'fixture', truncated: false }
+ }
+ },
+ { hostName: null }
+ )
+ expect(text.props.children).toBe(words)
+ expect(renderer!.root.findAll((node) => String(node.type) === 'Pressable')).toHaveLength(0)
+ }
+ )
+
it('names the Orca host an Orca stop came from, in desktop words', () => {
const text = renderNotice(
{
diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatNoticeRow.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatNoticeRow.tsx
index 526517c2348..a02d0739059 100644
--- a/mobile/src/session/native-chat/transcript/MobileNativeChatNoticeRow.tsx
+++ b/mobile/src/session/native-chat/transcript/MobileNativeChatNoticeRow.tsx
@@ -1,3 +1,7 @@
+import {
+ CLAUDE_MODEL_FALLBACK_COPY,
+ claudeModelFallbackLabels
+} from '../../../../../src/shared/native-chat/claude-model-fallback'
import { useContext, useId, useState } from 'react'
import { Pressable, StyleSheet, Text, View } from 'react-native'
import { AlertCircle, AlertTriangle, ChevronRight, Info } from 'lucide-react-native'
@@ -232,6 +236,16 @@ export function MobileNativeChatNoticeRow({
{nativeChatHostStatusCopy(t)[look.presentation]}
)
+ case 'model-fallback':
+ return (
+
+ {t(
+ 'chat.notice.modelFallback',
+ CLAUDE_MODEL_FALLBACK_COPY,
+ claudeModelFallbackLabels(look)
+ )}
+
+ )
case 'plan':
return (
diff --git a/mobile/src/session/use-mobile-structured-option-state.ts b/mobile/src/session/use-mobile-structured-option-state.ts
index 82966550c26..af7c5147561 100644
--- a/mobile/src/session/use-mobile-structured-option-state.ts
+++ b/mobile/src/session/use-mobile-structured-option-state.ts
@@ -10,10 +10,8 @@ import { BoundedMap } from '../../../src/shared/bounded-map'
import type { RpcClient } from '../transport/rpc-client'
import type { AgentSessionOptionCatalog } from '../../../src/shared/agent-session/options/agent-session-option-catalog-types'
import { usesInstalledAgentModelCatalog } from '../../../src/shared/agent-session/options/agent-model-catalog-ownership'
-import {
- createStructuredAgentSessionOptionState,
- structuredAgentSessionReportsAtFence
-} from '../../../src/shared/agent-session/options/structured-agent-session-options'
+import { createStructuredAgentSessionOptionState } from '../../../src/shared/agent-session/options/structured-agent-session-options'
+import { structuredAgentSessionReportsAtFence } from '../../../src/shared/agent-session/options/structured-agent-session-runtime-reports'
// Matches the transcripts this view retains per chat.
const MAX_RETAINED_CHAT_READERS = 32
diff --git a/src/main/claude/claude-context-usage.ts b/src/main/claude/claude-context-usage.ts
index 8bbccb563f2..8ce61a16c17 100644
--- a/src/main/claude/claude-context-usage.ts
+++ b/src/main/claude/claude-context-usage.ts
@@ -65,7 +65,10 @@ export function claudeContextWindowHint(model: string): number | null {
export type ClaudeMainThreadModel = { initModel: string | null; responseModel: string | null }
-function currentInitModel({ initModel, responseModel }: ClaudeMainThreadModel): string | null {
+export function claudeMatchingInitModel({
+ initModel,
+ responseModel
+}: ClaudeMainThreadModel): string | null {
if (initModel === null || responseModel === null) {
return initModel
}
@@ -93,7 +96,7 @@ export function claudeContextWindowFromResult(
const bases = [key, ...(canonicalModel ? [canonicalModel] : [])].map(contextBaseModelId)
return [{ key, window, bases }]
})
- const initModel = currentInitModel(main)
+ const initModel = claudeMatchingInitModel(main)
const names = [main.responseModel ?? initModel].flatMap((model) =>
model ? [contextBaseModelId(model)] : []
)
diff --git a/src/main/claude/structured/claude-structured-execution-observations.ts b/src/main/claude/structured/claude-structured-execution-observations.ts
index d137058be93..d3f18807494 100644
--- a/src/main/claude/structured/claude-structured-execution-observations.ts
+++ b/src/main/claude/structured/claude-structured-execution-observations.ts
@@ -1,3 +1,7 @@
+import { claudeRecord, claudeText } from './journal/claude-structured-item-translation'
+import { claudeMatchingInitModel } from '../claude-context-usage'
+import { isRootClaudeFrame } from '../claude-turn-opening'
+import { MAX_CONTEXT_MODEL_ID_CHARS } from '../../../shared/agent-session/agent-session-context-usage'
import type { ClaudeSession } from './claude-structured-session-state'
/** Fast routing reports precede this input and cannot vouch for its execution. */
@@ -19,6 +23,7 @@ export function beginClaudeOptionMutation(session: ClaudeSession, key: string):
const sequence = session.optionMutationSequence
if (key === 'model') {
delete session.appliedOptions
+ delete session.reportedOptions.reportedModel
} else {
if (session.reportedModelMutation === previous) {
session.reportedModelMutation = sequence
@@ -31,13 +36,74 @@ export function beginClaudeOptionMutation(session: ClaudeSession, key: string):
return sequence
}
-/** An init names the model that runs; a control answer only acknowledges its input. */
+/** An init names execution; a control answer only acknowledges its input. */
export function observeClaudeExecutionModel(session: ClaudeSession, model: string): boolean {
const previous = claudeExecutionObservations(session).model
+ const previousResponse = session.reportedOptions.reportedModel
+ session.reportedOptions.reportedModel = model
if (previous !== model) {
delete session.appliedOptions
}
session.reportedOptions.model = model
session.reportedModelMutation = session.optionMutationSequence
- return previous !== model
+ return previous !== model || previousResponse !== model
+}
+
+/** Main-thread response metadata names the model that answered, including provider fallback. */
+function readClaudeResponseModel(frame: Record): string | null {
+ if (!isRootClaudeFrame(frame)) {
+ return null
+ }
+ const event = claudeRecord(frame.event)
+ const message =
+ frame.type === 'assistant'
+ ? claudeRecord(frame.message)
+ : frame.type === 'stream_event' && event?.type === 'message_start'
+ ? claudeRecord(event.message)
+ : null
+ const model = message?.role === 'assistant' ? claudeText(message.model)?.trim() : null
+ return model && model !== '' && model.length <= MAX_CONTEXT_MODEL_ID_CHARS
+ ? model
+ : null
+}
+
+function observeClaudeResponseModel(
+ session: ClaudeSession,
+ frame: Record
+): boolean {
+ const response = readClaudeResponseModel(frame)
+ if (!response) {
+ return false
+ }
+ const model =
+ claudeMatchingInitModel({
+ initModel:
+ session.reportedModelMutation === session.optionMutationSequence
+ ? (session.reportedOptions.model ?? null)
+ : null,
+ responseModel: response
+ }) ?? response
+ if (model === session.reportedOptions.reportedModel) {
+ return false
+ }
+ session.reportedOptions.reportedModel = model
+ return true
+}
+
+export function observeClaudeFrameModels(
+ session: ClaudeSession | null,
+ frame: Record,
+ initModel: string | null | undefined
+): Partial | null {
+ if (!session) {
+ return null
+ }
+ const initChanged = initModel ? observeClaudeExecutionModel(session, initModel) : false
+ const responseChanged = observeClaudeResponseModel(session, frame)
+ return initChanged || responseChanged
+ ? {
+ ...(initChanged && initModel ? { model: initModel } : {}),
+ reportedModel: session.reportedOptions.reportedModel
+ }
+ : null
}
diff --git a/src/main/claude/structured/claude-structured-response-model.test.ts b/src/main/claude/structured/claude-structured-response-model.test.ts
new file mode 100644
index 00000000000..8d14e17c4bb
--- /dev/null
+++ b/src/main/claude/structured/claude-structured-response-model.test.ts
@@ -0,0 +1,98 @@
+import { expect, it } from 'vitest'
+import { acquired, claudeFrame, fakeClaude } from './claude-structured-session-test-support'
+import type { ClaudeStructuredSessionEvent } from './claude-structured-session-state'
+
+it('publishes the main response model after fallback and restoration, ignoring child, foreign and synthetic frames', async () => {
+ const claude = fakeClaude({ initModel: 'claude-opus-5-5' })
+ const events: ClaudeStructuredSessionEvent[] = []
+ const adapter = await acquired(claude, {}, events)
+ const connection = claude.connections[0]!
+ const read = () => adapter.readOptions({ sessionId: 'session-1', fence: 7 })
+ try {
+ claudeFrame(connection, { type: 'system', subtype: 'init', model: 'claude-opus-5-5' })
+ expect((await read()).current.model).toBe('claude-opus-5-5')
+ for (const patch of [
+ { parent_tool_use_id: 'child-tool' },
+ { session_id: 'another-session' },
+ { message: { role: 'assistant', model: '', content: [] } }
+ ]) {
+ claudeFrame(connection, {
+ type: 'assistant',
+ uuid: 'ignore',
+ message: { role: 'assistant', model: 'claude-opus-4-8', content: [] },
+ ...patch
+ })
+ expect((await read()).current.model).toBe('claude-opus-5-5')
+ expect((await read()).current.reportedModel).toBe('claude-opus-5-5')
+ }
+ claudeFrame(connection, {
+ type: 'assistant',
+ uuid: 'fallback',
+ message: {
+ role: 'assistant',
+ model: 'claude-opus-4-8',
+ content: [
+ { type: 'fallback', from: { model: 'claude-opus-5-5' }, to: { model: 'claude-opus-4-8' } }
+ ]
+ }
+ })
+ expect((await read()).current).toMatchObject({
+ model: 'claude-opus-5-5',
+ reportedModel: 'claude-opus-4-8',
+ confirmed: expect.arrayContaining(['model'])
+ })
+ expect(events).toContainEqual(
+ expect.objectContaining({
+ type: 'options-reported',
+ reportedOptions: expect.objectContaining({ reportedModel: 'claude-opus-4-8' })
+ })
+ )
+ claudeFrame(connection, { type: 'system', subtype: 'status', permissionMode: 'plan' })
+ expect(events.findLast((event) => event.type === 'options-reported')).toMatchObject({
+ reportedOptions: { reportedModel: 'claude-opus-4-8', reportedPermissionMode: 'plan' }
+ })
+ claudeFrame(connection, {
+ type: 'stream_event',
+ uuid: 'restored',
+ event: { type: 'message_start', message: { role: 'assistant', model: 'claude-opus-5-5' } }
+ })
+ expect((await read()).current.reportedModel).toBe('claude-opus-5-5')
+ claudeFrame(connection, { type: 'system', subtype: 'init', model: 'claude-opus-4-8' })
+ expect((await read()).current).toMatchObject({
+ model: 'claude-opus-4-8',
+ reportedModel: 'claude-opus-4-8'
+ })
+ await adapter.setOption({ sessionId: 'session-1', fence: 7, key: 'model', value: 'sonnet' })
+ expect((await read()).current.reportedModel).toBeUndefined()
+ } finally {
+ await adapter.closeAll()
+ }
+})
+
+it('retains the init context suffix when the response reports the same bare model', async () => {
+ const claude = fakeClaude({ initModel: 'claude-opus-5-5[1m]' })
+ const adapter = await acquired(claude)
+ const connection = claude.connections[0]!
+ try {
+ claudeFrame(connection, { type: 'system', subtype: 'init', model: 'claude-opus-5-5[1m]' })
+ claudeFrame(connection, {
+ type: 'assistant',
+ uuid: 'first-response',
+ message: { role: 'assistant', model: 'claude-opus-5-5', content: [] }
+ })
+ expect(
+ (await adapter.readOptions({ sessionId: 'session-1', fence: 7 })).current.reportedModel
+ ).toBe('claude-opus-5-5[1m]')
+ await adapter.setOption({ sessionId: 'session-1', fence: 7, key: 'model', value: 'opus' })
+ claudeFrame(connection, {
+ type: 'assistant',
+ uuid: 'after-context-pick',
+ message: { role: 'assistant', model: 'claude-opus-5-5', content: [] }
+ })
+ expect(
+ (await adapter.readOptions({ sessionId: 'session-1', fence: 7 })).current.reportedModel
+ ).toBe('claude-opus-5-5')
+ } finally {
+ await adapter.closeAll()
+ }
+})
diff --git a/src/main/claude/structured/claude-structured-session-acquisition.ts b/src/main/claude/structured/claude-structured-session-acquisition.ts
index ec77bf36e4c..0064e20e909 100644
--- a/src/main/claude/structured/claude-structured-session-acquisition.ts
+++ b/src/main/claude/structured/claude-structured-session-acquisition.ts
@@ -16,7 +16,7 @@ import { claudeConfigDirEnvPatch } from '../claude-config-dir-pin'
import { claudeProcessIdentity } from './claude-structured-owner-identity'
import { ClaudePromptRegistry } from '../claude-prompt-registry'
import { adoptClaudeStructuredSpawnOptions } from './launch/claude-structured-spawn-options'
-import { observeClaudeExecutionModel } from './claude-structured-execution-observations'
+import { observeClaudeFrameModels } from './claude-structured-execution-observations'
import { observeClaudeFastModeFacts } from './launch/claude-structured-session-options'
import {
createClaudeSessionPublication,
@@ -98,8 +98,7 @@ export async function acquireClaudeSession({
}
}
const permissionChanged = observeClaudeReportedPermissionMode(observedOptions, message)
- const modelChanged =
- liveSession && init?.model ? observeClaudeExecutionModel(liveSession, init.model) : false
+ const modelReport = observeClaudeFrameModels(liveSession, message, init?.model)
if (init) {
initProof.resolve(init)
if (liveSession) {
@@ -140,14 +139,15 @@ export async function acquireClaudeSession({
}
try {
callbacks.deliver(attempt, sessionId, () => {
- if (liveSession && (modelChanged || permissionChanged)) {
+ if (liveSession && (modelReport || permissionChanged)) {
callbacks.emit(liveSession, input.events, {
type: 'options-reported',
sessionId,
fence: liveSession.fence,
acquisitionGeneration: liveSession.acquisitionGeneration,
reportedOptions: {
- ...(modelChanged && init?.model ? { model: init.model } : {}),
+ ...modelReport,
+ reportedModel: liveSession.reportedOptions.reportedModel,
reportedPermissionMode: observedOptions.reportedPermissionMode
}
})
diff --git a/src/main/claude/structured/claude-structured-session-adapter-turns.test.ts b/src/main/claude/structured/claude-structured-session-adapter-turns.test.ts
index 9069b77c88d..4b76bc9e975 100644
--- a/src/main/claude/structured/claude-structured-session-adapter-turns.test.ts
+++ b/src/main/claude/structured/claude-structured-session-adapter-turns.test.ts
@@ -258,6 +258,7 @@ describe('ClaudeStructuredSessionAdapter turns and controls', () => {
expect(catalogListing).toBeUndefined()
expect(options.current).toEqual({
model: 'claude-sonnet-5',
+ reportedModel: 'claude-sonnet-5',
effort: 'high',
reportedPermissionMode: undefined,
confirmed: ['model', 'effort']
@@ -293,6 +294,7 @@ describe('ClaudeStructuredSessionAdapter turns and controls', () => {
])
expect(result.current).toEqual({
model: 'custom-model',
+ reportedModel: 'custom-model',
effort: 'high',
reportedPermissionMode: undefined,
confirmed: ['model', 'effort']
diff --git a/src/main/claude/structured/claude-structured-session-state.ts b/src/main/claude/structured/claude-structured-session-state.ts
index 9479e5115da..1f1631a14d3 100644
--- a/src/main/claude/structured/claude-structured-session-state.ts
+++ b/src/main/claude/structured/claude-structured-session-state.ts
@@ -167,6 +167,7 @@ export type ClaudeSession = {
replayContentFallbackBlocked: boolean
options: Map
reportedOptions: {
+ reportedModel?: string
model?: string
effort?: string
fastMode?: boolean
diff --git a/src/main/claude/structured/launch/claude-structured-provider-fallback.test.ts b/src/main/claude/structured/launch/claude-structured-provider-fallback.test.ts
index 14ef3dfd27e..7ca3142011e 100644
--- a/src/main/claude/structured/launch/claude-structured-provider-fallback.test.ts
+++ b/src/main/claude/structured/launch/claude-structured-provider-fallback.test.ts
@@ -77,6 +77,55 @@ describe('Claude provider fallback', () => {
expect(items).toEqual([])
})
+ it('journals the captured model fallback as a notice and continues the same turn', () => {
+ const items: AgentJournalItemBody[] = []
+ const translator = createClaudeJournalTranslator({
+ sink: {
+ appendItem: (_identity, body) => {
+ items.push(body)
+ },
+ appendTombstone: vi.fn(),
+ publish: vi.fn()
+ }
+ })
+ translator.handle(
+ message('assistant', 'fallback-1', [
+ { type: 'fallback', from: { model: 'claude-opus-5-5' }, to: { model: 'claude-opus-4-8' } }
+ ])
+ )
+ translator.handle(
+ message('assistant', 'answer-1', [{ type: 'text', text: 'Continuing the answer.' }])
+ )
+ translator.handle({
+ type: 'message',
+ sessionId: 'orca-session',
+ message: {
+ type: 'result',
+ subtype: 'success',
+ session_id: 'provider-1',
+ uuid: 'result-1',
+ result: 'Continuing the answer.'
+ }
+ })
+
+ const notices = items.filter((body) => body.kind === 'status')
+ expect(notices).toHaveLength(1)
+ expect(notices[0]).toMatchObject({
+ text: 'Claude switched models: Claude Opus 5.5 → Claude Opus 4.8.',
+ tone: 'notice',
+ presentation: 'turn-notice',
+ providerFrame: { provider: 'claude', kind: 'message:assistant:content:fallback' }
+ })
+ expect(items).toContainEqual(
+ expect.objectContaining({
+ kind: 'message',
+ role: 'assistant',
+ blocks: [{ type: 'text', text: 'Continuing the answer.' }]
+ })
+ )
+ expect(items).toContainEqual(expect.objectContaining({ kind: 'turn', state: 'completed' }))
+ })
+
it('keeps provider-fallback rows distinct across acquisitions', async () => {
const journal = await openAgentSessionJournal({
identity: IDENTITY,
diff --git a/src/main/claude/structured/launch/claude-structured-provider-fallback.ts b/src/main/claude/structured/launch/claude-structured-provider-fallback.ts
index 7e3c9aac4f2..17703792cd7 100644
--- a/src/main/claude/structured/launch/claude-structured-provider-fallback.ts
+++ b/src/main/claude/structured/launch/claude-structured-provider-fallback.ts
@@ -1,4 +1,12 @@
-import type { AgentJournalStatusItem } from '../../../../shared/agent-session/journal/agent-session-journal-types'
+import {
+ readClaudeModelFallback,
+ claudeModelFallbackText
+} from '../../../../shared/native-chat/claude-model-fallback'
+import { AGENT_SESSION_TURN_NOTICE_PRESENTATION } from '../../../../shared/agent-session/journal/agent-session-turn-notice'
+import type {
+ AgentJournalPlainStatusItem,
+ AgentJournalStatusItem
+} from '../../../../shared/agent-session/journal/agent-session-journal-types'
import type { AgentJournalTurnScope } from '../../../../shared/agent-session/journal/agent-session-journal-turn-scope'
import type { AgentSessionFailureRowWords } from '../../../../shared/agent-session/failures/agent-session-failure-words'
import type { StructuredAgentSessionEventSink } from '../../../native-chat/agent-session-wire/structured-agent-session-event-sink'
@@ -115,7 +123,11 @@ export function createClaudeProviderFrameFallback(
append: (
kind: string,
payload: unknown,
- display?: string | null | (AgentSessionFailureRowWords & { tone: string }),
+ display?:
+ | string
+ | null
+ | Omit
+ | (AgentSessionFailureRowWords & { tone: string }),
/** Open a turn only if a row will be written. */
beforeAppend?: () => void,
options?: UnhandledProviderFrameJournalItemOptions,
@@ -196,11 +208,18 @@ export function appendUnmodeledContent(
let changed = false
for (const part of envelope.content.filter((part) => !isModeledClaudeContent(part))) {
const partType = claudeText(claudeRecord(part)?.type) ?? 'unknown'
+ const modelFallback = envelope.role === 'assistant' ? readClaudeModelFallback(part) : null
changed =
fallback.append(
`message:${envelope.role}:content:${partType}`,
part,
- readableProviderFrameText(part) ?? CLAUDE_UNRENDERABLE_CONTENT_TEXT,
+ modelFallback
+ ? {
+ text: claudeModelFallbackText(modelFallback),
+ tone: 'notice',
+ presentation: AGENT_SESSION_TURN_NOTICE_PRESENTATION
+ }
+ : (readableProviderFrameText(part) ?? CLAUDE_UNRENDERABLE_CONTENT_TEXT),
beforeAppend,
undefined,
stamp
diff --git a/src/main/claude/structured/launch/claude-structured-session-options.ts b/src/main/claude/structured/launch/claude-structured-session-options.ts
index 071323911e8..eac6da8dbc1 100644
--- a/src/main/claude/structured/launch/claude-structured-session-options.ts
+++ b/src/main/claude/structured/launch/claude-structured-session-options.ts
@@ -198,6 +198,7 @@ export function claudeStructuredSessionOptionsFrom(
...(changesLive ? {} : { effortFixed: true as const }),
current: {
model,
+ reportedModel: session.reportedOptions.reportedModel,
reportedPermissionMode: session.reportedOptions.reportedPermissionMode,
...(effort ? { effort } : {}),
...(fastMode !== undefined ? { fastMode } : {}),
diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-catalog-mutation.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-catalog-mutation.test.ts
index 06eac1f75d4..f2b19730e11 100644
--- a/src/main/native-chat/agent-session-wire/structured-agent-session-catalog-mutation.test.ts
+++ b/src/main/native-chat/agent-session-wire/structured-agent-session-catalog-mutation.test.ts
@@ -2,6 +2,7 @@ import { mkdtemp, rm } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
+import { claudeProviderHandle } from '../../../shared/agent-session/lifecycle/agent-session-provider-handle-encoding'
import { structuredAgentSessionHandingOver } from './structured-agent-session-handing-over'
import { agentSessionOperationKey } from '../../../shared/agent-session/lifecycle/agent-session-operation-ledger'
import { agentModelCatalogStore } from '../agent-model-catalog/agent-model-catalog-store'
@@ -136,67 +137,97 @@ describe('installed catalog through Codex delivery and report settlement', () =>
}, 10_000)
// Real host setup, delayed report settlement and bounded resource drains share this budget.
- it('fulfills owed model evidence from a matching delayed lifecycle report outside the delivery lock', async () => {
- const f = await createCatalogMutationFixture(stateDirectory, 'codex')
- try {
- f.rig.host.deps.adapter.open = async () => ({
- reportedOptions: { model: '', effort: 'high' }
- })
- f.rig.adapter.dispatch.mockResolvedValue({
- state: 'admitted',
- ranOptions: { effort: 'high' }
- })
- expect(
- await settled(
- f.rig.host.send(
- CALLER,
- restTestSend(
- 'model arrives after admission',
- f.rig.store.requireWritableRecord(SESSION).lease.runtimeFence
- )
- ),
- 'model-less send acceptance'
- )
- ).toMatchObject({ ok: true })
- const { conversationDelivery, sessions } = f.rig.host.collaboratorsForTests()
- await settled(conversationDelivery.loop.wake(SESSION), 'model-less admitted delivery')
- const child = sessions.get(SESSION)?.child
- if (!child?.generation) {
- throw new Error('production startup did not publish a child generation')
+ it.each(['claude', 'codex'] as const)(
+ 'fulfills only input model evidence from a delayed %s report outside the delivery lock',
+ async (agent) => {
+ const f = await createCatalogMutationFixture(stateDirectory, agent)
+ const model = agent === 'claude' ? CLAUDE_MODEL : CODEX_MODEL
+ if (agent === 'claude') {
+ const acquire = f.rig.adapter.acquire.getMockImplementation()!
+ f.rig.adapter.acquire.mockImplementation(async (...args) => {
+ const result = await acquire(...args)
+ if (!result.link) {
+ throw new Error('test acquisition did not provide a provider link')
+ }
+ return {
+ ...result,
+ link: { ...result.link, handle: claudeProviderHandle('claude-provider', null) }
+ }
+ })
}
- expect(child.phase).toBe('ready')
- expect(child.accountHome).toBeUndefined()
- expect(f.rig.store.requireWritableRecord(SESSION).options).toBeUndefined()
- const lifecycle = createStructuredAgentSessionLifecycleDelivery({
- handle: f.rig.host.handleAdapterEvent,
- logger: f.rig.host.deps.logger,
- drainObservedExits: async () => {}
- })
- lifecycle.deliver({
- type: 'options-reported',
- sessionId: SESSION,
- fence: child.fence,
- acquisitionGeneration: child.generation,
- reportedOptions: { model: CODEX_MODEL, effort: 'low' }
- })
- await settled(lifecycle.drain(), 'delayed lifecycle report')
- expect((await f.persisted()).records[SESSION]?.options).toEqual({
- model: CODEX_MODEL,
- effort: 'high'
- })
- await settled(conversationDelivery.loop.wake(SESSION), 'post-report delivery park')
- expect(conversationDelivery.loop.isRunning(SESSION)).toBe(false)
- expect(f.rig.adapter.dispatch).toHaveBeenCalledOnce()
- expect(
- await settled(
- f.rig.host.history({ sessionId: SESSION, direction: 'tail' }),
- 'post-report ordinary history'
- )
- ).toMatchObject({ ok: true })
- expect(f.rig.store.requireWritableRecord(SESSION).accountHome).toEqual(f.home)
- expect(f.probe).not.toHaveBeenCalled()
- } finally {
- await f.dispose()
- }
- }, 10_000)
+ try {
+ f.rig.host.deps.adapter.open = async () => ({
+ reportedOptions: { model: '', effort: 'high' }
+ })
+ f.rig.adapter.dispatch.mockResolvedValue({
+ state: 'admitted',
+ ranOptions: { effort: 'high' }
+ })
+ expect(
+ await settled(
+ f.rig.host.send(
+ CALLER,
+ restTestSend(
+ 'model arrives after admission',
+ f.rig.store.requireWritableRecord(SESSION).lease.runtimeFence
+ )
+ ),
+ 'model-less send acceptance'
+ )
+ ).toMatchObject({ ok: true })
+ const { conversationDelivery, sessions } = f.rig.host.collaboratorsForTests()
+ await settled(conversationDelivery.loop.wake(SESSION), 'model-less admitted delivery')
+ const child = sessions.get(SESSION)?.child
+ if (!child?.generation) {
+ throw new Error('production startup did not publish a child generation')
+ }
+ expect(child.phase).toBe('ready')
+ expect(child.accountHome).toBeUndefined()
+ expect(f.rig.store.requireWritableRecord(SESSION).options).toBeUndefined()
+ const lifecycle = createStructuredAgentSessionLifecycleDelivery({
+ handle: f.rig.host.handleAdapterEvent,
+ logger: f.rig.host.deps.logger,
+ drainObservedExits: async () => {}
+ })
+ if (agent === 'claude') {
+ lifecycle.deliver({
+ type: 'options-reported',
+ sessionId: SESSION,
+ fence: child.fence,
+ acquisitionGeneration: child.generation,
+ reportedOptions: { reportedModel: 'claude-opus-4-8' }
+ })
+ await settled(lifecycle.drain(), 'response model observation')
+ expect(f.rig.host.readStatusSummary(SESSION)?.reportedModel).toBe('claude-opus-4-8')
+ expect((await f.persisted()).records[SESSION]?.options).toBeUndefined()
+ }
+ lifecycle.deliver({
+ type: 'options-reported',
+ sessionId: SESSION,
+ fence: child.fence,
+ acquisitionGeneration: child.generation,
+ reportedOptions: { model, effort: 'low' }
+ })
+ await settled(lifecycle.drain(), 'delayed lifecycle report')
+ expect((await f.persisted()).records[SESSION]?.options).toEqual({
+ model,
+ effort: 'high'
+ })
+ await settled(conversationDelivery.loop.wake(SESSION), 'post-report delivery park')
+ expect(conversationDelivery.loop.isRunning(SESSION)).toBe(false)
+ expect(f.rig.adapter.dispatch).toHaveBeenCalledOnce()
+ expect(
+ await settled(
+ f.rig.host.history({ sessionId: SESSION, direction: 'tail' }),
+ 'post-report ordinary history'
+ )
+ ).toMatchObject({ ok: true })
+ expect(f.rig.store.requireWritableRecord(SESSION).accountHome).toEqual(f.home)
+ expect(f.probe).not.toHaveBeenCalled()
+ } finally {
+ await f.dispose()
+ }
+ },
+ 10_000
+ )
})
diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-options-read.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-options-read.test.ts
index 17ed38e1372..beea3cb3af4 100644
--- a/src/main/native-chat/agent-session-wire/structured-agent-session-options-read.test.ts
+++ b/src/main/native-chat/agent-session-wire/structured-agent-session-options-read.test.ts
@@ -5,7 +5,10 @@ import {
hostTestRestingOptionsJournal as restingJournal,
hostTestOptionsReadStore
} from './structured-agent-session-host-test-data'
-import { CODEX_SESSION_OPTION_CATALOG } from '../../../shared/agent-session/options/agent-session-option-catalog-claude-codex'
+import {
+ CODEX_SESSION_OPTION_CATALOG,
+ CLAUDE_SESSION_OPTION_CATALOG
+} from '../../../shared/agent-session/options/agent-session-option-catalog-claude-codex'
import {
structuredAgentSessionMessageSelection,
structuredAgentSessionSendSelection
@@ -94,7 +97,10 @@ describe('a chat at rest, read by the host', () => {
const resting = {
child: liveOptions ? { fence: 1 } : null,
params: { provider: record.provider },
- journal: restingJournal(items, wroteBeforeOpen)
+ journal: {
+ ...restingJournal(items, wroteBeforeOpen),
+ snapshot: () => ({ items: [], submissions: [] })
+ }
}
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: this read touches only the declared context fields.
const context = {
@@ -111,6 +117,26 @@ describe('a chat at rest, read by the host', () => {
return readStructuredAgentSessionOptions(context, SESSION, { readsWithoutModel: true })
}
+ it('separates Claude fallback reports from the saved model and accepted send selection', async () => {
+ const saved = { model: 'claude-opus-5-5', effort: 'high' }
+ const answer = await readAtRest({ provider: 'claude', options: saved }, [], false, null, true, {
+ models: [],
+ current: { model: 'claude-opus-5-5', reportedModel: 'claude-opus-4-8', confirmed: ['model'] }
+ })
+ expect(answer.current).toMatchObject({
+ model: saved.model,
+ reportedModel: 'claude-opus-4-8',
+ effort: saved.effort,
+ acceptedInputSources: { model: 'saved', effort: 'saved' }
+ })
+ const state = applyStructuredAgentSessionOptions(
+ createStructuredAgentSessionOptionState('claude'),
+ CLAUDE_SESSION_OPTION_CATALOG,
+ answer
+ )
+ expect(structuredAgentSessionMessageSelection(state)).toEqual({ ...saved, fastMode: 'false' })
+ })
+
it.each<[string, RestingFacts, AgentJournalItemBody[], boolean, string[]]>([
['started here names its default as its own', {}, [], false, []],
[
diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-options-read.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-options-read.ts
index 769889745ba..bd075e3a632 100644
--- a/src/main/native-chat/agent-session-wire/structured-agent-session-options-read.ts
+++ b/src/main/native-chat/agent-session-wire/structured-agent-session-options-read.ts
@@ -151,6 +151,12 @@ export async function readStructuredAgentSessionOptions(
const model = saved.model ?? (options.current.model || selected.current.model || displayDefault)
const projected = live?.projectCurrent?.({ ...saved, ...(model ? { model } : {}) })
const reportedEffort = projected?.confirmed?.includes('effort') ? projected.effort : undefined
+ const reportedModel = live
+ ? (options.current.reportedModel ??
+ (agent === 'claude' && options.current.confirmed?.includes('model')
+ ? options.current.model
+ : undefined))
+ : undefined
const current = {
...selected.current,
...options.current,
@@ -239,6 +245,7 @@ export async function readStructuredAgentSessionOptions(
current: {
...current,
acceptedInputSources,
+ ...(reportedModel ? { reportedModel } : {}),
...(reportedEffort !== undefined ? { reportedEffort } : {}),
defaulted,
confirmed,
diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-provider-started.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-provider-started.ts
index 272f8b894fa..b9d34465b34 100644
--- a/src/main/native-chat/agent-session-wire/structured-agent-session-provider-started.ts
+++ b/src/main/native-chat/agent-session-wire/structured-agent-session-provider-started.ts
@@ -13,7 +13,7 @@ import {
} from './structured-agent-session-start-listing'
import type { StructuredAgentSessionStartupAttempts } from './structured-agent-session-startup-attempt'
import {
- noteStructuredAgentSessionRuntimePermission,
+ noteStructuredAgentSessionRuntimeOptions,
noteStructuredAgentSessionReportedOptions
} from './structured-agent-session-ran-options'
import type { StructuredAgentSessionAcquireAborts } from './structured-agent-session-acquire-aborts'
@@ -151,7 +151,7 @@ function settleReady(
)
const sourceChild = current.child
context.runtimeState.startupAttempts.ready(event.sessionId, child)
- noteStructuredAgentSessionRuntimePermission(current.child, event.reportedOptions, true)
+ noteStructuredAgentSessionRuntimeOptions(current.child, event.reportedOptions, true)
context.publishStatus?.(event.sessionId)
await noteStructuredAgentSessionReportedOptions(
context,
@@ -206,7 +206,7 @@ export async function settleStructuredAgentSessionOptionsReported(
) {
return
}
- noteStructuredAgentSessionRuntimePermission(child, event.reportedOptions)
+ noteStructuredAgentSessionRuntimeOptions(child, event.reportedOptions)
if (child.phase === 'starting') {
const readiness = context.runtimeState.startupAttempts.readiness(event.sessionId, {
generation: event.acquisitionGeneration,
diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-ran-options.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-ran-options.ts
index 70902921c20..b119e13577c 100644
--- a/src/main/native-chat/agent-session-wire/structured-agent-session-ran-options.ts
+++ b/src/main/native-chat/agent-session-wire/structured-agent-session-ran-options.ts
@@ -26,7 +26,12 @@ export type StructuredAgentSessionHandedOptions = {
/** Per-child reports and a handed-over turn awaiting its first model evidence. */
const childRuns = new WeakMap<
StructuredAgentSessionProviderChild,
- { reported?: RanOptions; owed?: StructuredAgentSessionHandedOptions; permission?: string | null }
+ {
+ reported?: RanOptions
+ reportedModel?: string
+ owed?: StructuredAgentSessionHandedOptions
+ permission?: string | null
+ }
>()
function currentChild(context: RanOptionsContext, sessionId: string, fence: number) {
@@ -34,10 +39,10 @@ function currentChild(context: RanOptionsContext, sessionId: string, fence: numb
return child?.fence === fence ? child : null
}
-export function structuredAgentSessionChildRan(
+export function structuredAgentSessionRuntimeModel(
child: StructuredAgentSessionProviderChild
-): RanOptions | undefined {
- return childRuns.get(child)?.reported
+): string | undefined {
+ return child.phase === 'ready' ? childRuns.get(child)?.reportedModel : undefined
}
/** The current child's startup report or applied evidence; never saved intent or send authority. */
@@ -48,17 +53,20 @@ export function structuredAgentSessionRuntimePermission(
return child?.phase === 'ready' && mode !== undefined ? { fence: child.fence, mode } : null
}
-export function noteStructuredAgentSessionRuntimePermission(
+export function noteStructuredAgentSessionRuntimeOptions(
child: StructuredAgentSessionProviderChild,
reported: AgentSessionOptionsResult['current'],
initial = false
): void {
const previous = childRuns.get(child)
+ if (!initial || previous?.reportedModel === undefined) {
+ childRuns.set(child, { ...previous, reportedModel: reported.reportedModel ?? reported.model })
+ }
if (
reported.reportedPermissionMode !== undefined &&
(!initial || previous?.permission === undefined)
) {
- childRuns.set(child, { ...previous, permission: reported.reportedPermissionMode })
+ childRuns.set(child, { ...childRuns.get(child), permission: reported.reportedPermissionMode })
}
}
diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-status-feed.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-status-feed.test.ts
index a22ef4a3d34..e890e5a1969 100644
--- a/src/main/native-chat/agent-session-wire/structured-agent-session-status-feed.test.ts
+++ b/src/main/native-chat/agent-session-wire/structured-agent-session-status-feed.test.ts
@@ -27,6 +27,7 @@ import {
import { createStructuredAgentSessionLogger } from './structured-agent-session-logger'
import { testEventSinkLogging } from './structured-agent-session-logger-test-support'
import { codexProviderHandle } from '../../../shared/agent-session/lifecycle/agent-session-provider-handle-encoding'
+import { releasedStructuredStatusSummary } from './structured-agent-session-status-summary'
const SESSION = 'status-session'
const TURN_IDENTITY = {
@@ -107,6 +108,24 @@ function feedFor(
}
describe('StructuredAgentSessionStatusFeed', () => {
+ it("retains the saved model but drops the released child's reported model", () => {
+ const released = releasedStructuredStatusSummary({
+ sessionId: SESSION,
+ workspaceId: 'workspace-1',
+ agent: 'claude',
+ status: 'idle',
+ latestPrompt: 'hello',
+ model: 'claude-opus-5-5',
+ reportedModel: 'claude-opus-4-8',
+ hostExecutionOwned: true,
+ hostExecutionPhase: 'ready',
+ updatedAt: 1_000
+ })
+
+ expect(released.model).toBe('claude-opus-5-5')
+ expect(released).not.toHaveProperty('reportedModel')
+ })
+
it('publishes provider ownership transitions without changing journal time', async () => {
const journal = await openJournal()
const sessions = new Map([
diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-status-summary-equality.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-status-summary-equality.ts
index 95c32c8fe73..418a6d6f28f 100644
--- a/src/main/native-chat/agent-session-wire/structured-agent-session-status-summary-equality.ts
+++ b/src/main/native-chat/agent-session-wire/structured-agent-session-status-summary-equality.ts
@@ -27,6 +27,7 @@ export function structuredStatusSummariesEqual(
(a.statusStartedAt !== undefined && !isIdleHeldOpenByChildWork(b))) &&
a.latestPrompt === b.latestPrompt &&
a.model === b.model &&
+ a.reportedModel === b.reportedModel &&
a.permissionMode === b.permissionMode &&
a.runtimePermission?.fence === b.runtimePermission?.fence &&
a.runtimePermission?.mode === b.runtimePermission?.mode &&
diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-status-summary.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-status-summary.ts
index 544690731bd..f2a87720f46 100644
--- a/src/main/native-chat/agent-session-wire/structured-agent-session-status-summary.ts
+++ b/src/main/native-chat/agent-session-wire/structured-agent-session-status-summary.ts
@@ -1,4 +1,7 @@
-import { structuredAgentSessionRuntimePermission } from './structured-agent-session-ran-options'
+import {
+ structuredAgentSessionRuntimeModel,
+ structuredAgentSessionRuntimePermission
+} from './structured-agent-session-ran-options'
import type { AgentSessionConversationView } from '../../../shared/agent-session/lifecycle/agent-session-conversation-view'
import type { AgentSessionStatusSummary } from '../../../shared/agent-session/agent-session-wire'
import { normalizeOptionalField } from '../../../shared/agent-status-field-normalization'
@@ -80,6 +83,9 @@ export function structuredAgentSessionStatusSummary({
? { rewindBlockedReason: 'outcome-unknown' as const }
: {}),
...(model ? { model } : {}),
+ ...(session.params.provider === 'claude' && session.child
+ ? { reportedModel: structuredAgentSessionRuntimeModel(session.child) }
+ : {}),
...(isAgentChatPermissionMode(permissionMode) ? { permissionMode } : {}),
...(effort ? { effort } : {}),
...(fastMode ? { fastMode } : {}),
@@ -146,6 +152,7 @@ export function releasedStructuredStatusSummary(
hostExecutionPhase: _hostExecutionPhase,
stopping: _stopping,
restartResume: _restartResume,
+ reportedModel: _reportedModel,
...retained
} = previous
return { ...retained, runtimePermission: null }
diff --git a/src/renderer/src/components/native-chat/NativeChatModelFallback.fixture.tsx b/src/renderer/src/components/native-chat/NativeChatModelFallback.fixture.tsx
new file mode 100644
index 00000000000..a6c8d11e91e
--- /dev/null
+++ b/src/renderer/src/components/native-chat/NativeChatModelFallback.fixture.tsx
@@ -0,0 +1,110 @@
+import { NativeChatSessionOptionPickers } from './NativeChatSessionOptionPickers'
+import { ProviderFrameRow } from './NativeChatTranscriptChrome'
+import { defineFixture } from '../../component-fixtures/component-fixture'
+import { MessageRow } from './NativeChatMessageRow'
+import { projectStructuredItemToNativeChat } from '../../../../shared/agent-session/view/structured-agent-session-projection'
+
+const head = JSON.stringify({
+ type: 'fallback',
+ from: { model: 'claude-opus-5-5' },
+ to: { model: 'claude-opus-4-8' }
+})
+const raw = {
+ text: 'Claude sent content Orca cannot display yet',
+ providerFrame: {
+ provider: 'claude',
+ kind: 'message:assistant:content:fallback',
+ payload: { head, byteLength: head.length, digest: 'fixture', truncated: false }
+ }
+}
+const message = projectStructuredItemToNativeChat({
+ itemId: 'fallback',
+ revision: 1,
+ sequence: 1,
+ observedAt: 1,
+ body: { kind: 'status', ...raw }
+})
+
+function ModelPicker({ reportedModel }: { reportedModel?: string }) {
+ return (
+ [],
+ subscribe: () => () => {},
+ setOption: async () => ({ snapshot: [] }),
+ invokeAction: async () => ({ snapshot: [] })
+ }}
+ isWorking={true}
+ snapshot={[
+ {
+ id: 'model',
+ label: 'Model',
+ category: 'model',
+ transport: 'agent-session',
+ settable: false,
+ valueSource: 'applied',
+ reportedModel,
+ kind: {
+ type: 'select',
+ currentValue: 'claude-opus-5-5',
+ choices: [{ value: 'claude-opus-5-5', label: 'Opus 5.5' }]
+ }
+ }
+ ]}
+ />
+ )
+}
+
+function FallbackNotice() {
+ return message ? (
+ {}}
+ />
+ ) : null
+}
+
+export const fallback = defineFixture({
+ width: 720,
+ render: () => (
+
+
+
+ )
+})
+
+export const narrow = defineFixture({ width: 320, render: fallback.render })
+
+export const composer = defineFixture({
+ width: 360,
+ render: () => (
+
+
+
+ )
+})
+
+export const before = defineFixture({
+ width: 720,
+ render: () => (
+
+ ),
+ interact: (frame) => {
+ frame.querySelector('summary')?.click()
+ }
+})
+
+export const after = defineFixture({
+ width: 720,
+ render: () => (
+
+
+
+
+ )
+})
diff --git a/src/renderer/src/components/native-chat/NativeChatNoticeRow.model-fallback.test.tsx b/src/renderer/src/components/native-chat/NativeChatNoticeRow.model-fallback.test.tsx
new file mode 100644
index 00000000000..0d078f4fad3
--- /dev/null
+++ b/src/renderer/src/components/native-chat/NativeChatNoticeRow.model-fallback.test.tsx
@@ -0,0 +1,64 @@
+// @vitest-environment happy-dom
+import '@testing-library/jest-dom/vitest'
+import { cleanup, render, screen } from '@testing-library/react'
+import { afterEach, expect, it, vi } from 'vitest'
+import { projectStructuredItemToNativeChat } from '../../../../shared/agent-session/view/structured-agent-session-projection'
+import type { AgentJournalStatusItem } from '../../../../shared/agent-session/journal/agent-session-journal-types'
+import { TooltipProvider } from '@/components/ui/tooltip'
+import { MessageRow } from './NativeChatMessageRow'
+import { i18n } from '@/i18n/i18n'
+
+afterEach(async () => {
+ cleanup()
+ await i18n.changeLanguage('en')
+})
+
+function renderStatus(body: AgentJournalStatusItem) {
+ const message = projectStructuredItemToNativeChat({
+ itemId: 'notice',
+ sequence: 1,
+ revision: 1,
+ observedAt: 1,
+ body
+ })
+ if (!message) {
+ throw new Error('expected notice')
+ }
+ render(
+
+
+
+ )
+}
+
+it.each([
+ ['en', 'Claude switched models: Claude Opus 5.5 → Claude Opus 4.8.'],
+ ['ru', 'Claude переключил модель: Claude Opus 5.5 → Claude Opus 4.8.']
+])(
+ 'renders the saved fallback as a readable %s notice instead of unknown JSON',
+ async (locale, words) => {
+ await i18n.changeLanguage(locale)
+ const head = JSON.stringify({
+ type: 'fallback',
+ from: { model: 'claude-opus-5-5' },
+ to: { model: 'claude-opus-4-8' }
+ })
+ renderStatus({
+ kind: 'status',
+ text: 'Claude sent content Orca cannot display yet',
+ providerFrame: {
+ provider: 'claude',
+ kind: 'message:assistant:content:fallback',
+ payload: { head, byteLength: head.length, digest: 'fixture', truncated: false }
+ }
+ })
+ expect(screen.getByText(words)).toBeInTheDocument()
+ expect(screen.queryByText('Claude sent content Orca cannot display yet')).toBeNull()
+ expect(screen.queryByText(head)).toBeNull()
+ }
+)
diff --git a/src/renderer/src/components/native-chat/NativeChatNoticeRow.tsx b/src/renderer/src/components/native-chat/NativeChatNoticeRow.tsx
index 66da36757ee..00cc619275b 100644
--- a/src/renderer/src/components/native-chat/NativeChatNoticeRow.tsx
+++ b/src/renderer/src/components/native-chat/NativeChatNoticeRow.tsx
@@ -1,3 +1,7 @@
+import {
+ CLAUDE_MODEL_FALLBACK_COPY,
+ claudeModelFallbackLabels
+} from '../../../../shared/native-chat/claude-model-fallback'
import { NativeChatUsageLimitAutoContinue } from './NativeChatUsageLimitAutoContinue'
import { NativeChatUsageLimitActions } from './NativeChatUsageLimitActions'
import { agentSessionGoalControlWords } from './agent-session-goal-control-words'
@@ -116,6 +120,17 @@ export function NativeChatNoticeRow({
)
}
+ if (look.kind === 'model-fallback') {
+ return (
+
+ {translate(
+ 'components.native-chat.notices.modelFallback',
+ CLAUDE_MODEL_FALLBACK_COPY,
+ claudeModelFallbackLabels(look)
+ )}
+
+ )
+ }
if (look.kind === 'plan') {
return (
diff --git a/src/renderer/src/components/native-chat/NativeChatSessionOptionPickers.mid-turn.test.tsx b/src/renderer/src/components/native-chat/NativeChatSessionOptionPickers.mid-turn.test.tsx
index 522f743444d..20cde62d86c 100644
--- a/src/renderer/src/components/native-chat/NativeChatSessionOptionPickers.mid-turn.test.tsx
+++ b/src/renderer/src/components/native-chat/NativeChatSessionOptionPickers.mid-turn.test.tsx
@@ -118,3 +118,68 @@ it('picks effort during a running turn, saves it to the chat, and captures it on
rpc.call.mock.calls.every(([, method]) => !['turn/steer', 'turn/start'].includes(method))
).toBe(true)
})
+
+it('refreshes the composer model from host execution reports without changing captured input', async () => {
+ let reportedModel = 'claude-opus-5-5'
+ const sent: unknown[] = []
+ rpc.call.mockImplementation(async (_target, method) => {
+ if (method === 'agentSession.options') {
+ return {
+ models: [{ id: 'claude-opus-5-5', label: 'Opus 5.5', efforts: [] }],
+ current: {
+ model: 'claude-opus-5-5',
+ reportedModel,
+ defaulted: [],
+ acceptedInputSources: { model: 'saved' }
+ }
+ }
+ }
+ if (method === 'agentSession.modelCatalog') {
+ return { origin: 'unknown' }
+ }
+ throw new Error(`Unexpected RPC ${method}`)
+ })
+ function Composer({ stamp }: { stamp: string }) {
+ const options = useStructuredAgentSessionOptions({
+ agent: 'claude',
+ sessionId,
+ target,
+ fence: 1,
+ transportEnabled: true,
+ isVisible: true,
+ providerVisible: true,
+ providerRunning: true,
+ turnId: 'running',
+ unloadedTurnRevisions: undefined,
+ hostOptionStamp: stamp,
+ mutate: async () => null
+ })
+ const capture = useStructuredAgentSessionSendOptions(sessionId, undefined, options.sendSource)
+ return (
+
+
+
+
+ )
+ }
+ const { rerender } = render()
+ await waitFor(() =>
+ expect(screen.getByRole('button', { name: /^Model (Claude )?Opus 5\.5$/ })).toBeTruthy()
+ )
+ reportedModel = 'claude-opus-4-8'
+ rerender()
+ await waitFor(() =>
+ expect(screen.getByRole('button', { name: /^Model (Claude )?Opus 4\.8$/ })).toBeTruthy()
+ )
+ fireEvent.click(screen.getByText('Capture next message'))
+ expect(sent).toEqual([{ selection: { model: 'claude-opus-5-5' } }])
+ reportedModel = 'claude-opus-5-5'
+ rerender()
+ await waitFor(() =>
+ expect(screen.getByRole('button', { name: /^Model (Claude )?Opus 5\.5$/ })).toBeTruthy()
+ )
+})
diff --git a/src/renderer/src/components/native-chat/use-structured-agent-session-option-state.ts b/src/renderer/src/components/native-chat/use-structured-agent-session-option-state.ts
index c8490410b44..aa95c829b48 100644
--- a/src/renderer/src/components/native-chat/use-structured-agent-session-option-state.ts
+++ b/src/renderer/src/components/native-chat/use-structured-agent-session-option-state.ts
@@ -11,10 +11,8 @@ import type { AgentType } from '../../../../shared/agent-status-types'
import type { AgentSessionOptionCatalog } from '../../../../shared/agent-session/options/agent-session-option-catalog-types'
import { usesInstalledAgentModelCatalog } from '../../../../shared/agent-session/options/agent-model-catalog-ownership'
import { AGENT_SESSION_COHERENT_MODEL_CATALOG_CAPABILITY } from '../../../../shared/agent-session/structured-agent-session-surface-capabilities'
-import {
- structuredAgentSessionReportsAtFence,
- type StructuredAgentSessionOptionState
-} from '../../../../shared/agent-session/options/structured-agent-session-options'
+import type { StructuredAgentSessionOptionState } from '../../../../shared/agent-session/options/structured-agent-session-options'
+import { structuredAgentSessionReportsAtFence } from '../../../../shared/agent-session/options/structured-agent-session-runtime-reports'
import type { RuntimeClientTarget } from '../../../../shared/runtime-client-target'
import { structuredAgentSessionOptionView } from '../../../../shared/agent-session/options/structured-agent-session-option-view'
import {
diff --git a/src/renderer/src/i18n/en-runtime-required.json b/src/renderer/src/i18n/en-runtime-required.json
index 52ce1939d26..f90d529f451 100644
--- a/src/renderer/src/i18n/en-runtime-required.json
+++ b/src/renderer/src/i18n/en-runtime-required.json
@@ -1538,7 +1538,6 @@
"attachmentAtMost": "{{agent}} accepts at most {{limit}} images in one message, so this message was not sent.",
"attachmentEmpty": "An image on this message is empty, so the message was not sent.",
"attachmentInvalid": "An attachment on this message can't be sent to the agent.",
- "attachmentsExpired": "{{names}} expired.",
"attachmentLargerThan": "An image on this message is larger than {{size}} MB, so the message was not sent.",
"attachmentNoSource": "An image on this message has no file to send, so the message was not sent.",
"attachmentNotAFile": "An image on this message isn't a file, so the message was not sent.",
@@ -1548,6 +1547,7 @@
"attachmentTotalTooLarge": "The images on this message are too large together, so the message was not sent.",
"attachmentUnreadable": "An attachment on this message couldn't be read, so the message was not sent.",
"attachmentUnsupportedType": "{{agent}} accepts only PNG, JPEG, GIF, and WebP images, so this message was not sent.",
+ "attachmentsExpired": "{{names}} expired.",
"backgroundTaskNotStopped": "The background task wasn't stopped.",
"backgroundTasksNotStopped": "The background tasks weren't stopped.",
"cancelUnconfirmed": "Cancellation was not confirmed.",
@@ -1651,6 +1651,7 @@
"continuedOutsideRewound": "Continued outside this chat. Earlier replies above are no longer in this conversation's history.",
"historyItemTooLarge": "This part of the chat was too large to show.",
"historyRepaired": "Part of this chat's history couldn't be loaded.",
+ "modelFallback": "Claude switched models: {{from}} → {{to}}.",
"orcaStopCanContinue": "You can continue in this conversation.",
"orcaStopCrash": "Orca on {{machine}} stopped unexpectedly while this response was in progress.",
"orcaStopQuit": "Orca on {{machine}} was closed while this response was in progress.",
@@ -1835,6 +1836,7 @@
"historyUnreadable": "Orca couldn't read this chat's saved history.",
"historyUnusable": "Unable to load this chat.",
"hostReconciling": "Orca is still checking on this chat after restarting.",
+ "mailOwnerUnconfirmed": "Orca couldn't confirm this message is still meant for this chat.",
"messageNotSaved": "Couldn't save your message.",
"messageTooLarge": "It is over the 256 KB limit for one message.",
"messagesUnsettled": "A message you sent earlier isn't confirmed yet.",
@@ -1862,7 +1864,6 @@
"reattachFiles": "Remove them and attach them again.",
"recordFailed": "Orca couldn't save this to the chat's history.",
"recordUnreadable": "Orca couldn't read this chat's saved state.",
- "mailOwnerUnconfirmed": "Orca couldn't confirm this message is still meant for this chat.",
"reopenChat": "Reopen the chat to check again.",
"restartFailed": "The agent couldn't restart.",
"runClearWhenDone": "Run /clear when it's done.",
diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json
index 8379afe1891..7a6724971ee 100644
--- a/src/renderer/src/i18n/locales/en.json
+++ b/src/renderer/src/i18n/locales/en.json
@@ -19681,7 +19681,8 @@
"orcaStopUnnamedServer": "the remote server",
"permissionDenied": "{{agent}} denied permission. View details.",
"safetyReview": "{{agent}} reported a safety review warning. View details.",
- "truncatedResponse": "Provider response truncated (original size: {{bytes}} bytes)."
+ "truncatedResponse": "Provider response truncated (original size: {{bytes}} bytes).",
+ "modelFallback": "Claude switched models: {{from}} → {{to}}."
},
"composer": {
"send": "Send",
diff --git a/src/renderer/src/i18n/locales/ru.json b/src/renderer/src/i18n/locales/ru.json
index e4a1941c4a1..34f0ef364b4 100644
--- a/src/renderer/src/i18n/locales/ru.json
+++ b/src/renderer/src/i18n/locales/ru.json
@@ -19887,7 +19887,8 @@
"orcaStopUnnamedServer": "удалённом сервере",
"permissionDenied": "{{agent}} отказал в разрешении. Подробнее.",
"safetyReview": "{{agent}} сообщил о предупреждении проверки безопасности. Подробнее.",
- "truncatedResponse": "Ответ поставщика обрезан (исходный размер: {{bytes}} байт)."
+ "truncatedResponse": "Ответ поставщика обрезан (исходный размер: {{bytes}} байт).",
+ "modelFallback": "Claude переключил модель: {{from}} → {{to}}."
},
"composer": {
"send": "Отправить",
diff --git a/src/shared/agent-session/agent-session-wire.ts b/src/shared/agent-session/agent-session-wire.ts
index 67b1da6e3ee..ffda5f7f17a 100644
--- a/src/shared/agent-session/agent-session-wire.ts
+++ b/src/shared/agent-session/agent-session-wire.ts
@@ -214,6 +214,8 @@ export type AgentSessionStatusSummary = {
latestPrompt: string
/** Provider model in force for the next turn; absent until the host has read the options. */
model?: string
+ /** Current child's reported execution model, independent of the next-turn selection. */
+ reportedModel?: string
/** The chat's saved permission mode; a client re-reads options when it or `model` moves. */
permissionMode?: string
runtimePermission?: { fence: number; mode: string | null } | null
diff --git a/src/shared/agent-session/options/agent-session-options-result.ts b/src/shared/agent-session/options/agent-session-options-result.ts
index 9053936f637..ae3a6b5420f 100644
--- a/src/shared/agent-session/options/agent-session-options-result.ts
+++ b/src/shared/agent-session/options/agent-session-options-result.ts
@@ -44,6 +44,8 @@ export type AgentSessionOptionsResult = {
/** Accepted input origins; an empty map excludes all display-only observations. */
acceptedInputSources?: AgentSessionAcceptedInputSources
model?: string
+ /** Current child reports this model for display; it is never a next-turn selection. */
+ reportedModel?: string
effort?: string
/** Child-scoped actual for display only; effort remains accepted raw input. */
reportedEffort?: string
diff --git a/src/shared/agent-session/options/structured-agent-session-option-snapshot.ts b/src/shared/agent-session/options/structured-agent-session-option-snapshot.ts
index 3fa89f0eb30..1fe38334164 100644
--- a/src/shared/agent-session/options/structured-agent-session-option-snapshot.ts
+++ b/src/shared/agent-session/options/structured-agent-session-option-snapshot.ts
@@ -221,7 +221,11 @@ export function structuredAgentSessionOptionSnapshot(
): SessionOptionDescriptor[] {
const permission = structuredAgentSessionPermissionDescriptor(state)
const options = modelOptionSnapshot(state).map((option) =>
- state.fastModeRestricted && option.id === 'fastMode' ? { ...option, settable: false } : option
+ state.fastModeRestricted && option.id === 'fastMode'
+ ? { ...option, settable: false }
+ : option.id === 'model' && state.reportedModel
+ ? { ...option, reportedModel: state.reportedModel }
+ : option
)
return permission ? [...options, permission] : options
}
diff --git a/src/shared/agent-session/options/structured-agent-session-option-state.ts b/src/shared/agent-session/options/structured-agent-session-option-state.ts
index 08848cd0dca..043220e66d2 100644
--- a/src/shared/agent-session/options/structured-agent-session-option-state.ts
+++ b/src/shared/agent-session/options/structured-agent-session-option-state.ts
@@ -73,12 +73,13 @@ export function structuredAgentSessionOptionStamp(
summary:
| Pick<
AgentSessionStatusSummary,
- 'model' | 'permissionMode' | 'effort' | 'fastMode' | 'serviceTier'
+ 'model' | 'reportedModel' | 'permissionMode' | 'effort' | 'fastMode' | 'serviceTier'
>
| undefined
): string {
return [
summary?.model,
+ summary?.reportedModel,
summary?.permissionMode,
summary?.effort,
summary?.fastMode,
diff --git a/src/shared/agent-session/options/structured-agent-session-options-read-owner.ts b/src/shared/agent-session/options/structured-agent-session-options-read-owner.ts
index 0820ac61ba8..218899f3946 100644
--- a/src/shared/agent-session/options/structured-agent-session-options-read-owner.ts
+++ b/src/shared/agent-session/options/structured-agent-session-options-read-owner.ts
@@ -197,6 +197,7 @@ export function createStructuredAgentSessionOptionsReadOwner(
...current,
record: cloneStructuredAgentSessionOptionRecord(current.record),
reportedPermissionMode: undefined,
+ reportedModel: undefined,
reportedEffort: undefined,
...(current.acceptedInputSources ? { acceptedInputSources: {} } : {})
}
@@ -214,6 +215,7 @@ export function createStructuredAgentSessionOptionsReadOwner(
...current,
record: cloneStructuredAgentSessionOptionRecord(current.record),
reportedPermissionMode: undefined,
+ reportedModel: undefined,
reportedEffort: undefined
}
: context.seed()
diff --git a/src/shared/agent-session/options/structured-agent-session-options.ts b/src/shared/agent-session/options/structured-agent-session-options.ts
index cf5bdb6554e..5e6d8ccaaa3 100644
--- a/src/shared/agent-session/options/structured-agent-session-options.ts
+++ b/src/shared/agent-session/options/structured-agent-session-options.ts
@@ -64,6 +64,7 @@ export type StructuredAgentSessionOptionState = {
permissionMode: string | null
reportedPermissionMode?: string | null
permissionOwnSupported?: boolean | null
+ reportedModel?: string
reportedEffort?: string
/** The host is still listing models; it only keeps a seed from settling to built-in, since controls follow their data. */
listingInProgress?: boolean
@@ -187,6 +188,7 @@ export function applyStructuredAgentSessionOptions(
return {
...state,
optionsAnswerPresent: true,
+ reportedModel: current.reportedModel,
reportedEffort: state.record.agent === 'pi' ? current.reportedEffort : undefined,
catalog: keepCatalog
? state.catalog
@@ -226,22 +228,15 @@ function structuredAgentSessionControlsModelId(
: null
}
-/** Runtime reports describe the process whose options answer carried them; a newer fence has none until it answers. */
-export function structuredAgentSessionReportsAtFence<
- T extends Pick
->(state: T, answeredFence: number | null | undefined, fence: number | null): T {
- return answeredFence === fence ||
- (state.reportedPermissionMode === undefined && state.reportedEffort === undefined)
- ? state
- : { ...state, reportedPermissionMode: undefined, reportedEffort: undefined }
-}
-
export function commitStructuredAgentSessionOption(
state: StructuredAgentSessionOptionState,
id: string,
value: string,
origin: 'picked' | 'seeded' = 'picked'
): StructuredAgentSessionOptionState {
+ if (id === 'model') {
+ state = { ...state, reportedModel: undefined }
+ }
if (id === 'model' || id === 'effort') {
state = { ...state, reportedEffort: undefined }
}
diff --git a/src/shared/agent-session/options/structured-agent-session-reported-model.test.ts b/src/shared/agent-session/options/structured-agent-session-reported-model.test.ts
new file mode 100644
index 00000000000..f41214afd17
--- /dev/null
+++ b/src/shared/agent-session/options/structured-agent-session-reported-model.test.ts
@@ -0,0 +1,51 @@
+import { expect, it } from 'vitest'
+import { CLAUDE_SESSION_OPTION_CATALOG } from './agent-session-option-catalog-claude-codex'
+import {
+ applyStructuredAgentSessionOptions,
+ createStructuredAgentSessionOptionState,
+ commitStructuredAgentSessionOption
+} from './structured-agent-session-options'
+import { structuredAgentSessionReportsAtFence } from './structured-agent-session-runtime-reports'
+import { structuredAgentSessionOptionSnapshot } from './structured-agent-session-option-snapshot'
+import { structuredAgentSessionMessageSelection } from './structured-agent-session-option-view'
+import {
+ nativeChatModelPillLabel,
+ sayNativeChatSessionOptionEnglish
+} from '../../native-chat/input/native-chat-session-option-labels'
+import { structuredAgentSessionOptionStamp } from './structured-agent-session-option-state'
+
+it('shows the actual fallback in the shared composer pill while capturing the original model for Send', () => {
+ const state = applyStructuredAgentSessionOptions(
+ createStructuredAgentSessionOptionState('claude'),
+ CLAUDE_SESSION_OPTION_CATALOG,
+ {
+ models: [{ id: 'claude-opus-5-5', label: 'Opus 5.5', isDefault: false, efforts: [] }],
+ current: {
+ model: 'claude-opus-5-5',
+ reportedModel: 'claude-opus-4-8',
+ defaulted: [],
+ acceptedInputSources: { model: 'saved' }
+ }
+ }
+ )
+ const model = structuredAgentSessionOptionSnapshot(state).find((option) => option.id === 'model')!
+ expect(nativeChatModelPillLabel(model, sayNativeChatSessionOptionEnglish)).toBe('Opus 4.8')
+ expect(model.kind.currentValue).toBe('claude-opus-5-5')
+ expect(structuredAgentSessionMessageSelection(state)).toEqual({ model: 'claude-opus-5-5' })
+ expect(structuredAgentSessionReportsAtFence(state, 1, 2).reportedModel).toBeUndefined()
+ expect(
+ commitStructuredAgentSessionOption(state, 'model', 'claude-opus-5-5').reportedModel
+ ).toBeUndefined()
+ const oldHost = applyStructuredAgentSessionOptions(state, CLAUDE_SESSION_OPTION_CATALOG, {
+ models: [],
+ current: { model: 'claude-opus-5-5' }
+ })
+ expect(oldHost.reportedModel).toBeUndefined()
+})
+
+it('invalidates option reads when a response changes model without changing the saved selection', () => {
+ const selected = { model: 'claude-opus-5-5' }
+ expect(
+ structuredAgentSessionOptionStamp({ ...selected, reportedModel: 'claude-opus-4-8' })
+ ).not.toBe(structuredAgentSessionOptionStamp({ ...selected, reportedModel: 'claude-opus-5-5' }))
+})
diff --git a/src/shared/agent-session/options/structured-agent-session-runtime-reports.ts b/src/shared/agent-session/options/structured-agent-session-runtime-reports.ts
new file mode 100644
index 00000000000..eab4a29c34a
--- /dev/null
+++ b/src/shared/agent-session/options/structured-agent-session-runtime-reports.ts
@@ -0,0 +1,21 @@
+import type { StructuredAgentSessionOptionState } from './structured-agent-session-options'
+
+/** Runtime reports describe the process whose options answer carried them; a newer fence has none until it answers. */
+export function structuredAgentSessionReportsAtFence<
+ T extends Pick<
+ StructuredAgentSessionOptionState,
+ 'reportedPermissionMode' | 'reportedModel' | 'reportedEffort'
+ >
+>(state: T, answeredFence: number | null | undefined, fence: number | null): T {
+ return answeredFence === fence ||
+ (state.reportedPermissionMode === undefined &&
+ state.reportedModel === undefined &&
+ state.reportedEffort === undefined)
+ ? state
+ : {
+ ...state,
+ reportedPermissionMode: undefined,
+ reportedModel: undefined,
+ reportedEffort: undefined
+ }
+}
diff --git a/src/shared/agent-session/view/structured-agent-session-status-block.ts b/src/shared/agent-session/view/structured-agent-session-status-block.ts
index 8574f59886c..ad01303280a 100644
--- a/src/shared/agent-session/view/structured-agent-session-status-block.ts
+++ b/src/shared/agent-session/view/structured-agent-session-status-block.ts
@@ -1,3 +1,8 @@
+import {
+ readClaudeModelFallbackFrame,
+ claudeModelFallbackText
+} from '../../native-chat/claude-model-fallback'
+import { AGENT_SESSION_TURN_NOTICE_PRESENTATION } from '../journal/agent-session-turn-notice'
import { readWholeAgentSessionFailureFact } from '../failures/agent-session-failure'
import type { AgentJournalStatusItem } from '../journal/agent-session-journal-types'
import type { AgentJournalTurnScope } from '../journal/agent-session-journal-turn-scope'
@@ -16,17 +21,22 @@ export function structuredAgentSessionStatusBlock(
): NativeChatTextBlock {
const failure = readWholeAgentSessionFailureFact(body.failure)
const orcaStop = readAgentSessionOrcaStop(body.orcaStop)
+ const modelFallback =
+ !failure && !orcaStop && body.presentation === undefined && body.tone === undefined
+ ? readClaudeModelFallbackFrame(body.providerFrame)
+ : null
const presentation =
body.presentation ??
+ (modelFallback ? AGENT_SESSION_TURN_NOTICE_PRESENTATION : undefined) ??
(body.tone === 'warning' && itemId !== undefined && isAgentSessionLegacyCompactionResult(itemId)
? AGENT_SESSION_COMPACTION_SKIPPED_PRESENTATION
: undefined)
return {
type: 'text',
- text: body.text,
+ text: modelFallback ? claudeModelFallbackText(modelFallback) : body.text,
...(presentation !== undefined ? { presentation } : {}),
...(body.contextClear !== undefined ? { contextClear: body.contextClear } : {}),
- ...(body.tone !== undefined ? { tone: body.tone } : {}),
+ ...(body.tone !== undefined ? { tone: body.tone } : modelFallback ? { tone: 'notice' } : {}),
...(body.providerFrame ? { providerFrame: body.providerFrame } : {}),
...(failure ? { failure } : {}),
...(failure?.kind === 'usageLimitReached' && turnScope?.kind === 'turn'
diff --git a/src/shared/native-chat/claude-model-fallback.test.ts b/src/shared/native-chat/claude-model-fallback.test.ts
new file mode 100644
index 00000000000..3c297b5c061
--- /dev/null
+++ b/src/shared/native-chat/claude-model-fallback.test.ts
@@ -0,0 +1,89 @@
+import { expect, it } from 'vitest'
+import { structuredAgentSessionStatusBlock } from '../agent-session/view/structured-agent-session-status-block'
+import { nativeChatNoticeLook } from './native-chat-notice'
+import {
+ CLAUDE_MODEL_FALLBACK_FRAME_KIND,
+ readClaudeModelFallbackFrame
+} from './claude-model-fallback'
+
+const fallback = {
+ type: 'fallback',
+ from: { model: 'claude-opus-5-5' },
+ to: { model: 'claude-opus-4-8' }
+}
+
+function frame(value: unknown = fallback) {
+ const head = JSON.stringify(value)
+ return {
+ provider: 'claude',
+ kind: CLAUDE_MODEL_FALLBACK_FRAME_KIND,
+ payload: { head, byteLength: head.length, digest: 'fixture', truncated: false }
+ }
+}
+
+it('upcasts the saved unknown content from an older host without rewriting its diagnostic payload', () => {
+ const body = {
+ kind: 'status',
+ text: 'Claude sent content Orca cannot display yet',
+ providerFrame: frame()
+ } as const
+ const block = structuredAgentSessionStatusBlock(body)
+ expect(block).toEqual({
+ type: 'text',
+ text: 'Claude switched models: Claude Opus 5.5 → Claude Opus 4.8.',
+ tone: 'notice',
+ presentation: 'turn-notice',
+ providerFrame: body.providerFrame
+ })
+ expect(nativeChatNoticeLook(block)).toEqual({
+ kind: 'model-fallback',
+ from: 'claude-opus-5-5',
+ to: 'claude-opus-4-8'
+ })
+ expect(body.text).toBe('Claude sent content Orca cannot display yet')
+})
+
+it.each([
+ null,
+ { type: 'fallback', from: { model: 'claude-opus-5-5' } },
+ { type: 'fallback', from: { model: [] }, to: { model: 'claude-opus-4-8' } },
+ { type: 'fallback', from: { model: ' ' }, to: { model: 'claude-opus-4-8' } },
+ { ...fallback, type: 'future_event' }
+])(
+ 'keeps an incomplete or different event available through the generic disclosure: %j',
+ (value) => {
+ const body = { kind: 'status', text: 'Unknown content', providerFrame: frame(value) } as const
+ expect(structuredAgentSessionStatusBlock(body)).toEqual({
+ type: 'text',
+ text: body.text,
+ providerFrame: body.providerFrame
+ })
+ }
+)
+
+it('requires a complete Claude assistant fallback frame', () => {
+ const known = frame()
+ for (const other of [
+ { ...known, provider: 'codex' },
+ { ...known, kind: 'message:user:content:fallback' },
+ { ...known, payload: { ...known.payload, truncated: true } },
+ { ...known, payload: { ...known.payload, head: '{' } }
+ ]) {
+ expect(readClaudeModelFallbackFrame(other)).toBeNull()
+ }
+})
+
+it.each([
+ { tone: 'error' },
+ { presentation: 'plan-document' },
+ { failure: { kind: 'usageLimitReached' } },
+ { orcaStop: { cause: 'quit' } }
+] as const)('does not replace another explicit status or failure: %j', (special) => {
+ const block = {
+ type: 'text',
+ text: 'Keep this status',
+ providerFrame: frame(),
+ ...special
+ } as const
+ expect(nativeChatNoticeLook(block).kind).not.toBe('model-fallback')
+})
diff --git a/src/shared/native-chat/claude-model-fallback.ts b/src/shared/native-chat/claude-model-fallback.ts
new file mode 100644
index 00000000000..135df36fabf
--- /dev/null
+++ b/src/shared/native-chat/claude-model-fallback.ts
@@ -0,0 +1,59 @@
+import { MAX_CONTEXT_MODEL_ID_CHARS } from '../agent-session/agent-session-context-usage'
+import { labelFromModelId } from '../model-id-label'
+import type { NativeChatTextBlock } from './native-chat-types'
+
+export const CLAUDE_MODEL_FALLBACK_FRAME_KIND = 'message:assistant:content:fallback'
+export const CLAUDE_MODEL_FALLBACK_COPY = 'Claude switched models: {{from}} → {{to}}.'
+
+export type ClaudeModelFallback = { from: string; to: string }
+
+function modelOf(value: unknown): string | null {
+ if (typeof value !== 'object' || value === null || !('model' in value)) {
+ return null
+ }
+ const model = typeof value.model === 'string' ? value.model.trim() : ''
+ return model && model.length <= MAX_CONTEXT_MODEL_ID_CHARS ? model : null
+}
+
+export function readClaudeModelFallback(value: unknown): ClaudeModelFallback | null {
+ if (
+ typeof value !== 'object' ||
+ value === null ||
+ !('type' in value) ||
+ value.type !== 'fallback'
+ ) {
+ return null
+ }
+ const from = modelOf('from' in value ? value.from : null)
+ const to = modelOf('to' in value ? value.to : null)
+ return from && to ? { from, to } : null
+}
+
+export function readClaudeModelFallbackFrame(
+ frame: NativeChatTextBlock['providerFrame']
+): ClaudeModelFallback | null {
+ if (
+ frame?.provider !== 'claude' ||
+ frame.kind !== CLAUDE_MODEL_FALLBACK_FRAME_KIND ||
+ frame.payload.truncated
+ ) {
+ return null
+ }
+ try {
+ return readClaudeModelFallback(JSON.parse(frame.payload.head))
+ } catch {
+ return null
+ }
+}
+
+export function claudeModelFallbackLabels(fallback: ClaudeModelFallback): ClaudeModelFallback {
+ return { from: labelFromModelId(fallback.from), to: labelFromModelId(fallback.to) }
+}
+
+export function claudeModelFallbackText(fallback: ClaudeModelFallback): string {
+ const labels = claudeModelFallbackLabels(fallback)
+ return CLAUDE_MODEL_FALLBACK_COPY.replace('{{from}}', () => labels.from).replace(
+ '{{to}}',
+ () => labels.to
+ )
+}
diff --git a/src/shared/native-chat/input/native-chat-session-option-labels.ts b/src/shared/native-chat/input/native-chat-session-option-labels.ts
index ea3e08a5b14..dd309262762 100644
--- a/src/shared/native-chat/input/native-chat-session-option-labels.ts
+++ b/src/shared/native-chat/input/native-chat-session-option-labels.ts
@@ -1,3 +1,4 @@
+import { labelFromModelId } from '../../model-id-label'
import {
isDefaultServiceTier,
type SessionOptionDescriptor,
@@ -156,7 +157,20 @@ export function nativeChatModelPillLabel(
): string {
// The tooltip names the category; default sources still identify a model, while unknown sources do not.
const choice = descriptor.valueSource === 'unknown' ? null : selectedNativeChatChoice(descriptor)
- return choice ? nativeChatSessionChoiceLabel(choice, say) : say('model')
+ const selected = choice ? nativeChatSessionChoiceLabel(choice, say) : say('model')
+ const reported = descriptor.reportedModel
+ if (!reported || (choice && reported === choice.value.replace(/\[[^\]]*\]$/u, ''))) {
+ return selected
+ }
+ const reportedChoice =
+ descriptor.kind.type === 'select'
+ ? descriptor.kind.choices.find((entry) => entry.value === reported)
+ : undefined
+ const label = reportedChoice
+ ? nativeChatSessionChoiceLabel(reportedChoice, say)
+ : labelFromModelId(reported)
+ const actual = selected.startsWith('Claude ') ? label : label.replace(/^Claude /, '')
+ return actual
}
export function nativeChatOptionsPillTitle(
diff --git a/src/shared/native-chat/input/native-chat-session-options.ts b/src/shared/native-chat/input/native-chat-session-options.ts
index 36c46fb634e..6baa0242a93 100644
--- a/src/shared/native-chat/input/native-chat-session-options.ts
+++ b/src/shared/native-chat/input/native-chat-session-options.ts
@@ -37,6 +37,8 @@ export type SessionOptionDescriptor = {
currentValue: boolean
}
valueSource: SessionOptionValueSource
+ /** Model-pill display only; currentValue remains the accepted selection. */
+ reportedModel?: string
/** Explicit lane is required: dispatched cannot distinguish PTY from structured transports. */
transport: NativeChatLiveOptionTransport
settable: boolean
diff --git a/src/shared/native-chat/native-chat-notice.ts b/src/shared/native-chat/native-chat-notice.ts
index efab1e443ac..e09e89b39e1 100644
--- a/src/shared/native-chat/native-chat-notice.ts
+++ b/src/shared/native-chat/native-chat-notice.ts
@@ -1,5 +1,7 @@
// Shared host/command/plan notice presentation: desktop translates the copy; mobile renders it directly.
+import { readClaudeModelFallbackFrame } from './claude-model-fallback'
+import { AGENT_SESSION_TURN_NOTICE_PRESENTATION } from '../agent-session/journal/agent-session-turn-notice'
import {
isAgentSessionHostStatusPresentation,
type AgentSessionHostStatusPresentation
@@ -24,6 +26,7 @@ export type NativeChatNoticeLook =
/** The host's line in the reader's words, drawn faint. */
| { kind: 'host-status'; presentation: AgentSessionHostStatusPresentation }
| { kind: 'plan' }
+ | { kind: 'model-fallback'; from: string; to: string }
/** Faint, as a system row with no notice of its own is. */
| { kind: 'aside' }
| {
@@ -69,6 +72,16 @@ export function nativeChatNoticeLook(block: NativeChatTextBlock): NativeChatNoti
if (presentation === AGENT_SESSION_ORCA_STOP_PRESENTATION) {
return { kind: 'line', tone: 'notice' }
}
+ const modelFallback =
+ !block.failure &&
+ !block.orcaStop &&
+ (presentation === undefined || presentation === AGENT_SESSION_TURN_NOTICE_PRESENTATION) &&
+ (block.tone === undefined || block.tone === 'notice')
+ ? readClaudeModelFallbackFrame(block.providerFrame)
+ : null
+ if (modelFallback) {
+ return { kind: 'model-fallback', ...modelFallback }
+ }
// Declared notification kinds select disclosure; prose and nested failures do not.
if (presentation === undefined && !block.failure && !block.orcaStop) {
const frame = block.providerFrame