Skip to content

Commit 73208b8

Browse files
authored
Version tracker, tracing enhancements and ui changes (#26)
## Pull Request Overview This PR adds comprehensive version tracking, enhanced tracing capabilities, and UI improvements to the AI Chat panel. Key additions include automated version checking with update notifications, hierarchical distributed tracing for better observability, and improved user interface elements with accessibility testing infrastructure. - Version tracking system with automated update notifications and GitHub release integration - Enhanced hierarchical tracing with improved agent execution observability - UI improvements including better model selection, updated styling, and agent session visualization - Comprehensive accessibility testing infrastructure with e2e test resources - **Visual Verifier**: Added screenshot-based visual verification for action results with multimodal LLM analysis - **Thinking Tools**: Implemented high-level and sequential thinking tools for better agent planning and reasoning - **Wait Tool**: Added intelligent waiting functionality with content analysis for dynamic pages - **Enhanced Error Handling**: Comprehensive error recovery with retry logic and graceful degradation
1 parent 05e5a47 commit 73208b8

File tree

63 files changed

+9158
-973
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+9158
-973
lines changed

config/gni/devtools_grd_files.gni

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -608,10 +608,6 @@ grd_files_bundled_sources = [
608608
"front_end/panels/ai_chat/ui/PromptEditDialog.js",
609609
"front_end/panels/ai_chat/ui/SettingsDialog.js",
610610
"front_end/panels/ai_chat/ui/EvaluationDialog.js",
611-
"front_end/panels/ai_chat/ui/components/TracingConfig.js",
612-
"front_end/panels/ai_chat/ui/components/EvaluationConfig.js",
613-
"front_end/panels/ai_chat/ui/components/VectorDatabaseConfig.js",
614-
"front_end/panels/ai_chat/ui/components/ProviderConfig.js",
615611
"front_end/panels/ai_chat/core/AgentService.js",
616612
"front_end/panels/ai_chat/core/State.js",
617613
"front_end/panels/ai_chat/core/Graph.js",
@@ -625,6 +621,9 @@ grd_files_bundled_sources = [
625621
"front_end/panels/ai_chat/core/GraphHelpers.js",
626622
"front_end/panels/ai_chat/core/StateGraph.js",
627623
"front_end/panels/ai_chat/core/Logger.js",
624+
"front_end/panels/ai_chat/core/AgentErrorHandler.js",
625+
"front_end/panels/ai_chat/core/Version.js",
626+
"front_end/panels/ai_chat/core/VersionChecker.js",
628627
"front_end/panels/ai_chat/LLM/LLMTypes.js",
629628
"front_end/panels/ai_chat/LLM/LLMProvider.js",
630629
"front_end/panels/ai_chat/LLM/LLMProviderRegistry.js",
@@ -648,6 +647,8 @@ grd_files_bundled_sources = [
648647
"front_end/panels/ai_chat/tools/VectorDBClient.js",
649648
"front_end/panels/ai_chat/tools/BookmarkStoreTool.js",
650649
"front_end/panels/ai_chat/tools/DocumentSearchTool.js",
650+
"front_end/panels/ai_chat/tools/SequentialThinkingTool.js",
651+
"front_end/panels/ai_chat/tools/ThinkingTool.js",
651652
"front_end/panels/ai_chat/common/utils.js",
652653
"front_end/panels/ai_chat/common/log.js",
653654
"front_end/panels/ai_chat/common/context.js",
@@ -665,6 +666,7 @@ grd_files_bundled_sources = [
665666
"front_end/panels/ai_chat/ai_chat.js",
666667
"front_end/panels/ai_chat/ai_chat_impl.js",
667668
"front_end/panels/ai_chat/agent_framework/AgentRunner.js",
669+
"front_end/panels/ai_chat/agent_framework/AgentSessionTypes.js",
668670
"front_end/panels/ai_chat/agent_framework/ConfigurableAgentTool.js",
669671
"front_end/panels/ai_chat/agent_framework/implementation/ConfiguredAgents.js",
670672
"front_end/panels/ai_chat/common/MarkdownViewerUtil.js",

front_end/BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ group("unittests") {
159159
"models/workspace_diff:unittests",
160160
"panels/accessibility:unittests",
161161
"panels/ai_assistance:unittests",
162+
"panels/ai_chat:unittests",
162163
"panels/animation:unittests",
163164
"panels/application:unittests",
164165
"panels/application/components:unittests",

front_end/panels/ai_chat/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Optional: Uncomment the line below if you want to exclude the auto-generated Version.ts
2+
# core/Version.ts
3+
4+
# Temporary files
5+
*.tmp
6+
*.log

front_end/panels/ai_chat/BUILD.gn

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ devtools_module("ai_chat") {
3636
"core/GraphHelpers.ts",
3737
"core/StateGraph.ts",
3838
"core/Logger.ts",
39+
"core/AgentErrorHandler.ts",
40+
"core/Version.ts",
41+
"core/VersionChecker.ts",
3942
"LLM/LLMTypes.ts",
4043
"LLM/LLMProvider.ts",
4144
"LLM/LLMProviderRegistry.ts",
@@ -59,8 +62,11 @@ devtools_module("ai_chat") {
5962
"tools/VectorDBClient.ts",
6063
"tools/BookmarkStoreTool.ts",
6164
"tools/DocumentSearchTool.ts",
65+
"tools/SequentialThinkingTool.ts",
66+
"tools/ThinkingTool.ts",
6267
"agent_framework/ConfigurableAgentTool.ts",
6368
"agent_framework/AgentRunner.ts",
69+
"agent_framework/AgentSessionTypes.ts",
6470
"agent_framework/implementation/ConfiguredAgents.ts",
6571
"evaluation/framework/types.ts",
6672
"evaluation/framework/judges/LLMEvaluator.ts",
@@ -90,10 +96,6 @@ devtools_module("ai_chat") {
9096
"tracing/TracingProvider.ts",
9197
"tracing/LangfuseProvider.ts",
9298
"tracing/TracingConfig.ts",
93-
"ui/components/TracingConfig.ts",
94-
"ui/components/EvaluationConfig.ts",
95-
"ui/components/VectorDatabaseConfig.ts",
96-
"ui/components/ProviderConfig.ts",
9799
"auth/PKCEUtils.ts",
98100
"auth/OpenRouterOAuth.ts",
99101
]
@@ -124,10 +126,6 @@ _ai_chat_sources = [
124126
"ui/PromptEditDialog.ts",
125127
"ui/SettingsDialog.ts",
126128
"ui/EvaluationDialog.ts",
127-
"ui/components/TracingConfig.ts",
128-
"ui/components/EvaluationConfig.ts",
129-
"ui/components/VectorDatabaseConfig.ts",
130-
"ui/components/ProviderConfig.ts",
131129
"ai_chat_impl.ts",
132130
"core/Graph.ts",
133131
"core/State.ts",
@@ -142,6 +140,9 @@ _ai_chat_sources = [
142140
"core/GraphHelpers.ts",
143141
"core/StateGraph.ts",
144142
"core/Logger.ts",
143+
"core/AgentErrorHandler.ts",
144+
"core/Version.ts",
145+
"core/VersionChecker.ts",
145146
"LLM/LLMTypes.ts",
146147
"LLM/LLMProvider.ts",
147148
"LLM/LLMProviderRegistry.ts",
@@ -165,8 +166,11 @@ _ai_chat_sources = [
165166
"tools/VectorDBClient.ts",
166167
"tools/BookmarkStoreTool.ts",
167168
"tools/DocumentSearchTool.ts",
169+
"tools/SequentialThinkingTool.ts",
170+
"tools/ThinkingTool.ts",
168171
"agent_framework/ConfigurableAgentTool.ts",
169172
"agent_framework/AgentRunner.ts",
173+
"agent_framework/AgentSessionTypes.ts",
170174
"agent_framework/implementation/ConfiguredAgents.ts",
171175
"evaluation/framework/types.ts",
172176
"evaluation/framework/judges/LLMEvaluator.ts",
@@ -276,3 +280,18 @@ devtools_entrypoint("meta") {
276280

277281
visibility = [ "../../entrypoints/*" ]
278282
}
283+
284+
ts_library("unittests") {
285+
testonly = true
286+
287+
sources = [
288+
"common/utils.test.ts",
289+
]
290+
291+
deps = [
292+
":ai_chat",
293+
"../../testing",
294+
"../../core/sdk:bundle",
295+
"../../generated:protocol",
296+
]
297+
}

front_end/panels/ai_chat/LLM/LLMClient.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
import type { LLMMessage, LLMResponse, LLMCallOptions, LLMProvider, ModelInfo } from './LLMTypes.js';
5+
import type { LLMMessage, LLMResponse, LLMCallOptions, LLMProvider, ModelInfo, RetryConfig } from './LLMTypes.js';
66
import { LLMProviderRegistry } from './LLMProviderRegistry.js';
77
import { OpenAIProvider } from './OpenAIProvider.js';
88
import { LiteLLMProvider } from './LiteLLMProvider.js';
@@ -39,6 +39,7 @@ export interface LLMCallRequest {
3939
systemPrompt: string;
4040
tools?: any[];
4141
temperature?: number;
42+
retryConfig?: Partial<RetryConfig>;
4243
}
4344

4445
/**
@@ -150,6 +151,9 @@ export class LLMClient {
150151
if (request.tools) {
151152
options.tools = request.tools;
152153
}
154+
if (request.retryConfig) {
155+
options.retryConfig = request.retryConfig;
156+
}
153157

154158
return provider.callWithMessages(request.model, messages, options);
155159
}

front_end/panels/ai_chat/LLM/LLMTypes.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ export interface ExtendedRetryConfig extends ErrorRetryConfig {
142142
export type LLMProvider = 'openai' | 'litellm' | 'groq' | 'openrouter';
143143

144144
/**
145-
* Content types for multimodal messages (text + images)
145+
* Content types for multimodal messages (text + images + files)
146146
*/
147147
export type MessageContent =
148148
| string
149-
| Array<TextContent | ImageContent>;
149+
| Array<TextContent | ImageContent | FileContent>;
150150

151151
export interface TextContent {
152152
type: 'text';
@@ -161,9 +161,17 @@ export interface ImageContent {
161161
};
162162
}
163163

164+
export interface FileContent {
165+
type: 'file';
166+
file: {
167+
filename: string;
168+
file_data: string; // Base64 encoded data URL (e.g., "data:application/pdf;base64,...")
169+
};
170+
}
171+
164172
/**
165173
* Message format compatible with OpenAI and LiteLLM APIs
166-
* Supports both text-only and multimodal (text + images) content
174+
* Supports both text-only and multimodal (text + images + PDFs) content
167175
*/
168176
export interface LLMMessage {
169177
role: 'system' | 'user' | 'assistant' | 'tool';

front_end/panels/ai_chat/LLM/OpenAIProvider.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class OpenAIProvider extends LLMBaseProvider {
8181
* Throws error if conversion fails
8282
*/
8383
private convertContentToResponsesAPI(content: MessageContent | undefined, modelFamily: ModelFamily): any {
84-
// For GPT models, return simple string content
84+
// For GPT models (including GPT-4.1), handle content conversion
8585
if (modelFamily === ModelFamily.GPT) {
8686
if (!content) {
8787
return '';
@@ -91,15 +91,16 @@ export class OpenAIProvider extends LLMBaseProvider {
9191
}
9292
// For multimodal content on GPT models, we need to return the structured format
9393
if (Array.isArray(content)) {
94-
// Return as OpenAI Chat API format for GPT models
94+
// All models use Responses API format since we're using /v1/responses endpoint
95+
// This includes GPT-4.1 models which require input_text/input_image types
9596
return content.map((item, index) => {
9697
if (item.type === 'text') {
97-
return { type: 'text', text: item.text };
98+
return { type: 'input_text', text: item.text };
9899
} else if (item.type === 'image_url') {
99100
if (!item.image_url?.url) {
100101
throw new Error(`Invalid image content at index ${index}: missing image_url.url`);
101102
}
102-
return { type: 'image_url', image_url: item.image_url };
103+
return { type: 'input_image', image_url: item.image_url.url };
103104
} else {
104105
throw new Error(`Unknown content type at index ${index}: ${(item as any).type}`);
105106
}
@@ -458,6 +459,17 @@ export class OpenAIProvider extends LLMBaseProvider {
458459
vision: true,
459460
structured: true
460461
}
462+
},
463+
{
464+
id: 'o3-mini-2025-01-31',
465+
name: 'O3 Mini',
466+
provider: 'openai',
467+
capabilities: {
468+
functionCalling: true,
469+
reasoning: true,
470+
vision: false,
471+
structured: true
472+
}
461473
}
462474
];
463475
}

0 commit comments

Comments
 (0)