Skip to content

Commit 08bea6c

Browse files
committed
fix(mobile): exclude idle agents from done count
1 parent e0ab895 commit 08bea6c

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

‎packages/client-runtime/src/state/threadSubagents.test.ts‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,4 +201,24 @@ describe("resolveSubagentPillSegment", () => {
201201
accessibilityLabel: "2 agents done",
202202
});
203203
});
204+
205+
it("does not count idle agents as done alongside settled workflows", () => {
206+
const turn = deriveThreadTurnSubagents({
207+
runs: [finishedRun, run("run-2", "completed")],
208+
subagents: [
209+
subagent({ id: "workflow", status: "completed", workflow: { phases: [], agents: [] } }),
210+
subagent({
211+
id: "idle",
212+
runId: RunId.make("run-2"),
213+
status: "idle",
214+
updatedAt: at("2026-06-20T00:00:09.000Z"),
215+
}),
216+
],
217+
});
218+
219+
expect(resolveSubagentPillSegment(turn)).toEqual({
220+
label: "1 done",
221+
accessibilityLabel: "1 agent done",
222+
});
223+
});
204224
});

‎packages/client-runtime/src/state/threadSubagents.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export function resolveSubagentPillSegment(
8080
};
8181
}
8282
return {
83-
label: `${total} done`,
84-
accessibilityLabel: `${total} ${total === 1 ? "agent" : "agents"} done`,
83+
label: `${turn.settledCount} done`,
84+
accessibilityLabel: `${turn.settledCount} ${turn.settledCount === 1 ? "agent" : "agents"} done`,
8585
};
8686
}

0 commit comments

Comments
 (0)