= new Set(LATEST_ACTION_ITEM_TYPES);
-
-/**
- * A secret or link card is the child's only record of waiting on you, so its parent must hear it.
- * A finished tool moves the child's latest action; streaming tool output does not.
- */
-const changesChildShell = (item: { readonly type: string; readonly status: string }) =>
- item.type === "secret_request" ||
- item.type === "link_request" ||
- (LATEST_ACTION_TYPES.has(item.type) && item.status !== "running" && item.status !== "pending");
-
/** Shell updates refetch an aggregate; drop transcript bodies before retaining an event. */
export function toShellApplicationEvent(stored: ApplicationStoredEvent): ShellApplicationEvent {
return "aggregateKind" in stored
diff --git a/apps/server/src/orchestration-v2/latestAction.test.ts b/apps/server/src/orchestration-v2/latestAction.test.ts
deleted file mode 100644
index 3e50498db922c..0000000000000
--- a/apps/server/src/orchestration-v2/latestAction.test.ts
+++ /dev/null
@@ -1,75 +0,0 @@
-import {
- NodeId,
- RunId,
- ThreadId,
- TurnItemId,
- type OrchestrationV2TurnItem,
-} from "@t3tools/contracts";
-import { describe, expect, it } from "@effect/vitest";
-import * as DateTime from "effect/DateTime";
-
-import { latestActionFromTurnItem } from "./latestAction.ts";
-
-const at = DateTime.makeUnsafe("2026-11-10T10:00:00.000Z");
-const base = {
- id: TurnItemId.make("item:latest-action"),
- threadId: ThreadId.make("thread:latest-action"),
- runId: RunId.make("run:latest-action"),
- nodeId: NodeId.make("node:latest-action"),
- providerThreadId: null,
- providerTurnId: null,
- nativeItemRef: null,
- parentItemId: null,
- ordinal: 1,
- status: "running",
- title: null,
- startedAt: at,
- completedAt: null,
- updatedAt: at,
-} as const;
-
-describe("latestActionFromTurnItem", () => {
- it.each([
- [{ type: "file_search", pattern: "useAuth" }, { summary: "Searched useAuth" }],
- [{ type: "web_search", patterns: ["github oauth"] }, { summary: "Searched github oauth" }],
- [
- { type: "dynamic_tool", toolName: "Read", input: { file_path: "src/auth/session.ts" } },
- { summary: "Read src/auth/session.ts" },
- ],
- [
- { type: "dynamic_tool", toolName: "Grep", input: { pattern: "session", path: "src" } },
- { summary: "Searched session in src" },
- ],
- [
- { type: "dynamic_tool", toolName: "mcp__t3-code__request_secret", input: {} },
- { summary: "Asked for a secret" },
- ],
- [
- {
- type: "dynamic_tool",
- toolName: "mcp__t3-code__delegate_task",
- input: {},
- status: "failed",
- },
- { summary: "Failed to delegate a child task" },
- ],
- [
- { type: "dynamic_tool", toolName: "mcp__linear__create_issue", input: {} },
- { summary: "create_issue" },
- ],
- [
- {
- type: "dynamic_tool",
- toolName: "mcp__linear__create_issue",
- title: "mcp__linear__create_issue",
- input: {},
- },
- { summary: "create_issue" },
- ],
- [{ type: "reasoning", text: "Thinking", streaming: false }, null],
- [{ type: "assistant_message", messageId: "message:x", text: "Done", streaming: false }, null],
- ] as const)("labels %o", (item, expected) => {
- const action = latestActionFromTurnItem({ ...base, ...item } as OrchestrationV2TurnItem);
- expect(action).toEqual(expected === null ? null : { ...expected, at });
- });
-});
diff --git a/apps/server/src/orchestration-v2/latestAction.ts b/apps/server/src/orchestration-v2/latestAction.ts
deleted file mode 100644
index e6b345f0466f9..0000000000000
--- a/apps/server/src/orchestration-v2/latestAction.ts
+++ /dev/null
@@ -1,91 +0,0 @@
-import type {
- OrchestrationV2LatestActionSummary,
- OrchestrationV2TurnItem,
-} from "@t3tools/contracts";
-import {
- deriveToolActivityPresentation,
- dynamicToolTitle,
- type ToolActivityPresentation,
-} from "@t3tools/shared/toolActivity";
-import { resolveT3McpToolDefinition } from "@t3tools/shared/t3McpToolPresentation";
-
-/** Keep in sync with the latest-tool index and the shell row query in ProjectionStore. */
-export const LATEST_ACTION_ITEM_TYPES = [
- "command_execution",
- "file_change",
- "file_search",
- "web_search",
- "dynamic_tool",
-] as const;
-
-const LATEST_ACTION_TEXT_LIMIT = 120;
-
-const clip = (text: string) =>
- text.length > LATEST_ACTION_TEXT_LIMIT
- ? `${text.slice(0, LATEST_ACTION_TEXT_LIMIT - 1).trimEnd()}…`
- : text;
-
-const withoutMcpPrefix = (name: string) => name.replace(/^mcp__.+?__(?=.)/, "");
-
-function presentation(item: OrchestrationV2TurnItem): ToolActivityPresentation | null {
- switch (item.type) {
- case "command_execution":
- return deriveToolActivityPresentation({
- itemType: "command_execution",
- title: item.title,
- data: { command: item.input },
- });
- case "file_change":
- return deriveToolActivityPresentation({
- itemType: "file_change",
- title: item.title,
- data: { path: item.fileName },
- });
- case "file_search":
- return deriveToolActivityPresentation({
- title: item.title,
- data: { kind: "search", pattern: item.pattern },
- fallbackSummary: "Searched files",
- });
- case "web_search":
- return deriveToolActivityPresentation({
- itemType: "web_search",
- title: item.title,
- data: { query: item.patterns?.join(", ") },
- });
- case "dynamic_tool": {
- const t3Tool = resolveT3McpToolDefinition(item.toolName, item.input);
- if (t3Tool !== null) {
- const [action, , completed, detail] = t3Tool.labels;
- return {
- summary:
- item.status === "failed"
- ? `Failed to ${action.toLowerCase()} ${detail}`
- : `${completed} ${detail}`,
- };
- }
- const title = dynamicToolTitle(item.toolName, item.input, item.title) ?? item.title;
- return deriveToolActivityPresentation({
- itemType: "dynamic_tool_call",
- title: title && withoutMcpPrefix(title),
- data: { toolName: item.toolName ?? undefined, input: item.input },
- fallbackSummary: item.toolName && withoutMcpPrefix(item.toolName),
- });
- }
- default:
- return null;
- }
-}
-
-export function latestActionFromTurnItem(
- item: OrchestrationV2TurnItem | null,
-): OrchestrationV2LatestActionSummary | null {
- if (item === null) return null;
- const presented = presentation(item);
- if (presented === null) return null;
- return {
- summary: clip(presented.summary),
- ...(presented.detail ? { detail: clip(presented.detail) } : {}),
- at: item.startedAt ?? item.updatedAt,
- };
-}
diff --git a/apps/server/src/peer/RemoteDelegation.ts b/apps/server/src/peer/RemoteDelegation.ts
index 47ff4efdaac5b..99dc91be087ee 100644
--- a/apps/server/src/peer/RemoteDelegation.ts
+++ b/apps/server/src/peer/RemoteDelegation.ts
@@ -390,7 +390,6 @@ const make = Effect.gen(function* () {
parentNodeId,
task,
...(input.title === undefined ? {} : { title: input.title }),
- ...(input.group === undefined ? {} : { group: input.group }),
// The driver runs there; this side only labels the task with it.
driver: ProviderDriverKind.make("remote"),
modelSelection: launched.modelSelection,
diff --git a/apps/server/src/persistence/ForkMigrations/004_LatestToolItemIndex.ts b/apps/server/src/persistence/ForkMigrations/004_LatestToolItemIndex.ts
index 00f4dc96f3ac6..d40d5d453d956 100644
--- a/apps/server/src/persistence/ForkMigrations/004_LatestToolItemIndex.ts
+++ b/apps/server/src/persistence/ForkMigrations/004_LatestToolItemIndex.ts
@@ -4,7 +4,7 @@ import * as SqlClient from "effect/sql/SqlClient";
export default Effect.gen(function* () {
const sql = yield* SqlClient.SqlClient;
- // Keep this predicate aligned with the shell's latest tool action lookup in ProjectionStore.
+ // Unused since the shell's latest tool action was removed; kept so the migration history stays intact.
yield* sql`
CREATE INDEX orchestration_v2_projection_turn_items_latest_tool_idx
ON orchestration_v2_projection_turn_items(thread_id, ordinal DESC, turn_item_id DESC)
diff --git a/apps/server/src/provider/agentContextBudget.json b/apps/server/src/provider/agentContextBudget.json
index 92e1f377bb765..625465cbaed41 100644
--- a/apps/server/src/provider/agentContextBudget.json
+++ b/apps/server/src/provider/agentContextBudget.json
@@ -1,5 +1,5 @@
{
"claudeSystemAppendBytes": 5930,
"codexAdditionalContextBytes": 7324,
- "mcpToolListJsonBytes": 50013
+ "mcpToolListJsonBytes": 49938
}
diff --git a/apps/web/src/components/ChatView.logic.test.ts b/apps/web/src/components/ChatView.logic.test.ts
index d1c14c6870447..579e8348b46a0 100644
--- a/apps/web/src/components/ChatView.logic.test.ts
+++ b/apps/web/src/components/ChatView.logic.test.ts
@@ -1640,6 +1640,7 @@ describe("waitingMessageCanResend", () => {
waitingDraftId: "draft-1",
draftId: "draft-1",
isLocalDraftThread: true,
+ onSandbox: true,
canOperateThread: true,
isSendBusy: false,
isRevertingCheckpoint: false,
@@ -1657,8 +1658,11 @@ describe("waitingMessageCanResend", () => {
// A sandbox paired a moment ago can show its project before its session grants this app any
// scope; a send then would be dropped while the message no longer waits.
- it("waits until the draft's machine lets this app start threads", () => {
+ it("waits until the draft's sandbox lets this app start threads", () => {
expect(waitingMessageCanResend({ ...ready, canOperateThread: false })).toBe(false);
+ expect(waitingMessageCanResend({ ...ready, onSandbox: false, canOperateThread: false })).toBe(
+ true,
+ );
});
it("waits only for its own draft", () => {
diff --git a/apps/web/src/components/ChatView.logic.ts b/apps/web/src/components/ChatView.logic.ts
index 6d8b9db71015c..eeb3282b86c50 100644
--- a/apps/web/src/components/ChatView.logic.ts
+++ b/apps/web/src/components/ChatView.logic.ts
@@ -1595,15 +1595,15 @@ export function isThreadEnvironmentLocked(input: {
}
/**
- * Whether a message held back while its draft changed machines (worked locally, or handed off to
- * a sandbox) can be sent now. A send that fails a gate here is dropped, not retried, so this waits
- * for every condition the send itself checks, including the operate scope on the draft's machine:
- * a sandbox paired a moment ago can report its project before its session has loaded.
+ * Whether a message held back while its draft switched to working locally can be sent now. A send
+ * that fails a gate here is dropped, not retried. A draft on a sandbox also waits for the operate
+ * scope: a sandbox paired a moment ago can report its project before its session has loaded.
*/
export function waitingMessageCanResend(input: {
readonly waitingDraftId: string | null;
readonly draftId: string | null;
readonly isLocalDraftThread: boolean;
+ readonly onSandbox: boolean;
readonly canOperateThread: boolean;
readonly isSendBusy: boolean;
readonly isRevertingCheckpoint: boolean;
@@ -1618,7 +1618,7 @@ export function waitingMessageCanResend(input: {
input.waitingDraftId !== null &&
input.waitingDraftId === input.draftId &&
input.isLocalDraftThread &&
- input.canOperateThread &&
+ (!input.onSandbox || input.canOperateThread) &&
!input.isSendBusy &&
!input.isRevertingCheckpoint &&
!input.threadDetailLoading &&
diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx
index d6f25e15d3237..f3138e3e5e818 100644
--- a/apps/web/src/components/ChatView.tsx
+++ b/apps/web/src/components/ChatView.tsx
@@ -215,6 +215,7 @@ import { stackedThreadToast, toastManager } from "./ui/toast";
import {
useSandboxChatAliases,
useSandboxMirrorModelSource,
+ useSandboxEnvironmentIds,
useSandboxlessBridgeThread,
useThreadSandbox,
} from "../state/sandboxes";
@@ -1056,6 +1057,7 @@ export default function ChatView(props: ChatViewProps) {
const activeThreadRef = useActiveThreadRef(activeThread);
const activeThreadKey = activeThreadRef ? scopedThreadKey(activeThreadRef) : null;
const activeSandbox = useThreadSandbox(activeThreadRef);
+ const sandboxEnvironmentIds = useSandboxEnvironmentIds();
// The host thread the sandbox bridge drives: its own server stays up, and the host resumes the
// sandbox when a turn starts, so it sends like any other thread.
const activeSandboxOnHost =
@@ -3391,6 +3393,7 @@ export default function ChatView(props: ChatViewProps) {
waitingDraftId: workLocallyResendDraftId,
draftId,
isLocalDraftThread,
+ onSandbox: sandboxEnvironmentIds.has(environmentId),
canOperateThread,
isSendBusy,
isRevertingCheckpoint,
diff --git a/apps/web/src/components/chat/ChildThreadApprovals.browser.test.tsx b/apps/web/src/components/chat/ChildThreadApprovals.browser.test.tsx
index fd0ae87a20ec7..ef136a1760137 100644
--- a/apps/web/src/components/chat/ChildThreadApprovals.browser.test.tsx
+++ b/apps/web/src/components/chat/ChildThreadApprovals.browser.test.tsx
@@ -10,10 +10,8 @@ const state = vi.hoisted(() => ({ respond: vi.fn(), approvalsAtom: null as unkno
vi.mock("../../state/session", () => ({ useEnvironmentScope: () => true }));
vi.mock("../../state/use-atom-command", () => ({ useAtomCommand: () => state.respond }));
-vi.mock("./SecretRequestCard", () => ({ SecretRequestCard: () => null }));
vi.mock("../../state/threads", () => ({
childThreadApprovalsAtom: () => state.approvalsAtom,
- childThreadSecretRequestsAtom: () => Atom.make([]),
threadEnvironment: { respondToApproval: {} },
}));
diff --git a/apps/web/src/components/chat/ChildThreadApprovals.tsx b/apps/web/src/components/chat/ChildThreadApprovals.tsx
index 1c69fba07f444..5a7cb3074b4a6 100644
--- a/apps/web/src/components/chat/ChildThreadApprovals.tsx
+++ b/apps/web/src/components/chat/ChildThreadApprovals.tsx
@@ -8,14 +8,9 @@ import {
} from "@t3tools/client-runtime/state/runtime";
import { useState } from "react";
import { useEnvironmentScope } from "../../state/session";
-import {
- childThreadApprovalsAtom,
- childThreadSecretRequestsAtom,
- threadEnvironment,
-} from "../../state/threads";
+import { childThreadApprovalsAtom, threadEnvironment } from "../../state/threads";
import { useAtomCommand } from "../../state/use-atom-command";
import { ComposerPendingApprovalActions } from "./ComposerPendingApprovalActions";
-import { SecretRequestCard } from "./SecretRequestCard";
function ChildApproval({ entry }: { entry: ChildThreadApproval }) {
const canRespond = useEnvironmentScope(entry.thread.environmentId, AuthOrchestrationOperateScope);
@@ -82,18 +77,9 @@ function ChildApproval({ entry }: { entry: ChildThreadApproval }) {
export function ChildThreadApprovals({ threadRef }: { threadRef: ScopedThreadRef | null }) {
const approvals = useAtomValue(childThreadApprovalsAtom(threadRef));
- const secrets = useAtomValue(childThreadSecretRequestsAtom(threadRef));
- if (approvals.length === 0 && secrets.length === 0) return null;
+ if (approvals.length === 0) return null;
return (
- {secrets.map((entry) => (
-
- ))}
{approvals.map((entry) => (
"credentials-changed" as const),
),
networkPathChanges,
- computerWakeups,
],
{ concurrency: "unbounded" },
),
diff --git a/apps/web/src/connection/suspendWakeups.test.ts b/apps/web/src/connection/suspendWakeups.test.ts
deleted file mode 100644
index 876d87f0f8548..0000000000000
--- a/apps/web/src/connection/suspendWakeups.test.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { describe, expect, it } from "vite-plus/test";
-
-import { sleptBetweenTicks } from "./suspendWakeups.ts";
-
-describe("sleptBetweenTicks", () => {
- it("tells a computer's sleep from a busy page", () => {
- expect(sleptBetweenTicks(0, 5_000, true)).toBe(false);
- // A main thread stalled for a while is not a sleep.
- expect(sleptBetweenTicks(0, 20_000, true)).toBe(false);
- expect(sleptBetweenTicks(0, 30_000, true)).toBe(true);
- expect(sleptBetweenTicks(0, 8 * 60 * 60_000, true)).toBe(true);
- });
-
- it("ignores a hidden page, whose timers the browser throttles to once a minute", () => {
- expect(sleptBetweenTicks(0, 60_000, false)).toBe(false);
- });
-});
diff --git a/apps/web/src/connection/suspendWakeups.ts b/apps/web/src/connection/suspendWakeups.ts
deleted file mode 100644
index 946c35189b6da..0000000000000
--- a/apps/web/src/connection/suspendWakeups.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-import * as Clock from "effect/Clock";
-import * as Effect from "effect/Effect";
-import * as Stream from "effect/Stream";
-
-const TICK = "5 seconds";
-// Well past a busy main thread's stall, well short of a nap.
-const SUSPENDED_AFTER_MS = 30_000;
-
-/**
- * True when a timer fired so late that the computer must have slept in between. A hidden page's
- * timers are throttled to once a minute, so only a visible page's late timer counts.
- */
-export const sleptBetweenTicks = (previousMs: number, nowMs: number, visible: boolean): boolean =>
- visible && nowMs - previousMs >= SUSPENDED_AFTER_MS;
-
-const pageVisible = Effect.sync(
- () => typeof document === "undefined" || document.visibilityState === "visible",
-);
-
-/**
- * Fires when the computer wakes from sleep, which no page event reports: timers stand still
- * while it sleeps and the wall clock does not. Its sockets died silently meanwhile, and their
- * piled-up retry backoff must not keep a finished run showing as working.
- */
-export const computerWakeups: Stream.Stream<"application-active"> = Stream.unwrap(
- Effect.gen(function* () {
- let previous = yield* Clock.currentTimeMillis;
- return Stream.tick(TICK).pipe(
- Stream.mapEffect(() => Effect.all([Clock.currentTimeMillis, pageVisible])),
- Stream.filter(([now, visible]) => {
- const slept = sleptBetweenTicks(previous, now, visible);
- previous = now;
- return slept;
- }),
- Stream.map(() => "application-active" as const),
- );
- }),
-);
diff --git a/apps/web/src/state/threads.ts b/apps/web/src/state/threads.ts
index f4d554f473817..c8d2ffcbc8b7b 100644
--- a/apps/web/src/state/threads.ts
+++ b/apps/web/src/state/threads.ts
@@ -1,7 +1,4 @@
-import {
- createChildThreadApprovalsAtom,
- createChildThreadSecretRequestsAtom,
-} from "@t3tools/client-runtime/state/thread-requests";
+import { createChildThreadApprovalsAtom } from "@t3tools/client-runtime/state/thread-requests";
import { useAtomValue } from "@effect/atom-react";
import { createSandboxStartQueueAtoms } from "@t3tools/client-runtime/state/sandbox-mirror";
import { enabledEnvironmentIds } from "@t3tools/client-runtime/state/connections";
@@ -61,10 +58,6 @@ export const childThreadApprovalsAtom = createChildThreadApprovalsAtom({
childThreadInputsAtom: environmentThreadShells.childThreadInputsAtom,
pendingRequestsAtom: environmentThreadDetails.pendingRequestsAtom,
});
-export const childThreadSecretRequestsAtom = createChildThreadSecretRequestsAtom({
- childThreadInputsAtom: environmentThreadShells.childThreadInputsAtom,
- visibleTurnItemsAtom: environmentThreadDetails.visibleTurnItemsAtom,
-});
const EMPTY_THREAD_STATE_ATOM = Atom.make(AsyncResult.success(EMPTY_ENVIRONMENT_THREAD_STATE)).pipe(
Atom.withLabel("web-environment-thread:empty"),
diff --git a/packages/client-runtime/src/state/threadRequests.test.ts b/packages/client-runtime/src/state/threadRequests.test.ts
index f591c94346ada..f6eb4e1f76cb1 100644
--- a/packages/client-runtime/src/state/threadRequests.test.ts
+++ b/packages/client-runtime/src/state/threadRequests.test.ts
@@ -20,7 +20,6 @@ import { v2Now, v2Projection, v2ThreadShell } from "./orchestrationV2TestFixture
import {
createQuestionHistoryProjector,
createChildThreadApprovalsAtom,
- createChildThreadSecretRequestsAtom,
type PendingThreadRequests,
derivePendingThreadRequests,
declinePendingApprovals,
@@ -640,56 +639,6 @@ it("loads only child approvals and retains their destination across environments
);
expect(registry.get(approvalsAtom(parent))).toEqual([]);
expect(readDetails).not.toHaveBeenCalled();
-
- // The same children now wait on a secret: only their waiting cards reach the parent.
- const card = (id: string, secretStatus: "pending" | "saved") => ({
- position: 0,
- visibility: "local" as const,
- sourceThreadId: childId,
- sourceItemId: TurnItemId.make(id),
- item: {
- id: TurnItemId.make(id),
- threadId: childId,
- runId: null,
- nodeId,
- providerThreadId: null,
- providerTurnId: null,
- nativeItemRef: null,
- parentItemId: null,
- ordinal: 1,
- status: secretStatus === "pending" ? ("waiting" as const) : ("completed" as const),
- title: "GITHUB_CLIENT_SECRET",
- startedAt: v2Now,
- completedAt: null,
- updatedAt: v2Now,
- type: "secret_request" as const,
- label: "GITHUB_CLIENT_SECRET",
- reason: "To test the real OAuth flow",
- secretStatus,
- },
- });
- const items = Atom.family((key: string) =>
- Atom.make(
- key.startsWith(local) ? [card("saved", "saved"), card("asking", "pending")] : [],
- ),
- );
- const readItems = vi.fn((ref: ScopedThreadRef) => items(threadKey(ref)));
- const secretsAtom = createChildThreadSecretRequestsAtom({
- childThreadInputsAtom: () => children,
- visibleTurnItemsAtom: readItems,
- });
- const unmountSecrets = registry.mount(secretsAtom(parent));
- expect(
- registry.get(secretsAtom(parent)).map((entry) => [entry.thread.environmentId, entry.item.id]),
- ).toEqual([[local, "asking"]]);
- readItems.mockClear();
- registry.set(
- children,
- registry.get(children).map((child) => ({ ...child, hasPendingUserInput: false })),
- );
- expect(registry.get(secretsAtom(parent))).toEqual([]);
- expect(readItems).not.toHaveBeenCalled();
- unmountSecrets();
unmount();
registry.dispose();
});
diff --git a/packages/client-runtime/src/state/threadRequests.ts b/packages/client-runtime/src/state/threadRequests.ts
index b9e67538d01ca..99fd12ba5b360 100644
--- a/packages/client-runtime/src/state/threadRequests.ts
+++ b/packages/client-runtime/src/state/threadRequests.ts
@@ -3,7 +3,6 @@ import type {
ScopedThreadRef,
ThreadId,
OrchestrationV2ThreadProjection,
- OrchestrationV2TurnItem,
OrchestrationV2RuntimeRequest,
OrchestrationV2UserInputQuestion,
ProviderApprovalFullAccessOverride,
@@ -404,53 +403,3 @@ export function createChildThreadApprovalsAtom(input: {
const empty = Atom.make>([]);
return (ref: ScopedThreadRef | null) => (ref === null ? empty : family(threadKey(ref)));
}
-
-export interface ChildThreadSecretRequest {
- readonly thread: ScopedThreadRef;
- readonly title: string;
- readonly item: Extract;
-}
-
-/** Waiting secret cards of the child threads under `ref`, so the parent can answer them. */
-export function createChildThreadSecretRequestsAtom(input: {
- readonly childThreadInputsAtom: (
- ref: ScopedThreadRef,
- ) => Atom.Atom>;
- readonly visibleTurnItemsAtom: (
- ref: ScopedThreadRef,
- ) => Atom.Atom;
-}) {
- const family = Atom.family((key: string) => {
- let previous: ReadonlyArray = [];
- return Atom.make((get) => {
- const next = get(input.childThreadInputsAtom(parseThreadKey(key))).flatMap((child) => {
- if (!child.hasPendingUserInput) return [];
- const thread = { environmentId: child.environmentId, threadId: child.id };
- // Only children waiting on input need a detail subscription.
- return get(input.visibleTurnItemsAtom(thread)).flatMap(({ item, visibility }) =>
- item.type === "secret_request" &&
- item.secretStatus === "pending" &&
- visibility === "local"
- ? [{ thread, title: child.title, item }]
- : [],
- );
- });
- if (
- next.length === previous.length &&
- next.every((entry, index) => {
- const old = previous[index]!;
- return (
- old.item === entry.item &&
- old.title === entry.title &&
- threadKey(old.thread) === threadKey(entry.thread)
- );
- })
- )
- return previous;
- previous = next;
- return next;
- });
- });
- const empty = Atom.make>([]);
- return (ref: ScopedThreadRef | null) => (ref === null ? empty : family(threadKey(ref)));
-}
diff --git a/packages/client-runtime/src/state/threadShell.test.ts b/packages/client-runtime/src/state/threadShell.test.ts
index b7d086889715c..d18a3e3adae1c 100644
--- a/packages/client-runtime/src/state/threadShell.test.ts
+++ b/packages/client-runtime/src/state/threadShell.test.ts
@@ -619,16 +619,7 @@ describe("v2 thread shell lists", () => {
const dispose = harness.registry.mount(quietAtom);
try {
const first = harness.registry.get(quietAtom);
- setThread(
- {
- ...running,
- updatedAt: at(1),
- itemCount: 4,
- visibleItemCount: 3,
- latestAction: { summary: "Ran command", detail: "pnpm test", at: at(1) },
- },
- 2,
- );
+ setThread({ ...running, updatedAt: at(1), itemCount: 4, visibleItemCount: 3 }, 2);
expect(harness.registry.get(quietAtom)).toBe(first);
expect(harness.registry.get(harness.threads.threadShellAtom(ref))?.itemCount).toBe(4);
diff --git a/packages/client-runtime/src/state/threadShell.ts b/packages/client-runtime/src/state/threadShell.ts
index 183d788a78b02..4d76051c47370 100644
--- a/packages/client-runtime/src/state/threadShell.ts
+++ b/packages/client-runtime/src/state/threadShell.ts
@@ -174,8 +174,8 @@ export function childThreadInputsTitle(
const sameWireThreadShell = Schema.toEquivalence(OrchestrationV2ThreadShell);
-// While a run streams, the server bumps the shell's timestamps, item counts, latest
-// message and latest action several times a second. Only the zero crossing of the counts
+// While a run streams, the server bumps the shell's timestamps, item counts and
+// latest message several times a second. Only the zero crossing of the counts
// says anything (whether the thread has started). Once the run stops every
// field counts again, so snooze wakes and failure times read the current value.
function sameApartFromStreaming(
@@ -201,8 +201,6 @@ function sameApartFromStreaming(
itemCount: after.itemCount,
visibleItemCount: after.visibleItemCount,
latestVisibleMessage: after.latestVisibleMessage,
- // Optional on the wire: an explicit undefined would not equal an absent key.
- ...("latestAction" in after ? { latestAction: after.latestAction } : {}),
},
after,
)
diff --git a/packages/contracts/src/orchestrationV2.ts b/packages/contracts/src/orchestrationV2.ts
index 0bda169cb0a2e..378e0e0a67c96 100644
--- a/packages/contracts/src/orchestrationV2.ts
+++ b/packages/contracts/src/orchestrationV2.ts
@@ -921,9 +921,6 @@ export const OrchestrationV2RemoteTaskChild = Schema.Struct({
});
export type OrchestrationV2RemoteTaskChild = typeof OrchestrationV2RemoteTaskChild.Type;
-/** A coordinator-chosen work stream, such as "UI" or "Backend", that clients group agents by. */
-export const SubagentGroup = TrimmedNonEmptyString.check(Schema.isMaxLength(40));
-
export const OrchestrationV2Subagent = Schema.Struct({
id: NodeId,
threadId: ThreadId,
@@ -957,7 +954,6 @@ export const OrchestrationV2Subagent = Schema.Struct({
]),
progress: Schema.optional(Schema.String),
workflow: Schema.optional(OrchestrationV2SubagentWorkflow),
- group: Schema.optional(SubagentGroup),
result: Schema.NullOr(Schema.String),
startedAt: Schema.NullOr(Schema.DateTimeUtc),
completedAt: Schema.NullOr(Schema.DateTimeUtc),
@@ -2229,14 +2225,6 @@ export const OrchestrationV2LatestVisibleMessageSummary = Schema.Struct({
export type OrchestrationV2LatestVisibleMessageSummary =
typeof OrchestrationV2LatestVisibleMessageSummary.Type;
-/** The thread's most recent tool step, labeled as the chat's work log labels it. */
-export const OrchestrationV2LatestActionSummary = Schema.Struct({
- summary: Schema.String,
- detail: Schema.optional(Schema.String),
- at: Schema.DateTimeUtc,
-});
-export type OrchestrationV2LatestActionSummary = typeof OrchestrationV2LatestActionSummary.Type;
-
export const OrchestrationV2ThreadShell = Schema.Struct({
...OrchestrationV2CreationFields,
id: ThreadId,
@@ -2279,8 +2267,6 @@ export const OrchestrationV2ThreadShell = Schema.Struct({
/** Guest messages waiting for the owner to send or dismiss. Absent from older servers. */
pendingGuestMessageCount: Schema.optional(NonNegativeInt),
latestVisibleMessage: Schema.NullOr(OrchestrationV2LatestVisibleMessageSummary),
- /** Absent from older servers. */
- latestAction: Schema.optional(Schema.NullOr(OrchestrationV2LatestActionSummary)),
latestUserMessageAt: Schema.NullOr(Schema.DateTimeUtc),
/** Excludes wakes and agent messages that advance latestUserMessageAt through the user role. */
latestUserAuthoredMessageAt: Schema.optional(Schema.NullOr(Schema.DateTimeUtc)),
@@ -2918,10 +2904,6 @@ export const OrchestrationV2LatestVisibleMessageSummaryJson =
export type OrchestrationV2LatestVisibleMessageSummaryJson =
typeof OrchestrationV2LatestVisibleMessageSummaryJson.Type;
-export const OrchestrationV2LatestActionSummaryJson = OrchestrationV2LatestActionSummary.mapFields(
- (fields) => ({ ...fields, at: Schema.DateTimeUtcFromString }),
-);
-
export const OrchestrationV2ThreadShellJson = OrchestrationV2ThreadShell.mapFields((fields) => ({
...fields,
latestRunRequestedAt: Schema.optional(Schema.NullOr(Schema.DateTimeUtcFromString)),
@@ -2930,7 +2912,6 @@ export const OrchestrationV2ThreadShellJson = OrchestrationV2ThreadShell.mapFiel
activityRunStartedAt: Schema.optional(Schema.NullOr(Schema.DateTimeUtcFromString)),
pendingRuntimeRequest: Schema.NullOr(OrchestrationV2PendingRuntimeRequestSummaryJson),
latestVisibleMessage: Schema.NullOr(OrchestrationV2LatestVisibleMessageSummaryJson),
- latestAction: Schema.optional(Schema.NullOr(OrchestrationV2LatestActionSummaryJson)),
latestUserMessageAt: Schema.NullOr(Schema.DateTimeUtcFromString),
latestUserAuthoredMessageAt: Schema.optional(Schema.NullOr(Schema.DateTimeUtcFromString)),
createdAt: Schema.DateTimeUtcFromString,
@@ -3594,7 +3575,6 @@ export const OrchestrationV2Command = Schema.Union([
parentNodeId: NodeId,
task: TrimmedNonEmptyString,
title: Schema.optional(TrimmedNonEmptyString),
- group: Schema.optional(SubagentGroup),
modelSelection: ModelSelection,
runtimeMode: RuntimeMode,
interactionMode: ProviderInteractionMode,
@@ -3738,7 +3718,6 @@ const OrchestrationV2InternalCommand = Schema.Union([
parentNodeId: NodeId,
task: TrimmedNonEmptyString,
title: Schema.optional(TrimmedNonEmptyString),
- group: Schema.optional(SubagentGroup),
driver: ProviderDriverKind,
modelSelection: ModelSelection,
remoteChild: OrchestrationV2RemoteTaskChild,
diff --git a/packages/contracts/src/orchestratorMcp.ts b/packages/contracts/src/orchestratorMcp.ts
index a61285dfc4d54..210025ff7a0be 100644
--- a/packages/contracts/src/orchestratorMcp.ts
+++ b/packages/contracts/src/orchestratorMcp.ts
@@ -41,7 +41,6 @@ import {
OrchestrationV2DelegatedFrom,
OrchestrationV2RunStatus,
OrchestrationV2TurnItemStatus,
- SubagentGroup,
} from "./orchestrationV2.ts";
import { ProviderOptionSelection, ProviderOptionSelectionValue } from "./model.ts";
import { ProviderDriverKind, ProviderInstanceId } from "./providerInstance.ts";
@@ -185,9 +184,6 @@ export const OrchestratorMcpDelegateTaskInput = Schema.Struct({
target: Schema.optional(OrchestratorMcpDelegateTaskTarget),
title: Schema.optional(OrchestratorMcpTitle),
role: Schema.optional(OrchestratorMcpTaskRole),
- group: Schema.optional(SubagentGroup).annotate({
- description: "Parallel work stream, e.g. 'UI'.",
- }),
isolation: Schema.optional(
Schema.Literals(["shared", "worktree"]).annotate({
description:
diff --git a/vite.config.ts b/vite.config.ts
index 8ae1ee18e3216..c7a92ccbc9ad1 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -646,7 +646,6 @@ export default defineConfig({
"apps/mobile/src/features/review/ReviewSheet.tsx",
"apps/mobile/src/features/review/useNativeReviewDiffBridge.ts",
"apps/mobile/src/features/settings/SettingsEnvironmentsRouteScreen.tsx",
- "apps/mobile/src/features/threads/ChildThreadApprovals.tsx",
"apps/mobile/src/features/threads/ThreadComposer.tsx",
"apps/mobile/src/features/threads/ThreadFeed.tsx",
"apps/mobile/src/features/threads/ThreadQueueControl.tsx",