Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(client-runtime): the agents pill counts background agents from earlier turns #20785

Mergedjuliusmarmingemerged 2 commits intomain fromrefs/pull/20785/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 140 additions and 8 deletions.

x
0 of 2 viewed, 2 left
116 additions and 2 deletionspackages/client-runtime/src/state/threadSubagents.test.tsModified
View file
@@ -41,7 +41,7 @@
};
​
-const run = (id: string, status: "running" | "completed") =>
+const run = (id: string, status: "running" | "completed" | "rolled_back") =>
({ id: RunId.make(id), status }) as never;
const activeRun = run("run-1", "running");
const finishedRun = run("run-1", "completed");
@@ -56,7 +56,7 @@
runs: [run("run-0", "completed"), activeRun],
subagents: [
subagent({ id: "b", startedAt: at("2026-06-20T00:00:05.000Z") }),
- subagent({ id: "old", runId: RunId.make("run-0") }),
+ subagent({ id: "old", runId: RunId.make("run-0"), status: "completed" }),
subagent({ id: "a", startedAt: at("2026-06-20T00:00:02.000Z") }),
],
});
@@ -85,6 +85,120 @@
expect(turn?.subagents.map((entry) => entry.id)).toEqual(["recent"]);
});
​
+ it("lists every live agent from earlier turns once no turn is running", () => {
+ const turn = deriveThreadTurnSubagents({
+ runs: ["run-103", "run-105", "run-107", "run-109"].map((id) => run(id, "completed")),
+ subagents: [
+ subagent({
+ id: "settled-103",