Procházet zdrojové kódy

Fix small typing errors

Fix test
Kevin van Dijk před 7 měsíci
rodič
revize
0fcd41ff45

+ 1 - 2
src/activate/registerCommands.ts

@@ -5,8 +5,7 @@ import type { CommandId } from "@roo-code/types"
 
 import { getCommand } from "../utils/commands"
 import { ClineProvider } from "../core/webview/ClineProvider"
-import { t } from "../i18n" // kilocode_change
-import { importSettings, exportSettings } from "../core/config/importExport" // kilocode_change
+import { exportSettings } from "../core/config/importExport" // kilocode_change
 import { ContextProxy } from "../core/config/ContextProxy"
 import { focusPanel } from "../utils/focusPanel"
 

+ 5 - 0
src/api/providers/__tests__/claude-code-caching.spec.ts

@@ -48,6 +48,7 @@ describe("ClaudeCodeHandler - Caching Support", () => {
 					output_tokens: 50,
 					cache_read_input_tokens: 80, // 80 tokens read from cache
 					cache_creation_input_tokens: 20, // 20 new tokens cached
+					server_tool_use: null,
 				},
 				stop_reason: "end_turn",
 				stop_sequence: null,
@@ -114,6 +115,7 @@ describe("ClaudeCodeHandler - Caching Support", () => {
 					output_tokens: 25,
 					cache_read_input_tokens: 40,
 					cache_creation_input_tokens: 10,
+					server_tool_use: null,
 				},
 				stop_reason: null,
 				stop_sequence: null,
@@ -137,6 +139,7 @@ describe("ClaudeCodeHandler - Caching Support", () => {
 					output_tokens: 25,
 					cache_read_input_tokens: 30,
 					cache_creation_input_tokens: 20,
+					server_tool_use: null,
 				},
 				stop_reason: "end_turn",
 				stop_sequence: null,
@@ -201,6 +204,7 @@ describe("ClaudeCodeHandler - Caching Support", () => {
 					output_tokens: 50,
 					cache_read_input_tokens: null,
 					cache_creation_input_tokens: null,
+					server_tool_use: null,
 				},
 				stop_reason: "end_turn",
 				stop_sequence: null,
@@ -265,6 +269,7 @@ describe("ClaudeCodeHandler - Caching Support", () => {
 					output_tokens: 50,
 					cache_read_input_tokens: 80,
 					cache_creation_input_tokens: 20,
+					server_tool_use: null,
 				},
 				stop_reason: "end_turn",
 				stop_sequence: null,

+ 1 - 0
src/core/webview/__tests__/ClineProvider.spec.ts

@@ -2161,6 +2161,7 @@ describe.skip("getTelemetryProperties", () => {
 		provider = new ClineProvider(mockContext, mockOutputChannel, "sidebar", new ContextProxy(mockContext))
 
 		defaultTaskOptions = {
+			context: mockContext,
 			provider,
 			apiConfiguration: {
 				apiProvider: "openrouter",

+ 1 - 1
src/integrations/claude-code/message-filter.ts

@@ -18,7 +18,7 @@ export function filterMessagesForClaudeCode(
 			if (block.type === "image") {
 				// Replace image blocks with text placeholders
 				const sourceType = block.source?.type || "unknown"
-				const mediaType = block.source?.media_type || "unknown"
+				const mediaType = block.source && "media_type" in block.source ? block.source.media_type : "unknown"
 				return {
 					type: "text" as const,
 					text: `[Image (${sourceType}): ${mediaType} not supported by Claude Code]`,