fix: improve subagent UI display and interruption handling (#330)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2025-12-21 00:09:12 -08:00
committed by GitHub
parent 90d84482ef
commit 0852ce26fe
14 changed files with 161 additions and 29 deletions

View File

@@ -20,6 +20,7 @@ interface TaskArgs {
description: string;
model?: string;
toolCallId?: string; // Injected by executeTool for linking subagent to parent tool call
signal?: AbortSignal; // Injected by executeTool for interruption handling
}
/**
@@ -33,7 +34,8 @@ export async function task(args: TaskArgs): Promise<string> {
"Task",
);
const { subagent_type, prompt, description, model, toolCallId } = args;
const { subagent_type, prompt, description, model, toolCallId, signal } =
args;
// Get all available subagent configs (built-in + custom)
const allConfigs = await getAllSubagentConfigs();
@@ -54,12 +56,14 @@ export async function task(args: TaskArgs): Promise<string> {
prompt,
model,
subagentId,
signal,
);
// Mark subagent as completed in state store
completeSubagent(subagentId, {
success: result.success,
error: result.error,
totalTokens: result.totalTokens,
});
if (!result.success) {