Skip to content

Commit 3431d4f

Browse files
committed
Add tests
1 parent c11bf8f commit 3431d4f

34 files changed

+11036
-147
lines changed

config/gni/devtools_grd_files.gni

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,11 @@ grd_files_bundled_sources = [
661661
"front_end/panels/ai_chat/ui/TodoListDisplay.js",
662662
"front_end/panels/ai_chat/ui/FileListDisplay.js",
663663
"front_end/panels/ai_chat/ui/FileContentViewer.js",
664+
"front_end/panels/ai_chat/ui/AgentStudioBridge.js",
665+
"front_end/panels/ai_chat/ui/AgentStudioController.js",
666+
"front_end/panels/ai_chat/ui/AgentStudioView.js",
667+
"front_end/panels/ai_chat/ui/SchemaEditor.js",
668+
"front_end/panels/ai_chat/ui/agent_studio/AgentStudioSPA.js",
664669
"front_end/panels/ai_chat/ui/settings/advanced/BrowsingHistorySettings.js",
665670
"front_end/panels/ai_chat/ui/settings/advanced/EvaluationSettings.js",
666671
"front_end/panels/ai_chat/ui/settings/advanced/MCPSettings.js",
@@ -703,6 +708,9 @@ grd_files_bundled_sources = [
703708
"front_end/panels/ai_chat/core/VersionChecker.js",
704709
"front_end/panels/ai_chat/core/LLMConfigurationManager.js",
705710
"front_end/panels/ai_chat/core/CustomProviderManager.js",
711+
"front_end/panels/ai_chat/core/AgentStorageManager.js",
712+
"front_end/panels/ai_chat/core/AgentStudioIntegration.js",
713+
"front_end/panels/ai_chat/core/AgentTestRunner.js",
706714
"front_end/panels/ai_chat/LLM/LLMTypes.js",
707715
"front_end/panels/ai_chat/LLM/LLMProvider.js",
708716
"front_end/panels/ai_chat/LLM/LLMProviderRegistry.js",
@@ -748,10 +756,25 @@ grd_files_bundled_sources = [
748756
"front_end/panels/ai_chat/tools/UpdateTodoTool.js",
749757
"front_end/panels/ai_chat/tools/VisualIndicatorTool.js",
750758
"front_end/panels/ai_chat/tools/ReadabilityExtractorTool.js",
759+
"front_end/panels/ai_chat/tools/CallCustomAgentTool.js",
760+
"front_end/panels/ai_chat/tools/SearchCustomAgentsTool.js",
761+
"front_end/panels/ai_chat/tools/mini_app/CloseMiniAppTool.js",
762+
"front_end/panels/ai_chat/tools/mini_app/ExecuteMiniAppActionTool.js",
763+
"front_end/panels/ai_chat/tools/mini_app/GetMiniAppStateTool.js",
764+
"front_end/panels/ai_chat/tools/mini_app/LaunchMiniAppTool.js",
765+
"front_end/panels/ai_chat/tools/mini_app/ListMiniAppsTool.js",
766+
"front_end/panels/ai_chat/tools/mini_app/UpdateMiniAppStateTool.js",
751767
"front_end/panels/ai_chat/common/utils.js",
752768
"front_end/panels/ai_chat/common/log.js",
753769
"front_end/panels/ai_chat/common/context.js",
754770
"front_end/panels/ai_chat/common/page.js",
771+
"front_end/panels/ai_chat/mini_apps/GenericMiniAppBridge.js",
772+
"front_end/panels/ai_chat/mini_apps/MiniAppEventBus.js",
773+
"front_end/panels/ai_chat/mini_apps/MiniAppInitialization.js",
774+
"front_end/panels/ai_chat/mini_apps/MiniAppRegistry.js",
775+
"front_end/panels/ai_chat/mini_apps/MiniAppStorageManager.js",
776+
"front_end/panels/ai_chat/mini_apps/apps/agent_studio/AgentStudioMiniApp.js",
777+
"front_end/panels/ai_chat/mini_apps/types/MiniAppTypes.js",
755778
"front_end/panels/ai_chat/models/ChatTypes.js",
756779
"front_end/panels/ai_chat/ui/input/ChatInput.js",
757780
"front_end/panels/ai_chat/ui/input/InputBar.js",

front_end/panels/ai_chat/BUILD.gn

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,15 @@ ts_library("unittests") {
537537
"ui/__tests__/WebAppCodeViewer.test.ts",
538538
"ui/input/__tests__/InputBarClear.test.ts",
539539
"ui/message/__tests__/MessageCombiner.test.ts",
540-
"LLM/__tests__/MessageSanitizer.test.ts",
540+
"LLM/__tests__/MessageSanitizer.test.ts",
541541
"agent_framework/__tests__/AgentRunner.sanitizeToolResult.test.ts",
542542
"agent_framework/__tests__/AgentRunner.computeToolResultText.test.ts",
543543
"agent_framework/__tests__/AgentRunner.run.flows.test.ts",
544+
"agent_framework/__tests__/AgentRunner.core.test.ts",
545+
"agent_framework/__tests__/AgentRunner.handoff.test.ts",
546+
"agent_framework/__tests__/ConfigurableAgentTool.test.ts",
547+
"agent_framework/__tests__/ToolRegistry.test.ts",
548+
"agent_framework/__tests__/AgentRunnerEventBus.test.ts",
544549
"mcp/__tests__/MCPClientSDK.test.ts",
545550
"mcp/__tests__/MCPConfig.test.ts",
546551
"mcp/__tests__/MCPIntegration.test.ts",
@@ -551,6 +556,7 @@ ts_library("unittests") {
551556
"core/__tests__/ToolNameMap.test.ts",
552557
"core/__tests__/ToolNameMapping.test.ts",
553558
"core/__tests__/ToolSurfaceProvider.test.ts",
559+
"core/__tests__/StateGraph.core.test.ts",
554560
"ui/__tests__/AIChatPanel.test.ts",
555561
"ui/__tests__/LiveAgentSessionComponent.test.ts",
556562
"ui/message/__tests__/MessageList.test.ts",
@@ -559,10 +565,15 @@ ts_library("unittests") {
559565
"tools/__tests__/ReadFileTool.test.ts",
560566
"tools/__tests__/ListFilesTool.test.ts",
561567
"tools/__tests__/FileStorageManager.test.ts",
568+
"tools/mini_app/__tests__/MiniAppTools.test.ts",
569+
"mini_apps/__tests__/MiniAppRegistry.test.ts",
570+
"mini_apps/__tests__/GenericMiniAppBridge.test.ts",
571+
"mini_apps/__tests__/MiniAppEventBus.test.ts",
562572
]
563573

564574
deps = [
565575
":ai_chat",
576+
"testing:testing",
566577
"../../testing",
567578
"../../core/sdk:bundle",
568579
"../../generated:protocol",

front_end/panels/ai_chat/agent_framework/AgentRunner.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,19 +402,21 @@ export class AgentRunner {
402402
...(actualResult.intermediateSteps || []) // History *from* the recursive call (should exist if flag is true)
403403
];
404404
// Return the result from the target agent, but with combined history
405+
// Always use 'handed_off' since this IS a handoff completion
405406
return {
406407
...actualResult,
407408
intermediateSteps: combinedIntermediateSteps,
408-
terminationReason: actualResult.terminationReason || 'handed_off',
409+
terminationReason: 'handed_off' as const,
409410
agentSession: childSession
410411
};
411412
}
412413
// Otherwise (default), omit the target's intermediate steps
413414
logger.info(`Omitting intermediateSteps from ${targetAgentTool.name} based on its config (default or flag set to false).`);
414415
// Return result from target, ensuring intermediateSteps are omitted
416+
// Always use 'handed_off' since this IS a handoff completion
415417
const finalResult = {
416418
...actualResult,
417-
terminationReason: actualResult.terminationReason || 'handed_off',
419+
terminationReason: 'handed_off' as const,
418420
agentSession: childSession
419421
};
420422
// Explicitly delete intermediateSteps if they somehow exist on actualResult (shouldn't due to target config)

0 commit comments

Comments
 (0)