Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
ebdaa35
Show agent message cards in phone chats
brennanb2025 Oct 29, 2026
64a6b58
test: type the phone markdown mock with its component props
brennanb2025 Oct 29, 2026
0bf4b77
Fix phone agent message cards and sender navigation
brennanb2025 Oct 30, 2026
968e8fa
Open native chats on the phone in place
brennanb2025 Oct 30, 2026
22fc43d
Preserve desktop host and agent when opening chats
brennanb2025 Oct 30, 2026
11fda7e
Separate phone cards from shared chat opening foundation
brennanb2025 Oct 30, 2026
cfe6d28
Align phone cards with shared chat opening foundation
brennanb2025 Oct 30, 2026
4a81009
Show phone agent cards through shared sender opening
brennanb2025 Oct 30, 2026
58c142b
Preserve chat opening and captured lifecycle contracts
brennanb2025 Oct 30, 2026
14e91a8
test: cover sender focus and unconfirmed chat close outcomes
brennanb2025 Oct 30, 2026
11d859f
Merge main into phone chat opening foundation
brennanb2025 Oct 30, 2026
358cce1
test: exercise structured worker CLI lifecycle through runtime socket
brennanb2025 Oct 30, 2026
e6eb836
test: use checked parked mail observation in CLI integration
brennanb2025 Oct 30, 2026
b546f38
test: validate provider notification correlation identities
brennanb2025 Oct 30, 2026
e084110
test: construct checked lifecycle and navigation fixtures
brennanb2025 Oct 30, 2026
3a4662d
Keep cross-program session proofs in their test program
brennanb2025 Oct 30, 2026
76d99ed
Localize mobile chat opening feedback and complete runtime contracts
brennanb2025 Oct 30, 2026
4da1de1
Use the mocked text component identity in History feedback proof
brennanb2025 Oct 30, 2026
b5ddfd2
Temporarily expose grown E2E type diagnostics
brennanb2025 Oct 30, 2026
652d100
Keep E2E timer and fetch fixtures in their runtime domains
brennanb2025 Oct 30, 2026
9c446ec
Reconcile decreased E2E wait pattern counts
brennanb2025 Oct 30, 2026
ffa073e
Preserve live test clocks and expose remaining type diagnostics
brennanb2025 Oct 30, 2026
c856ac8
Keep mobile session data types independent of native views
brennanb2025 Oct 30, 2026
7131086
Complete structured session wire surface fixtures
brennanb2025 Oct 30, 2026
ae47b3d
Merge main to resolve integration conflicts
brennanb2025 Oct 30, 2026
46b9fae
Expose existing grown E2E type diagnostics temporarily
brennanb2025 Oct 30, 2026
278c2da
Merge main to resolve runtime resource import conflict
brennanb2025 Oct 30, 2026
bb37966
Preserve checked wire fixture tab mock signatures
brennanb2025 Oct 30, 2026
61db9e6
Merge main and unify structured chat opening ownership
brennanb2025 Oct 30, 2026
daf2832
Preserve worker redrive when automatic close is refused
brennanb2025 Oct 30, 2026
a24316f
Honor automatic close admission before settlement and retirement
brennanb2025 Oct 30, 2026
8e5e182
test: retain History reveal and close publication race
brennanb2025 Oct 31, 2026
65e349d
Merge main into phone-open-chats preserving session opening contracts
brennanb2025 Oct 31, 2026
a3e7398
Match automation reveal callback to activation result
brennanb2025 Oct 31, 2026
ec55fbe
Align CLI integration fixture with current settings and output
brennanb2025 Oct 31, 2026
2b292be
Prevent retained chats from reopening removed workspaces
brennanb2025 Oct 31, 2026
853b1dd
Import notification types directly from their owner
brennanb2025 Oct 31, 2026
7fd0f09
Unify local removal fences for accepted worktree aliases
brennanb2025 Oct 31, 2026
2dae314
Keep cross-surface authority tests in the combined test project
brennanb2025 Oct 31, 2026
dbf5c01
Merge main into phone open chats
brennanb2025 Oct 31, 2026
ffbcbfa
Initialize coordinator mail test workspace ownership
brennanb2025 Oct 31, 2026
5449eb2
Register the retained automation chat test workspace
brennanb2025 Oct 31, 2026
9174120
Merge commit '24d1d10da8115828779a85b8fadf7874ea484524' into brennanb…
brennanb2025 Oct 31, 2026
8edb6a6
Use checked inputs in worker start failure test
brennanb2025 Oct 31, 2026
7ce89cf
Preserve the automation test repository host literal
brennanb2025 Oct 31, 2026
eb01bf8
Align phone cards with approved chat opening foundation
brennanb2025 Oct 31, 2026
1716dff
Open phone card senders through shared caller navigation
brennanb2025 Oct 31, 2026
c0fd8cf
Carry the phone sender deadline through shared admission
brennanb2025 Oct 31, 2026
33503dd
Finish empty phone card measurement and consumer coverage
brennanb2025 Oct 31, 2026
b0a130a
test(mobile): target native hosts in image-only card regression
brennanb2025 Oct 31, 2026
52c5d56
fix(mobile): fade folded agent message edges
brennanb2025 Oct 31, 2026
7253a4b
Merge main into agent-phone-cards after #36315 landed
brennanb2025 Nov 1, 2026
7efdc3d
Merge main into agent-phone-cards for the max-lines fix (#36852)
brennanb2025 Nov 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions mobile/src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2816,6 +2816,15 @@
"ran_one": "Ran {{count}} subagent",
"ran_other": "Ran {{count}} subagents",
"tokens": "{{value0}} tokens"
},
"agentMessage": {
"gone": "This chat is no longer on this host, so it cannot be reopened here.",
"paneUnavailable": "Agent's pane is no longer available.",
"taskFromCoordinator": "Task from coordinator",
"messageFromCoordinator": "Message from coordinator",
"updateFromWorker": "Update from worker",
"messageFrom": "Message from",
"showMore": "Show more"
}
},
"sourceControl": {
Expand Down
76 changes: 51 additions & 25 deletions mobile/src/session/MobileSessionActiveContent.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { useMemo } from 'react'
import { useCallback, useMemo } from 'react'
import { Animated, View, Text, Pressable, ActivityIndicator } from 'react-native'
import { saveTerminalTextScale } from '../storage/preferences'
import { MobileBrowserPane } from '../browser/MobileBrowserPane'
import { TerminalPaneView } from './TerminalPaneView'
import { MobileNativeChatOverlay } from './MobileNativeChatOverlay'
import { MobileAgentMessageProvider } from './native-chat/transcript/MobileAgentMessageProvider'
import { useMobileAgentMessageNavigation } from './use-mobile-agent-message-navigation'
import { MobileNativeChatDictationPreviewContext } from './native-chat/composer/mobile-native-chat-dictation-preview-context'
import { MobileDictationMeterContext } from './mobile-dictation-meter-context'
import { resolveMobileNativeChatSessionId } from './native-chat/mobile-native-chat-eligibility'
Expand Down Expand Up @@ -106,6 +108,22 @@ export function MobileSessionActiveContent({
() => (client ? { client, worktreeId } : undefined),
[client, worktreeId]
)
const navigateToSender = useCallback(
(senderWorktreeId: string, paneKey: string) => {
const execution = executionHost ? `&executionHost=${encodeURIComponent(executionHost)}` : ''
controller.router.push(
`/h/${encodeURIComponent(hostId)}/session/${encodeURIComponent(senderWorktreeId)}?paneKey=${encodeURIComponent(paneKey)}${execution}`
)
},
[controller.router, hostId, executionHost]
)
const openSender = useMobileAgentMessageNavigation(
client,
navigateToSender,
JSON.stringify([hostId, executionHost, worktreeId, controller.activeSessionTab?.id]),
controller.showToast,
controller
)
const content = showLoadingState ? (
<View style={styles.emptyState}>
<ActivityIndicator size="small" color={colors.textSecondary} />
Expand Down Expand Up @@ -266,30 +284,38 @@ export function MobileSessionActiveContent({
))}
<MobileNativeChatDictationPreviewContext.Provider value={chatDictationPreview}>
<MobileDictationMeterContext.Provider value={dictation.meter}>
<MobileNativeChatOverlay
controller={nativeChatController}
imageSource={nativeChatImageSource}
activeSessionTabId={controller.activeSessionTab?.id}
onOpenFile={handleNativeChatFileTap}
images={nativeChatImages}
structuredComposer={nativeChatStructuredComposer}
onMicPress={dictationEnabled ? handleDictationToggle : undefined}
micActive={dictation.isStarting || dictation.isRecording}
micStarting={dictation.isStarting}
micProcessing={dictation.isProcessing}
dictationMode={dictationMode}
onMicPressIn={handleDictationPressIn}
onMicPressOut={handleDictationPressOut}
inputLockReason={nativeChatOverlayInputLockReason}
sendErrorMessage={nativeChatSendError.message}
onClearSendError={nativeChatSendError.clear}
sendSurfaceId={controller.nativeChatScopeKey ?? ''}
sessionId={resolveMobileNativeChatSessionId(controller.activeSessionTab)}
getSendCompletionGeneration={controller.getSendCompletionGeneration}
keyboardInset={keyboardLift}
// A workspace routed to another server stops with that server, whose name the phone lacks.
hostName={executionHost === undefined && hostProfile ? hostTitle : null}
/>
<MobileAgentMessageProvider
key={JSON.stringify([hostId, executionHost, worktreeId])}
tabs={controller.sessionTabs}
terminals={controller.terminals}
scopeKey={nativeChatImageSource}
open={openSender}
>
<MobileNativeChatOverlay
controller={nativeChatController}
imageSource={nativeChatImageSource}
activeSessionTabId={controller.activeSessionTab?.id}
onOpenFile={handleNativeChatFileTap}
images={nativeChatImages}
structuredComposer={nativeChatStructuredComposer}
onMicPress={dictationEnabled ? handleDictationToggle : undefined}
micActive={dictation.isStarting || dictation.isRecording}
micStarting={dictation.isStarting}
micProcessing={dictation.isProcessing}
dictationMode={dictationMode}
onMicPressIn={handleDictationPressIn}
onMicPressOut={handleDictationPressOut}
inputLockReason={nativeChatOverlayInputLockReason}
sendErrorMessage={nativeChatSendError.message}
onClearSendError={nativeChatSendError.clear}
sendSurfaceId={controller.nativeChatScopeKey ?? ''}
sessionId={resolveMobileNativeChatSessionId(controller.activeSessionTab)}
getSendCompletionGeneration={controller.getSendCompletionGeneration}
keyboardInset={keyboardLift}
// A workspace routed to another server stops with that server, whose name the phone lacks.
hostName={executionHost === undefined && hostProfile ? hostTitle : null}
/>
</MobileAgentMessageProvider>
</MobileDictationMeterContext.Provider>
</MobileNativeChatDictationPreviewContext.Provider>
{toastMessage && (
Expand Down
62 changes: 62 additions & 0 deletions mobile/src/session/mobile-agent-message-navigation-rpc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { z } from 'zod'
import { bindDeferredRpcOperation, defineRpcOperation } from '../transport/rpc-operation'
import { rpcResultVariant } from '../transport/rpc-operation-result-reader'
import type { RpcMethodName } from '../transport/rpc-params-contract'

function senderRead<Method extends RpcMethodName, Schema extends z.ZodType>(
method: Method,
schema: Schema
) {
return bindDeferredRpcOperation(
defineRpcOperation({
name: `chat.sender:${method}`,
method,
acceptance: 'require-result-or-throw-message',
barrier: 'after-caller-barrier',
read: rpcResultVariant('sender', schema)
})
)
}
export const locationRead = senderRead(
'orchestration.partyLocation',
z.object({
location: z
.discriminatedUnion('kind', [
z.object({ kind: z.literal('chat'), sessionId: z.string(), worktreeId: z.string() }),
z.object({ kind: z.literal('terminal'), handle: z.string() })
])
.nullable(),
lost: z.enum(['chat', 'terminal']).optional()
})
)
export const terminalRead = senderRead(
'terminal.focus',
z.object({ focus: z.object({ worktreeId: z.string() }) })
)
const refusal = z.object({ ok: z.literal(false), refusal: z.object({ code: z.string() }) })
export const chatRead = senderRead(
'agentSession.reveal',
z.union([
z.object({
ok: z.literal(true),
sessionId: z.string(),
workspaceId: z.string(),
agent: z.string(),
readable: z.boolean()
}),
refusal
])
)
const tabSchema = z.object({
type: z.string(),
id: z.string(),
sessionId: z.string().optional(),
terminal: z.string().nullable().optional(),
parentTabId: z.string().optional(),
leafId: z.string().optional()
})
export const tabsRead = senderRead('session.tabs.list', z.object({ tabs: z.array(tabSchema) }))
export const allRead = senderRead(
'session.tabs.listAll',
z.object({ snapshots: z.array(z.object({ worktree: z.string(), tabs: z.array(tabSchema) })) })
)
17 changes: 17 additions & 0 deletions mobile/src/session/mobile-agent-message-open-outcome.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { mobileAgentSessionWriteNoticeText } from './agent-session-write-notice-copy'
import { translate } from '../i18n/mobile-i18n'

export function mobileSenderOpenFailure(
outcome: 'chat' | 'terminal' | 'unreachable' | 'unsupported'
): string {
return outcome === 'chat'
? translate(
'chat.agentMessage.gone',
'This chat is no longer on this host, so it cannot be reopened here.'
)
: outcome === 'terminal'
? translate('chat.agentMessage.paneUnavailable', "Agent's pane is no longer available.")
: mobileAgentSessionWriteNoticeText(
outcome === 'unsupported' ? ['unsupported'] : ['unreachable', 'tryAgain']
)
}
4 changes: 3 additions & 1 deletion mobile/src/session/mobile-file-preview-lifecycle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ function previewSession() {
reconcileBufferedDraftsRef: { current: () => {} },
closedTabTombstonesRef: { current: new Map() },
pendingBrowserFocusPageIdRef: { current: null },
activeSessionTabIdRef: { current: keptTab.id }
activeSessionTabIdRef: { current: keptTab.id },
selectedSessionTabIdRef: { current: keptTab.id },
pendingSelectionRef: { current: null }
})
)
readers = useMobileSessionDocumentReaders(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ function mountDocuments(readReply: () => Promise<RpcResponse>) {
closedTabTombstonesRef: { current: new Map() },
activeSessionTabIdRef: { current: null },
selectedSessionTabIdRef: { current: null },
pendingSelectionRef: { current: null },
activeSessionTabTypeRef: { current: null },
activeHandleRef: { current: null },
setActiveSessionTabId: () => {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ const { FRAME, WebView } = await vi.hoisted(async () => {
return { FRAME: frame, WebView: View }
})

vi.mock('expo-router', async () => {
const React = await import('react')
return { useFocusEffect: (effect: () => () => void) => React.useEffect(effect, [effect]) }
})
vi.mock('react-native', () => ({
AppState: { currentState: 'active', addEventListener: () => ({ remove: () => {} }) },
Platform: { OS: 'web' },
View: WebView,
Text: WebView,
Expand Down Expand Up @@ -55,6 +60,7 @@ function controller(
isPendingTerminalRecoveryParked: false,
showEmptyState: false,
terminals: [],
sessionTabs: [],
notifyTerminalFrame,
dictation: { isRecording: false },
nativeChatSendError: { message: null, clear: () => {} }
Expand Down
Loading
Loading