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
116 changes: 57 additions & 59 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,57 @@
coverage:
precision: 2
round: down
status:
project:
default:
target: auto # never regress below current baseline
threshold: 1%
webview:
target: auto # webview project ratchet: never drop below current baseline
threshold: 0.5%
flags:
- webview-ui
- webview-ui-ct
patch:
default:
target: 80% # new lines must be 80% covered
threshold: 0%
webview-patch:
target: 70% # new lines in webview must be 70% covered
threshold: 0%
flags:
- webview-ui
- webview-ui-ct

flag_management:
individual_flags:
- name: webview-ui
paths:
- webview-ui/src/
carryforward: true
- name: webview-ui-ct
paths:
- webview-ui/src/
carryforward: true
- name: core-unit
paths:
- packages/core/src/
carryforward: true
- name: core-integration
paths:
- packages/core/src/
carryforward: true

component_management:
individual_components:
- component_id: webview_components
name: "Webview UI Components"
paths:
- webview-ui/src/components/
- component_id: webview_state
name: "Webview State & Context"
paths:
- webview-ui/src/context/
- webview-ui/src/state/

comment:
layout: "diff, flags, components"
behavior: default
coverage:
precision: 2
round: down
status:
project:
default:
target: auto # never regress below current baseline
threshold: 1%
webview:
target: auto # webview project ratchet: never drop below current baseline
threshold: 0.5%
flags:
- webview-ui
- webview-ui-ct
patch:
default:
informational: true # patch coverage is advisory, not blocking
webview-patch:
informational: true # patch coverage is advisory, not blocking
flags:
- webview-ui
- webview-ui-ct

flag_management:
individual_flags:
- name: webview-ui
paths:
- webview-ui/src/
carryforward: true
- name: webview-ui-ct
paths:
- webview-ui/src/
carryforward: true
- name: core-unit
paths:
- packages/core/src/
carryforward: true
- name: core-integration
paths:
- packages/core/src/
carryforward: true

component_management:
individual_components:
- component_id: webview_components
name: "Webview UI Components"
paths:
- webview-ui/src/components/
- component_id: webview_state
name: "Webview State & Context"
paths:
- webview-ui/src/context/
- webview-ui/src/state/

comment:
layout: "diff, flags, components"
behavior: default
28 changes: 2 additions & 26 deletions packages/telemetry/src/TelemetryService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
type TelemetryPropertiesProvider,
TelemetryEventName,
type TelemetrySetting,
type ToolUsage,
} from "@roo-code/types"

/**
Expand Down Expand Up @@ -183,31 +182,8 @@ export class TelemetryService {
this.captureEvent(TelemetryEventName.TASK_RESTARTED, { taskId })
}

/**
* Captures task completion, summarizing per-task tool and message counts that
* were previously reported as separate per-turn events to reduce event volume.
*
* A single task may emit this more than once (e.g. an "idle" or "shutdown"
* installment followed by a final "attempt_completion" one). toolsUsed and
* messageCount are always deltas since the previous emission for that task,
* not running totals -- summing installments for a taskId reconstructs the
* full-task counts without double-counting.
*
* Note: "attempt_completion" means the model called that tool, not that the
* user accepted the result.
*/
public captureTaskCompleted(
taskId: string,
toolsUsed?: ToolUsage,
messageCount?: { user: number; assistant: number },
completionReason: "attempt_completion" | "idle" | "shutdown" = "attempt_completion",
): void {
this.captureEvent(TelemetryEventName.TASK_COMPLETED, {
taskId,
completionReason,
...(toolsUsed !== undefined && { toolsUsed }),
...(messageCount !== undefined && { messageCount }),
})
public captureTaskCompleted(taskId: string): void {
this.captureEvent(TelemetryEventName.TASK_COMPLETED, { taskId })
}

public captureConversationMessage(taskId: string, source: "user" | "assistant"): void {
Expand Down

This file was deleted.

72 changes: 72 additions & 0 deletions packages/types/src/__tests__/provider-settings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,75 @@ describe("getApiProtocol", () => {
})
})
})

describe("openAiToolStrictMode", () => {
it("should be optional and absent by default", () => {
const result = providerSettingsSchemaDiscriminated.parse({
apiProvider: "openai",
openAiModelId: "test-model",
})
expect(result.apiProvider).toBe("openai")
if (result.apiProvider === "openai") {
expect(result.openAiToolStrictMode).toBeUndefined()
}
})

it("should accept true when provided", () => {
const result = providerSettingsSchemaDiscriminated.parse({
apiProvider: "openai",
openAiModelId: "test-model",
openAiToolStrictMode: true,
})
expect(result.apiProvider).toBe("openai")
if (result.apiProvider === "openai") {
expect(result.openAiToolStrictMode).toBe(true)
}
})

it("should accept false when provided", () => {
const result = providerSettingsSchemaDiscriminated.parse({
apiProvider: "openai",
openAiModelId: "test-model",
openAiToolStrictMode: false,
})
expect(result.apiProvider).toBe("openai")
if (result.apiProvider === "openai") {
expect(result.openAiToolStrictMode).toBe(false)
}
})

it("should not break existing profile deserialization when absent", () => {
const existingProfile = {
apiProvider: "openai" as const,
openAiBaseUrl: "https://api.example.com/v1",
openAiApiKey: "sk-test",
openAiModelId: "gpt-4",
openAiStreamingEnabled: true,
}
const result = providerSettingsSchemaDiscriminated.parse(existingProfile)
expect(result.apiProvider).toBe("openai")
if (result.apiProvider === "openai") {
expect(result.openAiModelId).toBe("gpt-4")
expect(result.openAiToolStrictMode).toBeUndefined()
}
})

it("should only exist on the openai (OpenAI Compatible) provider profile", () => {
const openAiResult = providerSettingsSchemaDiscriminated.parse({
apiProvider: "openai",
openAiToolStrictMode: true,
})
expect(openAiResult.apiProvider).toBe("openai")
if (openAiResult.apiProvider === "openai") {
expect(openAiResult.openAiToolStrictMode).toBe(true)
}

// Anthropic provider should not have this field
const anthropicResult = providerSettingsSchemaDiscriminated.parse({
apiProvider: "anthropic",
apiKey: "sk-test",
})
expect(anthropicResult.apiProvider).toBe("anthropic")
expect((anthropicResult as Record<string, unknown>).openAiToolStrictMode).toBeUndefined()
})
})
1 change: 1 addition & 0 deletions packages/types/src/provider-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ const openAiSchema = baseProviderSettingsSchema.extend({
openAiStreamingEnabled: z.boolean().optional(),
openAiHostHeader: z.string().optional(), // Keep temporarily for backward compatibility during migration.
openAiHeaders: z.record(z.string(), z.string()).optional(),
openAiToolStrictMode: z.boolean().optional(), // Profile-scoped strict function-tool schema toggle for OpenAI Compatible provider. Absent = false (backward compatible).
})

const ollamaSchema = baseProviderSettingsSchema.extend({
Expand Down
50 changes: 37 additions & 13 deletions packages/types/src/providers/deepseek.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,56 @@ export const deepSeekModels = {
contextWindow: 1_000_000,
supportsImages: true,
supportsPromptCache: true,
supportsReasoningEffort: ["disable", "low", "high", "max"], // Updated 2026-08-01
supportsReasoningEffort: ["disable", "low", "medium", "high", "xhigh"],
preserveReasoning: true,
reasoningEffort: "high",
inputPrice: 0, // the inputs are priced as cache read/write, so `inputPrice` should be 0
// the peak/off-peak pricing policy has not been implemented yet - Updated 2026-08-01
outputPrice: 0.28, // $0.28 per million tokens - Updated 2026-08-01
cacheWritesPrice: 0.14, // $0.14 per million tokens (cache miss) - Updated 2026-08-01
cacheReadsPrice: 0.0028, // $0.0028 per million tokens (cache hit) - Updated 2026-08-01
inputPrice: 0.14, // $0.14 per million tokens (cache miss) - Updated Apr 29, 2026
outputPrice: 0.28, // $0.28 per million tokens - Updated Apr 29, 2026
cacheWritesPrice: 0.14, // $0.14 per million tokens (cache miss) - Updated Apr 29, 2026
cacheReadsPrice: 0.0028, // $0.0028 per million tokens (cache hit) - Updated Apr 29, 2026
description: `DeepSeek-V4-Flash is DeepSeek's fast, cost-efficient V4 model. It supports thinking and non-thinking modes, JSON output, tool calls, chat prefix completion (beta), and FIM completion (beta) in non-thinking mode.`,
},
"deepseek-v4-pro": {
maxTokens: 384_000,
contextWindow: 1_000_000,
supportsImages: true,
supportsPromptCache: true,
supportsReasoningEffort: ["disable", "high", "max"], // Updated 2026-08-01
supportsReasoningEffort: ["disable", "low", "medium", "high", "xhigh"],
preserveReasoning: true,
reasoningEffort: "high",
inputPrice: 0, // the inputs are priced as cache read/write, so `inputPrice` should be 0
// the peak/off-peak pricing policy has not been implemented yet - Updated 2026-08-01
outputPrice: 0.87, // $0.87 per million tokens - Updated 2026-08-01
cacheWritesPrice: 0.435, // $0.435 per million tokens (cache miss) - Updated 2026-08-01
cacheReadsPrice: 0.003625, // $0.003625 per million tokens (cache hit) - Updated 2026-08-01
// TODO(deepseek): Re-check V4 Pro discounted prices after DeepSeek's 2026-05-31 discount end date.
inputPrice: 0.435, // $0.435 per million tokens (cache miss, discounted) - Updated Apr 29, 2026
outputPrice: 0.87, // $0.87 per million tokens (discounted) - Updated Apr 29, 2026
cacheWritesPrice: 0.435, // $0.435 per million tokens (cache miss, discounted) - Updated Apr 29, 2026
cacheReadsPrice: 0.003625, // $0.003625 per million tokens (cache hit, discounted) - Updated Apr 29, 2026
description: `DeepSeek-V4-Pro is DeepSeek's strongest V4 model for reasoning, coding, long-context, and agentic workloads. It supports thinking and non-thinking modes, JSON output, tool calls, chat prefix completion (beta), and FIM completion (beta) in non-thinking mode.`,
},
// TODO(deepseek): Remove this compatibility alias after DeepSeek's 2026-07-24 retirement date.
"deepseek-chat": {
maxTokens: 8192, // 8K max output
contextWindow: 128_000,
supportsImages: false,
supportsPromptCache: true,
inputPrice: 0.28, // $0.28 per million tokens (cache miss) - Updated Dec 9, 2025
outputPrice: 0.42, // $0.42 per million tokens - Updated Dec 9, 2025
cacheWritesPrice: 0.28, // $0.28 per million tokens (cache miss) - Updated Dec 9, 2025
cacheReadsPrice: 0.028, // $0.028 per million tokens (cache hit) - Updated Dec 9, 2025
description: `Legacy compatibility alias for the non-thinking mode of deepseek-v4-flash. DeepSeek plans to deprecate this model name on 2026-07-24.`,
},
// TODO(deepseek): Remove this compatibility alias after DeepSeek's 2026-07-24 retirement date.
"deepseek-reasoner": {
maxTokens: 8192, // 8K max output
contextWindow: 128_000,
supportsImages: false,
supportsPromptCache: true,
preserveReasoning: true,
inputPrice: 0.28, // $0.28 per million tokens (cache miss) - Updated Dec 9, 2025
outputPrice: 0.42, // $0.42 per million tokens - Updated Dec 9, 2025
cacheWritesPrice: 0.28, // $0.28 per million tokens (cache miss) - Updated Dec 9, 2025
cacheReadsPrice: 0.028, // $0.028 per million tokens (cache hit) - Updated Dec 9, 2025
description: `Legacy compatibility alias for the thinking mode of deepseek-v4-flash. DeepSeek plans to deprecate this model name on 2026-07-24.`,
},
} as const satisfies Record<string, ModelInfo>

// https://api-docs.deepseek.com/quick_start/parameter_settings
export const DEEP_SEEK_DEFAULT_TEMPERATURE = 0.0
export const DEEP_SEEK_DEFAULT_TEMPERATURE = 0.3
3 changes: 1 addition & 2 deletions src/__tests__/history-resume-delegation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ vi.mock("vscode", () => {
return { window, workspace, env, Uri, commands, ExtensionMode, version }
})

// Mock TelemetryService (needed by attemptCompletionTool's emitPublicTaskCompleted)
// Mock TelemetryService (needed by attemptCompletionTool's emitTaskCompleted)
vi.mock("@roo-code/telemetry", () => ({
TelemetryService: {
instance: {
Expand Down Expand Up @@ -1255,7 +1255,6 @@ describe("History resume delegation - parent metadata transitions", () => {
userMessageContent: [],
consecutiveMistakeCount: 0,
emitFinalTokenUsageUpdate: vi.fn(),
flushTelemetryInstallment: vi.fn(),
} as unknown as import("../core/task/Task").Task

const block = {
Expand Down
Loading
Loading