@devries-cameron20 / t3code-1 / commits / 3b732f4d37
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(server): Codex subagent rows show the child's current command (#34862)

Julius Marminge committed Nov 11, 2026 at 23:39 UTC 3b732f4d37e1fd37155afe8fca91fb19c3ea5d15
2 files changed +35 -1
apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts
+6
@@ -6185,6 +6185,12 @@ describe("CodexAdapterV2 post-settle continuation", () => {
6185 );
6186 assert.equal(childCommandUpdates.at(-1)?.turnItem.status, "interrupted");
6187 assert.equal(harness.subagentUpdates().at(-1)?.subagent.status, "interrupted");
6188 + assert.isDefined(
6189 + harness
6190 + .subagentUpdates()
6191 + .find((event) => event.subagent.status === "running" && event.subagent.progress),
6192 + "a running native subagent reports its child's current command as progress",
6193 + );
6194 assertChildProviderTerminalBeforeRoot(harness.events, harness.threadId);
6195 assert.isFalse(yield* harness.hasPendingBackgroundWork);
6196 }).pipe(
apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts
+29 -1
@@ -2727,9 +2727,12 @@ export const makeCodexAdapterV2 = Effect.fn("makeCodexAdapterV2")(function* (
2727 readonly completedAt?: DateTime.Utc | null;
2728 readonly startedAt?: DateTime.Utc;
2729 readonly reopen?: boolean;
2730 + readonly progress?: string;
2731 }) {
2732 const now = yield* DateTime.now;
2732 - const prior = input.subagent.task;
2733 + const prior = input.reopen
2734 + ? (({ progress: _staleProgress, ...rest }) => rest)(input.subagent.task)
2735 + : input.subagent.task;
2736 const settled = !isOrchestrationV2WorkActive(prior.status);
2737 // Late snapshots must not reopen completed children; only new turns may.
2738 if (settled && isOrchestrationV2WorkActive(input.status) && !input.reopen) return;
@@ -2747,6 +2750,7 @@ export const makeCodexAdapterV2 = Effect.fn("makeCodexAdapterV2")(function* (
2750 }
2751 : {}),
2752 startedAt: input.startedAt ?? prior.startedAt,
2753 + ...(input.progress === undefined ? {} : { progress: input.progress }),
2754 result: input.result === undefined ? input.subagent.task.result : input.result,
2755 completedAt,
2756 updatedAt: now,
@@ -2784,11 +2788,28 @@ export const makeCodexAdapterV2 = Effect.fn("makeCodexAdapterV2")(function* (
2788 providerInstanceId: task.providerInstanceId,
2789 childThreadId: task.childThreadId,
2790 prompt: task.prompt,
2791 + ...(task.progress === undefined ? {} : { progress: task.progress }),
2792 result: task.result,
2793 },
2794 });
2795 });
2796
2797 + // A native child's running item is the line its parent's subagent row shows.
2798 + const reportSubagentProgress =
2799 + /* Provider events include streaming deltas; avoid a span for each update. */
2800 + Effect.fnUntraced(function* (context: ActiveCodexTurnContext, progress: string | null) {
2801 + const subagent = context.subagent;
2802 + const line = progress?.trim();
2803 + if (subagent === null || !line) return;
2804 + if (!isOrchestrationV2WorkActive(subagent.task.status)) return;
2805 + if (subagent.task.progress === line) return;
2806 + yield* emitSubagentTaskUpdate({
2807 + subagent,
2808 + status: subagent.task.status,
2809 + progress: line,
2810 + });
2811 + });
2812 +
2813 const emitSubagentProviderTurnStarted =
2814 /* Provider events include streaming deltas; avoid a span for each update. */
2815 Effect.fnUntraced(function* (
@@ -5194,6 +5215,7 @@ export const makeCodexAdapterV2 = Effect.fn("makeCodexAdapterV2")(function* (
5215 driver: CODEX_PROVIDER,
5216 turnItem: artifacts.turnItem,
5217 });
5218 + yield* reportSubagentProgress(context, payload.item.command);
5219 return;
5220 }
5221
@@ -5212,6 +5234,12 @@ export const makeCodexAdapterV2 = Effect.fn("makeCodexAdapterV2")(function* (
5234 driver: CODEX_PROVIDER,
5235 turnItem: artifacts.turnItem,
5236 });
5237 + if (artifacts.turnItem.type === "dynamic_tool") {
5238 + yield* reportSubagentProgress(
5239 + context,
5240 + artifacts.turnItem.title ?? artifacts.turnItem.toolName,
5241 + );
5242 + }
5243 return;
5244 }
5245