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

@@ -180,7 +180,7 @@ export function addToolCall(
*/
export function completeSubagent(
id: string,
result: { success: boolean; error?: string },
result: { success: boolean; error?: string; totalTokens?: number },
): void {
const agent = store.agents.get(id);
if (!agent) return;
@@ -191,6 +191,7 @@ export function completeSubagent(
status: result.success ? "completed" : "error",
error: result.error,
durationMs: Date.now() - agent.startTime,
totalTokens: result.totalTokens ?? agent.totalTokens,
} as SubagentState;
store.agents.set(id, updatedAgent);
notifyListeners();