Skip to content
Open
Show file tree
Hide file tree
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
60 changes: 55 additions & 5 deletions config/gni/devtools_grd_files.gni
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,31 @@ grd_files_bundled_sources = [
"front_end/panels/ai_chat/ui/TodoListDisplay.js",
"front_end/panels/ai_chat/ui/FileListDisplay.js",
"front_end/panels/ai_chat/ui/FileContentViewer.js",
"front_end/panels/ai_chat/ui/AgentStudioBridge.js",
"front_end/panels/ai_chat/ui/AgentStudioController.js",
"front_end/panels/ai_chat/ui/AgentStudioView.js",
"front_end/panels/ai_chat/ui/SchemaEditor.js",
"front_end/panels/ai_chat/ui/agent_studio/AgentStudioSPA.js",
"front_end/panels/ai_chat/ui/settings/advanced/BrowsingHistorySettings.js",
"front_end/panels/ai_chat/ui/settings/advanced/EvaluationSettings.js",
"front_end/panels/ai_chat/ui/settings/advanced/MCPSettings.js",
"front_end/panels/ai_chat/ui/settings/advanced/TracingSettings.js",
"front_end/panels/ai_chat/ui/settings/advanced/VectorDBSettings.js",
"front_end/panels/ai_chat/ui/settings/components/AdvancedToggle.js",
"front_end/panels/ai_chat/ui/settings/components/ModelSelectorFactory.js",
"front_end/panels/ai_chat/ui/settings/components/SettingsFooter.js",
"front_end/panels/ai_chat/ui/settings/components/SettingsHeader.js",
"front_end/panels/ai_chat/ui/settings/constants.js",
"front_end/panels/ai_chat/ui/settings/i18n-strings.js",
"front_end/panels/ai_chat/ui/settings/providerConfigs.js",
"front_end/panels/ai_chat/ui/settings/providers/BaseProviderSettings.js",
"front_end/panels/ai_chat/ui/settings/providers/GenericProviderSettings.js",
"front_end/panels/ai_chat/ui/settings/providers/LiteLLMSettings.js",
"front_end/panels/ai_chat/ui/settings/providers/OpenRouterSettings.js",
"front_end/panels/ai_chat/ui/settings/types.js",
"front_end/panels/ai_chat/ui/settings/utils/storage.js",
"front_end/panels/ai_chat/ui/settings/utils/styles.js",
"front_end/panels/ai_chat/ui/settings/utils/validation.js",
"front_end/panels/ai_chat/core/AgentService.js",
"front_end/panels/ai_chat/core/State.js",
"front_end/panels/ai_chat/core/Graph.js",
Expand All @@ -682,6 +707,10 @@ grd_files_bundled_sources = [
"front_end/panels/ai_chat/core/Version.js",
"front_end/panels/ai_chat/core/VersionChecker.js",
"front_end/panels/ai_chat/core/LLMConfigurationManager.js",
"front_end/panels/ai_chat/core/CustomProviderManager.js",
"front_end/panels/ai_chat/core/AgentStorageManager.js",
"front_end/panels/ai_chat/core/AgentStudioIntegration.js",
"front_end/panels/ai_chat/core/AgentTestRunner.js",
"front_end/panels/ai_chat/LLM/LLMTypes.js",
"front_end/panels/ai_chat/LLM/LLMProvider.js",
"front_end/panels/ai_chat/LLM/LLMProviderRegistry.js",
Expand All @@ -694,6 +723,10 @@ grd_files_bundled_sources = [
"front_end/panels/ai_chat/LLM/BrowserOperatorProvider.js",
"front_end/panels/ai_chat/LLM/LLMClient.js",
"front_end/panels/ai_chat/LLM/MessageSanitizer.js",
"front_end/panels/ai_chat/LLM/AnthropicProvider.js",
"front_end/panels/ai_chat/LLM/CerebrasProvider.js",
"front_end/panels/ai_chat/LLM/GenericOpenAIProvider.js",
"front_end/panels/ai_chat/LLM/GoogleAIProvider.js",
"front_end/panels/ai_chat/tools/Tools.js",
"front_end/panels/ai_chat/tools/SequentialThinkingTool.js",
"front_end/panels/ai_chat/tools/CombinedExtractionTool.js",
Expand All @@ -712,6 +745,7 @@ grd_files_bundled_sources = [
"front_end/panels/ai_chat/tools/RenderWebAppTool.js",
"front_end/panels/ai_chat/tools/GetWebAppDataTool.js",
"front_end/panels/ai_chat/tools/RemoveWebAppTool.js",
"front_end/panels/ai_chat/tools/SaveResearchReportTool.js",
"front_end/panels/ai_chat/tools/FileStorageManager.js",
"front_end/panels/ai_chat/tools/CreateFileTool.js",
"front_end/panels/ai_chat/tools/UpdateFileTool.js",
Expand All @@ -721,21 +755,34 @@ grd_files_bundled_sources = [
"front_end/panels/ai_chat/tools/ExecuteCodeTool.js",
"front_end/panels/ai_chat/tools/UpdateTodoTool.js",
"front_end/panels/ai_chat/tools/VisualIndicatorTool.js",
"front_end/panels/ai_chat/tools/ReadabilityExtractorTool.js",
"front_end/panels/ai_chat/tools/CallCustomAgentTool.js",
"front_end/panels/ai_chat/tools/SearchCustomAgentsTool.js",
"front_end/panels/ai_chat/tools/mini_app/CloseMiniAppTool.js",
"front_end/panels/ai_chat/tools/mini_app/ExecuteMiniAppActionTool.js",
"front_end/panels/ai_chat/tools/mini_app/GetMiniAppStateTool.js",
"front_end/panels/ai_chat/tools/mini_app/LaunchMiniAppTool.js",
"front_end/panels/ai_chat/tools/mini_app/ListMiniAppsTool.js",
"front_end/panels/ai_chat/tools/mini_app/UpdateMiniAppStateTool.js",
"front_end/panels/ai_chat/common/utils.js",
"front_end/panels/ai_chat/common/log.js",
"front_end/panels/ai_chat/common/context.js",
"front_end/panels/ai_chat/common/page.js",
"front_end/panels/ai_chat/core/structured_response.js",
"front_end/panels/ai_chat/models/ChatTypes.js",
"front_end/panels/ai_chat/mini_apps/GenericMiniAppBridge.js",
"front_end/panels/ai_chat/mini_apps/MiniAppEventBus.js",
"front_end/panels/ai_chat/mini_apps/MiniAppInitialization.js",
"front_end/panels/ai_chat/mini_apps/MiniAppRegistry.js",
"front_end/panels/ai_chat/mini_apps/MiniAppStorageManager.js",
"front_end/panels/ai_chat/mini_apps/apps/agent_studio/AgentStudioMiniApp.js",
"front_end/panels/ai_chat/mini_apps/types/MiniAppTypes.js",
"front_end/panels/ai_chat/models/ChatTypes.js",
"front_end/panels/ai_chat/ui/input/ChatInput.js",
"front_end/panels/ai_chat/ui/input/InputBar.js",
"front_end/panels/ai_chat/ui/markdown/MarkdownRenderers.js",
"front_end/panels/ai_chat/ui/message/MessageList.js",
"front_end/panels/ai_chat/ui/message/ModelMessage.js",
"front_end/panels/ai_chat/ui/message/MessageCombiner.js",
"front_end/panels/ai_chat/ui/message/StructuredResponseRender.js",
"front_end/panels/ai_chat/ui/message/StructuredResponseController.js",
"front_end/panels/ai_chat/ui/message/GlobalActionsRow.js",
"front_end/panels/ai_chat/ui/message/GlobalActionsRow.js",
"front_end/panels/ai_chat/ui/message/ToolResultMessage.js",
"front_end/panels/ai_chat/ui/message/UserMessage.js",
"front_end/panels/ai_chat/ui/model_selector/ModelSelector.js",
Expand Down Expand Up @@ -780,6 +827,7 @@ grd_files_bundled_sources = [
"front_end/panels/ai_chat/evaluation/framework/MarkdownReportGenerator.js",
"front_end/panels/ai_chat/evaluation/framework/types.js",
"front_end/panels/ai_chat/evaluation/test-cases/action-agent-tests.js",
"front_end/panels/ai_chat/evaluation/test-cases/html-to-markdown-tests.js",
"front_end/panels/ai_chat/evaluation/test-cases/research-agent-tests.js",
"front_end/panels/ai_chat/evaluation/test-cases/schema-extractor-tests.js",
"front_end/panels/ai_chat/evaluation/test-cases/streamlined-schema-extractor-tests.js",
Expand All @@ -794,6 +842,8 @@ grd_files_bundled_sources = [
"front_end/panels/ai_chat/mcp/MCPToolAdapter.js",
"front_end/panels/ai_chat/mcp/MCPMetaTools.js",
"front_end/panels/ai_chat/tools/LLMTracingWrapper.js",
"front_end/panels/ai_chat/utils/ContentChunker.js",
"front_end/panels/ai_chat/vendor/readability-source.js",
"front_end/panels/animation/animation-meta.js",
"front_end/panels/animation/animation.js",
"front_end/panels/application/application-meta.js",
Expand Down
70 changes: 61 additions & 9 deletions front_end/panels/ai_chat/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@ generate_css("css_files") {

devtools_module("ai_chat") {
sources = [
"core/AgentStorageManager.ts",
"core/AgentStudioIntegration.ts",
"core/AgentTestRunner.ts",
"ui/AIChatPanel.ts",
"ui/ChatView.ts",
"ui/message/MessageList.ts",
"ui/message/UserMessage.ts",
"ui/message/ModelMessage.ts",
"ui/message/ToolResultMessage.ts",
"ui/message/MessageCombiner.ts",
"ui/message/StructuredResponseRender.ts",
"ui/message/StructuredResponseController.ts",
"ui/message/GlobalActionsRow.ts",
"ui/markdown/MarkdownRenderers.ts",
"ui/model_selector/ModelSelector.ts",
Expand Down Expand Up @@ -81,8 +82,7 @@ devtools_module("ai_chat") {
"core/AgentService.ts",
"core/Constants.ts",
"core/BuildConfig.ts",
"core/structured_response.ts",
"core/GraphConfigs.ts",
"core/GraphConfigs.ts",
"core/ConfigurableGraph.ts",
"core/BaseOrchestratorAgent.ts",
"core/AgentDescriptorRegistry.ts",
Expand Down Expand Up @@ -142,7 +142,23 @@ devtools_module("ai_chat") {
"tools/RenderWebAppTool.ts",
"tools/GetWebAppDataTool.ts",
"tools/RemoveWebAppTool.ts",
"tools/SaveResearchReportTool.ts",
"tools/SearchCustomAgentsTool.ts",
"tools/CallCustomAgentTool.ts",
"tools/VisualIndicatorTool.ts",
"tools/mini_app/ListMiniAppsTool.ts",
"tools/mini_app/LaunchMiniAppTool.ts",
"tools/mini_app/GetMiniAppStateTool.ts",
"tools/mini_app/UpdateMiniAppStateTool.ts",
"tools/mini_app/ExecuteMiniAppActionTool.ts",
"tools/mini_app/CloseMiniAppTool.ts",
"mini_apps/types/MiniAppTypes.ts",
"mini_apps/MiniAppRegistry.ts",
"mini_apps/GenericMiniAppBridge.ts",
"mini_apps/MiniAppStorageManager.ts",
"mini_apps/MiniAppEventBus.ts",
"mini_apps/MiniAppInitialization.ts",
"mini_apps/apps/agent_studio/AgentStudioMiniApp.ts",
"agent_framework/ConfigurableAgentTool.ts",
"agent_framework/AgentRunner.ts",
"agent_framework/AgentRunnerEventBus.ts",
Expand Down Expand Up @@ -201,6 +217,11 @@ devtools_module("ai_chat") {
"mcp/MCPMetaTools.ts",
"ui/mcp/MCPConnectionsDialog.ts",
"ui/mcp/MCPConnectorsCatalogDialog.ts",
"ui/SchemaEditor.ts",
"ui/AgentStudioView.ts",
"ui/AgentStudioController.ts",
"ui/AgentStudioBridge.ts",
"ui/agent_studio/AgentStudioSPA.ts",
]

deps = [
Expand All @@ -225,15 +246,16 @@ devtools_module("ai_chat") {

# List of source files also used to determine JS outputs for metadata
_ai_chat_sources = [
"core/AgentStorageManager.ts",
"core/AgentStudioIntegration.ts",
"core/AgentTestRunner.ts",
"ui/AIChatPanel.ts",
"ui/ChatView.ts",
"ui/message/MessageList.ts",
"ui/message/UserMessage.ts",
"ui/message/ModelMessage.ts",
"ui/message/ToolResultMessage.ts",
"ui/message/MessageCombiner.ts",
"ui/message/StructuredResponseRender.ts",
"ui/message/StructuredResponseController.ts",
"ui/message/GlobalActionsRow.ts",
"ui/markdown/MarkdownRenderers.ts",
"ui/model_selector/ModelSelector.ts",
Expand Down Expand Up @@ -276,6 +298,11 @@ _ai_chat_sources = [
"ui/FileContentViewer.ts",
"ui/mcp/MCPConnectionsDialog.ts",
"ui/mcp/MCPConnectorsCatalogDialog.ts",
"ui/SchemaEditor.ts",
"ui/AgentStudioView.ts",
"ui/AgentStudioController.ts",
"ui/AgentStudioBridge.ts",
"ui/agent_studio/AgentStudioSPA.ts",
"ai_chat_impl.ts",
"models/ChatTypes.ts",
"core/Graph.ts",
Expand All @@ -284,8 +311,7 @@ _ai_chat_sources = [
"core/AgentService.ts",
"core/Constants.ts",
"core/BuildConfig.ts",
"core/structured_response.ts",
"core/GraphConfigs.ts",
"core/GraphConfigs.ts",
"core/ConfigurableGraph.ts",
"core/BaseOrchestratorAgent.ts",
"core/AgentDescriptorRegistry.ts",
Expand Down Expand Up @@ -345,7 +371,23 @@ _ai_chat_sources = [
"tools/RenderWebAppTool.ts",
"tools/GetWebAppDataTool.ts",
"tools/RemoveWebAppTool.ts",
"tools/SaveResearchReportTool.ts",
"tools/SearchCustomAgentsTool.ts",
"tools/CallCustomAgentTool.ts",
"tools/VisualIndicatorTool.ts",
"tools/mini_app/ListMiniAppsTool.ts",
"tools/mini_app/LaunchMiniAppTool.ts",
"tools/mini_app/GetMiniAppStateTool.ts",
"tools/mini_app/UpdateMiniAppStateTool.ts",
"tools/mini_app/ExecuteMiniAppActionTool.ts",
"tools/mini_app/CloseMiniAppTool.ts",
"mini_apps/types/MiniAppTypes.ts",
"mini_apps/MiniAppRegistry.ts",
"mini_apps/GenericMiniAppBridge.ts",
"mini_apps/MiniAppStorageManager.ts",
"mini_apps/MiniAppEventBus.ts",
"mini_apps/MiniAppInitialization.ts",
"mini_apps/apps/agent_studio/AgentStudioMiniApp.ts",
"agent_framework/ConfigurableAgentTool.ts",
"agent_framework/AgentRunner.ts",
"agent_framework/AgentRunnerEventBus.ts",
Expand Down Expand Up @@ -495,11 +537,15 @@ ts_library("unittests") {
"ui/__tests__/WebAppCodeViewer.test.ts",
"ui/input/__tests__/InputBarClear.test.ts",
"ui/message/__tests__/MessageCombiner.test.ts",
"ui/message/__tests__/StructuredResponseController.test.ts",
"LLM/__tests__/MessageSanitizer.test.ts",
"agent_framework/__tests__/AgentRunner.sanitizeToolResult.test.ts",
"agent_framework/__tests__/AgentRunner.computeToolResultText.test.ts",
"agent_framework/__tests__/AgentRunner.run.flows.test.ts",
"agent_framework/__tests__/AgentRunner.core.test.ts",
"agent_framework/__tests__/AgentRunner.handoff.test.ts",
"agent_framework/__tests__/ConfigurableAgentTool.test.ts",
"agent_framework/__tests__/ToolRegistry.test.ts",
"agent_framework/__tests__/AgentRunnerEventBus.test.ts",
"mcp/__tests__/MCPClientSDK.test.ts",
"mcp/__tests__/MCPConfig.test.ts",
"mcp/__tests__/MCPIntegration.test.ts",
Expand All @@ -510,6 +556,7 @@ ts_library("unittests") {
"core/__tests__/ToolNameMap.test.ts",
"core/__tests__/ToolNameMapping.test.ts",
"core/__tests__/ToolSurfaceProvider.test.ts",
"core/__tests__/StateGraph.core.test.ts",
"ui/__tests__/AIChatPanel.test.ts",
"ui/__tests__/LiveAgentSessionComponent.test.ts",
"ui/message/__tests__/MessageList.test.ts",
Expand All @@ -518,10 +565,15 @@ ts_library("unittests") {
"tools/__tests__/ReadFileTool.test.ts",
"tools/__tests__/ListFilesTool.test.ts",
"tools/__tests__/FileStorageManager.test.ts",
"tools/mini_app/__tests__/MiniAppTools.test.ts",
"mini_apps/__tests__/MiniAppRegistry.test.ts",
"mini_apps/__tests__/GenericMiniAppBridge.test.ts",
"mini_apps/__tests__/MiniAppEventBus.test.ts",
]

deps = [
":ai_chat",
"testing:testing",
"../../testing",
"../../core/sdk:bundle",
"../../generated:protocol",
Expand Down
6 changes: 4 additions & 2 deletions front_end/panels/ai_chat/agent_framework/AgentRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,19 +402,21 @@ export class AgentRunner {
...(actualResult.intermediateSteps || []) // History *from* the recursive call (should exist if flag is true)
];
// Return the result from the target agent, but with combined history
// Always use 'handed_off' since this IS a handoff completion
return {
...actualResult,
intermediateSteps: combinedIntermediateSteps,
terminationReason: actualResult.terminationReason || 'handed_off',
terminationReason: 'handed_off' as const,
agentSession: childSession
};
}
// Otherwise (default), omit the target's intermediate steps
logger.info(`Omitting intermediateSteps from ${targetAgentTool.name} based on its config (default or flag set to false).`);
// Return result from target, ensuring intermediateSteps are omitted
// Always use 'handed_off' since this IS a handoff completion
const finalResult = {
...actualResult,
terminationReason: actualResult.terminationReason || 'handed_off',
terminationReason: 'handed_off' as const,
agentSession: childSession
};
// Explicitly delete intermediateSteps if they somehow exist on actualResult (shouldn't due to target config)
Expand Down
Loading