Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(clients): a failed turn shows as failed while background work is pending #14184

Mergedjuliusmarmingemerged 1 commit intot3code/codex-turn-mapping fromrefs/pull/14184/headmerged by juliusmarminge View on GitHub

Showing 3 changed files with 26 additions and 3 deletions.

x
0 of 3 viewed, 3 left
22 additions and 0 deletionspackages/client-runtime/src/state/entities.test.tsModified
View file
@@ -153,6 +153,21 @@
]);
});
​
+ it("keeps a failed latest run failed while background tasks are still pending", () => {
+ const shell = presentThreadShell(environmentId, {
+ ...v2ThreadShell,
+ latestRunId: RunId.make("run-failed"),
+ activeRunId: null,
+ status: "failed",
+ lastError: "Provider turn failed",
+ pendingBackgroundTasks: [{ taskId: "bg-1", description: "sleep 20", kind: "command" }],
+ });
+​
+ // Sidebar and mobile list read runtime "idle" as Waiting before failure.
+ expect(shell.runtime).toMatchObject({ status: "failed", lastError: "Provider turn failed" });
+ expect(shell.pendingBackgroundTasks).toHaveLength(1);
+ });
+​
it("stacks earlier provider owners behind the current one, newest history first to go", () => {
const codex = ProviderInstanceId.make("codex");
const claude = ProviderInstanceId.make("claude");
@@ -466,6 +481,13 @@
status: "running",
activeRunId: runId,
});
+ expect(
+ deriveThreadRuntime({
+ ...v2Projection,