@devries-cameron20 / t3code-1 / commits / 19b33eca4c
Fork 0

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

fix(server): remote tasks report their actual model (#37332)

Yaz Caleb committed Nov 15, 2026 at 23:31 UTC 19b33eca4c45de943460553c37040485d36fe5f7
5 files changed +28 -6
apps/server/src/mcp/OrchestratorMcpService.ts
+1 -1
@@ -2023,7 +2023,7 @@ const make = Effect.gen(function* () {
2023 hasPendingChildRuns: false,
2024 providerInstanceId: task.providerInstanceId,
2025 model: task.model,
2026 - executedModel: null,
2026 + executedModel: task.executedModel ?? null,
2027 summary: task.result,
2028 resultContextTransferId: null,
2029 latestTerminalRunId: null,
apps/server/src/orchestration-v2/Orchestrator.ts
+1
@@ -10075,6 +10075,7 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio
10075 remoteChild,
10076 status: command.status,
10077 result: command.result,
10078 + ...(command.executedModel === undefined ? {} : { executedModel: command.executedModel }),
10079 completedAt: now,
10080 updatedAt: now,
10081 };
apps/server/src/peer/RemoteDelegation.test.ts
+11
@@ -1441,6 +1441,11 @@ it.effect("a task's result is its own run's whole last reply, not a later run's"
1441 expect(task?.result).toBe(
1442 `Requested model gpt-5.4; the provider reported running gpt-5.4-mini.\n\n${long}`,
1443 );
1444 + const status = yield* a.call("task_status", { taskId });
1445 + expect(status.structuredContent).toMatchObject({
1446 + status: "completed",
1447 + executedModel: "gpt-5.4-mini",
1448 + });
1449 // Every wait was for the run the launch started.
1450 const waits = yield* Ref.get(thread.waitedFor);
1451 expect(waits.length).toBeGreaterThan(0);
@@ -1464,6 +1469,7 @@ it.effect("a task whose thread there waits on its own task ends with the answer
1469 const delegated = yield* delegateToBox(a);
1470
1471 // The task's run there ends after delegating a review of its own.
1472 + yield* Ref.set(thread.executedModel, "gpt-5.4-mini");
1473 yield* Ref.set(thread.nested, true);
1474 yield* Ref.set(thread.reply, "Started a review; I will answer when it reports.");
1475 yield* Ref.set(thread.status, "completed");
@@ -1481,6 +1487,11 @@ it.effect("a task whose thread there waits on its own task ends with the answer
1487 status: "completed",
1488 result: "The review found two issues; both are fixed.",
1489 });
1490 + const status = yield* a.call("task_status", { taskId: delegated.taskId });
1491 + expect(status.structuredContent).toMatchObject({
1492 + status: "completed",
1493 + executedModel: null,
1494 + });
1495 }),
1496 ).pipe(Effect.provide(NodeHttpServer.layerTest)),
1497 );
apps/server/src/peer/RemoteDelegation.ts
+13 -5
@@ -539,6 +539,7 @@ const make = Effect.gen(function* () {
539 result: string,
540 stoppedThere: "ran-out" | "stopped" | undefined,
541 stopCount?: number,
542 + executedModel?: string,
543 ) {
544 const attempt = yield* random.uuidV4();
545 yield* threads
@@ -551,6 +552,7 @@ const make = Effect.gen(function* () {
552 result,
553 ...(stoppedThere === undefined ? {} : { stoppedThere }),
554 ...(stopCount === undefined ? {} : { stopCount }),
555 + ...(executedModel === undefined ? {} : { executedModel }),
556 })
557 .pipe(
558 Effect.catch((error) =>
@@ -642,7 +644,8 @@ const make = Effect.gen(function* () {
644 afterPosition = read.nextPosition;
645 }
646 reply = error ?? reply;
645 - if (reply === undefined) return undefined;
647 + const executedModel = run?.executedModel ?? undefined;
648 + if (reply === undefined) return { text: undefined, executedModel };
649 let text = reply.text ?? "";
650 let textOffset = reply.textTruncated ? (reply.nextTextOffset ?? null) : null;
651 while (textOffset !== null) {
@@ -657,7 +660,10 @@ const make = Effect.gen(function* () {
660 text += part.text ?? "";
661 textOffset = part.textTruncated ? (part.nextTextOffset ?? null) : null;
662 }
660 - return run === undefined ? text : withExecutedModelNote(text, run.model, run.executedModel);
663 + return {
664 + text: run === undefined ? text : withExecutedModelNote(text, run.model, run.executedModel),
665 + executedModel,
666 + };
667 });
668
669 /**
@@ -823,8 +829,8 @@ const make = Effect.gen(function* () {
829 yield* complete(
830 parentThreadId,
831 taskId,
826 - reply === undefined ? "failed" : "completed",
827 - reply ?? "The thread in the linked environment has no run to follow.",
832 + reply.text === undefined ? "failed" : "completed",
833 + reply.text ?? "The thread in the linked environment has no run to follow.",
834 "ran-out",
835 );
836 return yield* settled(parentThreadId, taskId);
@@ -860,8 +866,10 @@ const make = Effect.gen(function* () {
866 parentThreadId,
867 taskId,
868 terminalStatus(resultRun.status),
863 - result ?? noReply,
869 + result.text ?? noReply,
870 "ran-out",
871 + undefined,
872 + result.executedModel,
873 );
874 return yield* settled(parentThreadId, taskId);
875 });
packages/contracts/src/orchestrationV2.ts
+2
@@ -935,6 +935,7 @@ export const OrchestrationV2Subagent = Schema.Struct({
935 title: Schema.NullOr(Schema.String),
936 model: Schema.NullOr(Schema.String),
937 modelSelection: Schema.optional(ModelSelection),
938 + executedModel: Schema.optional(Schema.String),
939 completionWake: Schema.optional(Schema.Literals(["always", "settled_only"])),
940 completionDelivery: Schema.optional(OrchestrationV2DelegatedCompletionTaskDelivery),
941 // The run whose unfinished task was cancelled, committed with its Stop.
@@ -3692,6 +3693,7 @@ const OrchestrationV2InternalCommand = Schema.Union([
3693 taskId: NodeId,
3694 status: Schema.Literals(["completed", "failed", "cancelled", "interrupted"]),
3695 result: Schema.String,
3696 + executedModel: Schema.optional(Schema.String),
3697 /**
3698 * `ran-out`: the run there ended by itself; `stopped`: a stop from here reached it. Either
3699 * sets `remoteChild.stoppedThere` on a task this report completes. On a task already