feat(subagents): archive finished children and show native names

Keep native provider sessions intact while letting users clear completed children from the track. Persist dismissed provider child IDs so history replay does not restore them.
This commit is contained in:
Mohamed Boudra
2026-07-15 00:10:30 +02:00
parent d706c4339b
commit f62359fae0
33 changed files with 518 additions and 41 deletions
+31
View File
@@ -498,6 +498,10 @@ export type ProviderSubagentListPayload = Extract<
SessionOutboundMessage,
{ type: "agent.provider_subagents.list.response" }
>["payload"];
export type ArchiveFinishedSubagentsPayload = Extract<
SessionOutboundMessage,
{ type: "agent.subagents.archive_finished.response" }
>["payload"];
export type ProviderSubagentTimelinePayload = Extract<
SessionOutboundMessage,
{ type: "agent.provider_subagents.timeline.get.response" }
@@ -2514,6 +2518,33 @@ export class DaemonClient {
return payload;
}
async archiveFinishedSubagents(
parentAgentId: string,
options: { requestId?: string; timeout?: number } = {},
): Promise<ArchiveFinishedSubagentsPayload> {
const requestId = this.createRequestId(options.requestId);
const message = SessionInboundMessageSchema.parse({
type: "agent.subagents.archive_finished.request",
parentAgentId,
requestId,
});
const payload = await this.sendRequest({
requestId,
message,
timeout: options.timeout,
options: { skipQueue: true },
select: (response) =>
response.type === "agent.subagents.archive_finished.response" &&
response.payload.requestId === requestId
? response.payload
: null,
});
if (payload.error) {
throw new Error(payload.error);
}
return payload;
}
async fetchProviderSubagentTimeline(
parentAgentId: string,
subagentId: string,