Skip to content

Commit 4ffd83b

Browse files
fix: show agent coordination inline instead of a separate panel
Coordination rows now sit in the existing Worked-for groups with plain labels and one-line previews, empty notes are hidden, delivery badges only show states the user waits on, and the opt-in uses the app's Switch on web and plain copy on mobile. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 9219d1c commit 4ffd83b

24 files changed

Lines changed: 365 additions & 473 deletions

‎apps/mobile/src/features/threads/NewTaskDraftScreen.tsx‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -935,8 +935,8 @@ export function NewTaskDraftScreen(props: {
935935
);
936936
if (communicationLanesOptIn && !selectedProviderSupportsCommunicationLanes) {
937937
Dialog.alert(
938-
"Coordination lanes unavailable",
939-
"The selected provider does not support coordination lanes. Choose a supported provider before sending this task.",
938+
"Agent messages can't be separated",
939+
"The selected provider can't keep agent-to-agent messages in the work log. Choose another provider or turn the switch off.",
940940
);
941941
return null;
942942
}
@@ -1222,9 +1222,8 @@ export function NewTaskDraftScreen(props: {
12221222
{flow.canChooseWorkspace ? workspaceControls : null}
12231223
{supportsCommunicationLanes ? (
12241224
<ComposerInlineControl
1225-
accessibilityLabel="Separate coordination activity"
1226-
accessibilityHint="Compatibility mode for this new thread"
1227-
label={`Coordination lanes: ${communicationLanesOptIn ? "On" : "Off"}`}
1225+
accessibilityLabel="Keep agent-to-agent messages in the work log"
1226+
label={`Agent messages: ${communicationLanesOptIn ? "Work log" : "Chat"}`}
12281227
selected={communicationLanesOptIn}
12291228
disabled={isComposerInteractionLocked}
12301229
showChevron={false}

‎apps/mobile/src/features/threads/ThreadDetailScreen.tsx‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,6 @@ export interface ThreadDetailScreenProps {
223223
readonly feedbackSubmissions: ReadonlyArray<CodexFeedbackSubmission>;
224224
readonly onDismissFeedback: (id: MessageId) => void;
225225
readonly selectedThreadFeed: ReadonlyArray<ThreadFeedEntry>;
226-
readonly selectedCoordinationItems?: ReadonlyArray<
227-
import("@t3tools/contracts").OrchestrationV2ProjectedTurnItem
228-
>;
229-
readonly communicationLanesEnabled?: boolean;
230226
readonly finishedWithoutUserUpdate?: boolean;
231227
readonly pendingHandoff?: HandoffEndpoints | null;
232228
readonly activityRun: ThreadFeedLatestRun | null;
@@ -1297,8 +1293,6 @@ function ThreadDetailBody(props: ThreadDetailScreenProps) {
12971293
threadId={props.selectedThread.id}
12981294
workspaceRoot={props.threadCwd}
12991295
feed={props.selectedThreadFeed}
1300-
coordinationItems={props.selectedCoordinationItems ?? []}
1301-
communicationLanesEnabled={props.communicationLanesEnabled === true}
13021296
finishedWithoutUserUpdate={props.finishedWithoutUserUpdate === true}
13031297
pendingHandoff={props.pendingHandoff}
13041298
worktreeSetup={props.worktreeSetup}

‎apps/mobile/src/features/threads/ThreadFeed.tsx‎

Lines changed: 16 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,8 @@ import {
3636
} from "@t3tools/client-runtime/user-message";
3737
import { canForkProjectedAssistantItem } from "@t3tools/client-runtime/state/thread-workflows";
3838
import {
39-
coordinationItemHeader,
40-
coordinationItemPreview,
4139
FINISHED_WITHOUT_USER_UPDATE_NOTICE,
4240
pendingDeliveryLabel,
43-
coordinationItemText,
4441
} from "@t3tools/client-runtime/state/thread-communication";
4542
import type { ThreadCheckpointSummary } from "@t3tools/client-runtime/state/thread-checkpoints";
4643
import { formatDiffCount } from "@t3tools/client-runtime/diff-count";
@@ -124,7 +121,6 @@ import {
124121
type NativeScrollEvent,
125122
type NativeSyntheticEvent,
126123
Pressable,
127-
ScrollView,
128124
StyleSheet,
129125
type ColorValue,
130126
useWindowDimensions,
@@ -250,7 +246,6 @@ import {
250246
} from "../../state/entities";
251247
import { useThreadSelection } from "../../state/use-thread-selection";
252248
import { useEnvironmentQuery } from "../../state/query";
253-
import { useTurnItemDetail } from "../../state/queries";
254249
import { serverEnvironment } from "../../state/server";
255250
import { composerDocumentAttachmentRecord } from "../../lib/composerContext";
256251
import * as Option from "effect/Option";
@@ -344,8 +339,6 @@ export interface ThreadFeedProps {
344339
readonly threadTitle: string;
345340
readonly workspaceRoot?: string | null;
346341
readonly feed: ReadonlyArray<ThreadFeedEntry>;
347-
readonly coordinationItems?: ReadonlyArray<OrchestrationV2ProjectedTurnItem>;
348-
readonly communicationLanesEnabled?: boolean;
349342
readonly finishedWithoutUserUpdate?: boolean;
350343
readonly pendingHandoff?: HandoffEndpoints | null;
351344
readonly contentPresentation: ThreadContentPresentation;
@@ -2115,17 +2108,6 @@ export const ThreadFeed = memo(function ThreadFeed({
21152108
...props
21162109
}: ThreadFeedProps & { readonly ref?: Ref<ThreadFeedHandle> }) {
21172110
const { listRef, onEndFollowEnabledChange, onHeaderMaterialVisibilityChange } = props;
2118-
const [coordinationOpen, setCoordinationOpen] = useState(false);
2119-
const [coordinationVisibleCount, setCoordinationVisibleCount] = useState(100);
2120-
const [selectedCoordinationId, setSelectedCoordinationId] = useState<string | null>(null);
2121-
const selectedCoordinationItem = coordinationOpen
2122-
? props.coordinationItems?.find(({ item }) => item.id === selectedCoordinationId)
2123-
: undefined;
2124-
const coordinationDetail = useTurnItemDetail(
2125-
selectedCoordinationItem
2126-
? { environmentId: props.environmentId, row: selectedCoordinationItem }
2127-
: null,
2128-
);
21292111
const workflowOpening = useWorkflowOpening(props.environmentId, props.threadId);
21302112
const guestThreadRef = useMemo(
21312113
() => scopeThreadRef(props.environmentId, props.threadId),
@@ -3168,83 +3150,6 @@ export const ThreadFeed = memo(function ThreadFeed({
31683150
return (
31693151
<PresentationSource identifier={fileShareSourceIdentifier} style={{ flex: 1 }}>
31703152
<View className="flex-1" onLayout={handleViewportLayout}>
3171-
{props.communicationLanesEnabled ? (
3172-
<View className="border-b border-border bg-background">
3173-
{props.finishedWithoutUserUpdate ? (
3174-
<Text className="px-5 pt-2 text-xs text-foreground-muted">
3175-
{FINISHED_WITHOUT_USER_UPDATE_NOTICE}
3176-
</Text>
3177-
) : null}
3178-
<Pressable
3179-
accessibilityRole="button"
3180-
accessibilityLabel={`Coordination activity, ${props.coordinationItems?.length ?? 0} items`}
3181-
onPress={() => setCoordinationOpen((open) => !open)}
3182-
className="px-5 py-3"
3183-
>
3184-
<Text className="text-xs font-t3-medium text-foreground-muted">
3185-
Coordination ({props.coordinationItems?.length ?? 0}) · Compatibility mode{" "}
3186-
{coordinationOpen ? "▴" : "▾"}
3187-
</Text>
3188-
</Pressable>
3189-
{coordinationOpen ? (
3190-
<ScrollView
3191-
nestedScrollEnabled
3192-
style={{ maxHeight: 280 }}
3193-
className="border-t border-border px-5 py-2"
3194-
>
3195-
{(props.coordinationItems?.length ?? 0) === 0 ? (
3196-
<Text className="text-xs text-foreground-muted">
3197-
No coordination activity yet.
3198-
</Text>
3199-
) : (
3200-
<>
3201-
{(props.coordinationItems?.length ?? 0) > coordinationVisibleCount ? (
3202-
<Pressable
3203-
accessibilityRole="button"
3204-
onPress={() => setCoordinationVisibleCount((count) => count + 100)}
3205-
className="pb-3"
3206-
>
3207-
<Text className="text-xs text-foreground-muted">
3208-
Show earlier coordination activity
3209-
</Text>
3210-
</Pressable>
3211-
) : null}
3212-
{props.coordinationItems?.slice(-coordinationVisibleCount).map(({ item }) => (
3213-
<View key={item.id} className="mb-3">
3214-
<Pressable
3215-
accessibilityRole="button"
3216-
accessibilityState={{ expanded: selectedCoordinationId === item.id }}
3217-
onPress={() =>
3218-
setSelectedCoordinationId((id) => (id === item.id ? null : item.id))
3219-
}
3220-
>
3221-
<Text className="text-xs font-t3-medium text-foreground-muted">
3222-
{coordinationItemHeader(item)}
3223-
</Text>
3224-
<Text className="text-xs text-foreground">
3225-
{coordinationItemPreview(item)}
3226-
</Text>
3227-
</Pressable>
3228-
{selectedCoordinationId === item.id ? (
3229-
<View className="mt-2 rounded border border-border p-2">
3230-
<Text className="text-xs text-foreground" selectable>
3231-
{coordinationDetail.isPending
3232-
? "Loading full activity…"
3233-
: (coordinationDetail.error ??
3234-
(coordinationDetail.data?.item
3235-
? coordinationItemText(coordinationDetail.data.item)
3236-
: "Full activity unavailable."))}
3237-
</Text>
3238-
</View>
3239-
) : null}
3240-
</View>
3241-
))}
3242-
</>
3243-
)}
3244-
</ScrollView>
3245-
) : null}
3246-
</View>
3247-
) : null}
32483153
<View className="flex-1">
32493154
{/* oxlint-disable-next-line t3code/require-registered-list-scroll -- ThreadFeedScrollView is passed through the iOS-only spread below; the prop rejects undefined. */}
32503155
<KeyboardAwareLegendList
@@ -3357,15 +3262,22 @@ export const ThreadFeed = memo(function ThreadFeed({
33573262
</>
33583263
}
33593264
ListFooterComponent={
3360-
props.pendingHandoff ? (
3361-
<ThreadHandoffDivider
3362-
environmentId={props.environmentId}
3363-
endpoints={props.pendingHandoff}
3364-
iconColor={iconSubtleColor}
3365-
surfaceColor={screenColor}
3366-
label="Context handoff pending"
3367-
/>
3368-
) : null
3265+
<>
3266+
{props.pendingHandoff ? (
3267+
<ThreadHandoffDivider
3268+
environmentId={props.environmentId}
3269+
endpoints={props.pendingHandoff}
3270+
iconColor={iconSubtleColor}
3271+
surfaceColor={screenColor}
3272+
label="Context handoff pending"
3273+
/>
3274+
) : null}
3275+
{props.finishedWithoutUserUpdate ? (
3276+
<Text className="py-2 text-xs text-foreground-muted">
3277+
{FINISHED_WITHOUT_USER_UPDATE_NOTICE}
3278+
</Text>
3279+
) : null}
3280+
</>
33693281
}
33703282
contentContainerStyle={{
33713283
paddingTop: FEED_PADDING_TOP,

‎apps/mobile/src/features/threads/ThreadRouteScreen.tsx‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -983,8 +983,6 @@ function ThreadRouteContent(
983983
feedbackSubmissions={composer.feedbackSubmissions}
984984
onDismissFeedback={composer.dismissFeedback}
985985
selectedThreadFeed={composer.selectedThreadFeed}
986-
selectedCoordinationItems={composer.selectedCoordinationItems}
987-
communicationLanesEnabled={composer.communicationLanesEnabled}
988986
finishedWithoutUserUpdate={composer.selectedThreadFinishedWithoutUserUpdate}
989987
pendingHandoff={composer.pendingHandoff}
990988
activityRun={composer.selectedThreadActivityRun}

‎apps/mobile/src/features/threads/thread-work-log.tsx‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ import {
8989
} from "@t3tools/client-runtime/work-log/presentation";
9090
import { resolveWorkGroupScrollAnchor } from "@t3tools/client-runtime/work-log/scroll-anchor";
9191
import { notificationChildThreadId } from "@t3tools/client-runtime/state/thread-execution";
92+
import { coordinationNotificationWithDetail } from "@t3tools/client-runtime/state/thread-communication";
9293
import type { MarkdownImageRenderer } from "../../native/SelectableMarkdownText";
9394
import type { FilePreviewSource } from "../../components/FilePreviewModal";
9495
import { FilePreviewGallery } from "../../components/FilePreviewGallery";
@@ -974,16 +975,19 @@ const ThreadWorkLogRow = function ThreadWorkLogRow(
974975
call && shownItem.type === "command_execution" && shownItem.exitCode
975976
? shownItem.exitCode
976977
: null;
978+
const coordinationItem = coordinationNotificationWithDetail(row.projectedItem.item, fetchedItem);
977979
const fullDetail =
978980
expanded && !reasoning && !call
979-
? fetchedItem && !isRead
980-
? formatItemFullDetail(row.projectedItem, fetchedItem)
981-
: row.getFullDetail()
981+
? coordinationItem?.type === "notification"
982+
? (coordinationItem.detail ?? null)
983+
: fetchedItem && !isRead
984+
? formatItemFullDetail(row.projectedItem, fetchedItem)
985+
: row.getFullDetail()
982986
: null;
983987
const outputImages = expanded && fetchedItem ? turnItemOutputImages(fetchedItem) : [];
984988
const viewedImagePath = workEntryViewedImagePath(row.workEntry);
985989
const fetchedOutput =
986-
!expanded || streamsOutput
990+
!expanded || streamsOutput || coordinationItem
987991
? null
988992
: shownItem.type === "file_search" || shownItem.type === "web_search"
989993
? turnItemOutputText(shownItem)

‎apps/mobile/src/lib/threadActivity.test.ts‎

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ function assistantMessage(updatedAt = "2026-06-20T00:00:03.000Z") {
283283
}
284284

285285
describe("buildThreadFeed", () => {
286-
it("keeps unaddressed and internal messages out of enabled human chat", () => {
286+
it("keeps unaddressed and internal messages in the work log of enabled threads", () => {
287287
const user = projected(
288288
{
289289
...userMessage(),
@@ -308,21 +308,23 @@ describe("buildThreadFeed", () => {
308308
);
309309
const rows = [user, internal, unclassified];
310310

311+
const enabledFeed = buildThreadFeed(rows, {
312+
communicationLanesEnabled: true,
313+
anchoredMessages: [
314+
{
315+
id: MessageId.make("local-assistant"),
316+
role: "assistant",
317+
text: "Unaddressed local output",
318+
streaming: false,
319+
createdAt: "2026-06-20T00:00:00.000Z",
320+
updatedAt: "2026-06-20T00:00:00.000Z",
321+
},
322+
],
323+
});
311324
expect(
312-
buildThreadFeed(rows, {
313-
communicationLanesEnabled: true,
314-
anchoredMessages: [
315-
{
316-
id: MessageId.make("local-assistant"),
317-
role: "assistant",
318-
text: "Unaddressed local output",
319-
streaming: false,
320-
createdAt: "2026-06-20T00:00:00.000Z",
321-
updatedAt: "2026-06-20T00:00:00.000Z",
322-
},
323-
],
324-
}).map((entry) => entry.id),
325+
enabledFeed.filter((entry) => entry.type === "message").map((entry) => entry.id),
325326
).toEqual([MessageId.make("message-user")]);
327+
expect(enabledFeed.some((entry) => entry.type !== "message")).toBe(true);
326328
expect(buildThreadFeed(rows).filter((entry) => entry.type === "message")).toHaveLength(3);
327329
});
328330

0 commit comments

Comments
 (0)