Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/ai-chat/src/browser/agent-delegation-tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ export class AgentDelegationTool implements ToolProvider {
// Wait for completion to return the final result as tool output
const result = await response.responseCompleted;
const stringResult = result.response.asString();

// Clean up the session after completion
const chatService = this.getChatService();
chatService.deleteSession(newSession.id);

// Return the raw text to the top-level Agent, as a tool result
return stringResult;
} catch (completionError) {
Expand Down
Loading