The best way to control Claude Code, Codex and more from any computer or phone
fix(server): preserve run start time when steering restarts a turn (#31640)
Co-authored-by: Julius Marminge <julius0216@outlook.com>
oliver committed
Nov 14, 2026 at 18:48 UTC
8be0e6c8ebf1f7d4c48c3d1f80b8b3d479d955e4
2 files changed
+16
-1
apps/server/src/orchestration-v2/ProviderTurnStartService.ts
+1
-1
@@ -1560,7 +1560,7 @@ export const layer: Layer.Layer<
1560
const runningRun: OrchestrationV2Run = {
1561
...run,
1562
status: "running",
1563
- startedAt: now,
1563
+ startedAt: run.startedAt ?? now,
1564
};
1565
const runningAttempt: OrchestrationV2RunAttempt = {
1566
...attempt,
apps/server/src/orchestration-v2/SteeringCompletion.integration.test.ts
+15
@@ -1,4 +1,5 @@
1
import { assert, it } from "@effect/vitest";
2
+import * as TestClock from "effect/testing/TestClock";
3
import {
4
ChatAttachmentId,
5
CommandId,
@@ -1297,6 +1298,10 @@ it.effect("restarts the turn for an image when native steering takes text only",
1298
const orchestrator = yield* Orchestrator.OrchestratorV2;
1299
const worker = yield* EffectWorker.OrchestrationEffectWorkerV2;
1300
const threadId = yield* startFirstTurn;
1301
+ const before = yield* orchestrator.getThreadProjection(threadId);
1302
+ const originalStart = before.runs[0]!.startedAt;
1303
+ assert.isNotNull(originalStart);
1304
+ yield* TestClock.adjust("10 seconds");
1305
yield* orchestrator.dispatch({
1306
type: "message.dispatch",
1307
commandId: CommandId.make("steer-image"),
@@ -1318,6 +1323,16 @@ it.effect("restarts the turn for an image when native steering takes text only",
1323
creationSource: "web",
1324
});
1325
yield* worker.drain();
1326
+ const after = yield* orchestrator.getThreadProjection(threadId);
1327
+ assert.equal(after.runs[0]?.id, before.runs[0]?.id);
1328
+ assert.deepEqual(after.runs[0]?.startedAt, originalStart);
1329
+ assert.equal(after.attempts[0]?.status, "superseded");
1330
+ const restartedAt = yield* DateTime.now;
1331
+ assert.deepEqual(after.attempts[1]?.startedAt, restartedAt);
1332
+ assert.deepEqual(
1333
+ after.nodes.find((node) => node.id === after.runs[0]?.rootNodeId)?.startedAt,
1334
+ restartedAt,
1335
+ );
1336
assert.deepEqual(steered, []);
1337
assert.deepEqual(
1338
started.map((turn) => [turn.message.text, turn.message.attachments.length]),