Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(client-runtime): a resumed Claude subagent no longer stays failed or stopped in the Agents panel #14696

Closednavidnadali(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromrefs/pull/14696/headopened View on GitHub

Showing 2 changed files with 165 additions and 0 deletions (loading 1).

x
0 of 2 viewed, 2 left
165 additions and 0 deletionspackages/client-runtime/src/state/subagentRuntime.test.tsModified
View file
@@ -763,6 +763,171 @@
expect(agents[0]!.completedAt).toBe("2026-08-01T09:59:59.000Z");
});
​
+ it("a start under a new toolUseId reopens a settled run until that run settles", () => {
+ // Claude resumes a settled subagent (SendMessage) with another task.started
+ // for the same taskId under the resuming call's toolUseId, and no running
+ // status. Every task row repeats the toolUseId of the run it belongs to.
+ const run1 = { taskId: "resumed", taskType: "local_agent", toolUseId: "agent-call" };
+ const run2 = { ...run1, toolUseId: "send-message-call" };
+ const failedThenResumed = [
+ activity("task.started", run1, "2026-08-01T10:00:00.000Z"),
+ activity(
+ "task.updated",
+ { ...run1, status: "failed", error: "Agent terminated early due to an API error" },
+ "2026-08-01T10:10:00.000Z",
+ ),
+ activity("task.completed", { ...run1, status: "failed" }, "2026-08-01T10:10:00.000Z"),
+ activity("task.started", run2, "2026-08-01T10:20:00.000Z"),
+ ];
+ expect(fold(failedThenResumed)[0]).toMatchObject({
+ status: "running",
+ activationCount: 2,
+ error: null,
+ startedAt: "2026-08-01T10:20:00.000Z",
+ completedAt: null,
+ });
+​
+ const settled = fold([
+ ...failedThenResumed,