Merge branch 'dallin/search-replace-error-codes-con-3928' of https://github.com/continuedev/continue into dallin/search-replace-fallbacks-v2
This commit is contained in:
commit
c3cb3027d7
12 changed files with 3325 additions and 57058 deletions
11
core/core.ts
11
core/core.ts
|
|
@ -232,6 +232,17 @@ export class Core {
|
|||
return;
|
||||
}
|
||||
|
||||
// Check for disableIndexing to prevent race condition
|
||||
const { config } = await this.configHandler.loadConfig();
|
||||
if (!config || config.disableIndexing) {
|
||||
void this.messenger.request("indexProgress", {
|
||||
progress: 0,
|
||||
desc: "Indexing is disabled",
|
||||
status: "disabled",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
void this.codeBaseIndexer.refreshCodebaseIndex(dirs);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
60305
extensions/cli/package-lock.json
generated
60305
extensions/cli/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -188,7 +188,7 @@ All metrics and events share these standard attributes:
|
|||
|
||||
### ✅ Tool Result Event
|
||||
|
||||
**Event Name:** `continue_cli_tool_result`
|
||||
**Event Name:** `tool_result`
|
||||
|
||||
**Attributes:**
|
||||
|
||||
|
|
|
|||
5
extensions/cli/src/auth/authEnv.ts
Normal file
5
extensions/cli/src/auth/authEnv.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import * as path from "path";
|
||||
|
||||
import { env } from "../env.js";
|
||||
|
||||
export const AUTH_CONFIG_PATH = path.join(env.continueHome, "auth.json");
|
||||
|
|
@ -12,9 +12,6 @@ if (!globalThis.fetch) {
|
|||
globalThis.fetch = nodeFetch as unknown as typeof globalThis.fetch;
|
||||
}
|
||||
|
||||
// Config file path
|
||||
const AUTH_CONFIG_PATH = path.join(env.continueHome, "auth.json");
|
||||
|
||||
// Represents an authenticated user's configuration
|
||||
export interface AuthenticatedConfig {
|
||||
userId: string;
|
||||
|
|
@ -98,6 +95,7 @@ export function getModelName(config: AuthConfig): string | null {
|
|||
}
|
||||
|
||||
// URI utility functions have been moved to ./uriUtils.ts
|
||||
import { AUTH_CONFIG_PATH } from "./authEnv.js";
|
||||
import { autoSelectOrganizationAndConfig } from "./orgSelection.js";
|
||||
import { pathToUri, slugToUri, uriToPath, uriToSlug } from "./uriUtils.js";
|
||||
import {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// Helper functions extracted from streamChatResponse.ts to reduce file size
|
||||
|
||||
import { ContinueError, ContinueErrorReason } from "core/util/errors.js";
|
||||
import { ChatCompletionToolMessageParam } from "openai/resources/chat/completions.mjs";
|
||||
|
||||
import { checkToolPermission } from "../permissions/permissionChecker.js";
|
||||
|
|
@ -19,7 +20,6 @@ import {
|
|||
import { PreprocessedToolCall, ToolCall } from "../tools/types.js";
|
||||
import { logger } from "../util/logger.js";
|
||||
|
||||
import { ContinueError, ContinueErrorReason } from "core/util/errors.js";
|
||||
import { StreamCallbacks } from "./streamChatResponse.types.js";
|
||||
|
||||
// Helper function to handle permission denied
|
||||
|
|
@ -375,7 +375,14 @@ export async function preprocessStreamedToolCalls(
|
|||
durationMs: duration,
|
||||
error: errorMessage,
|
||||
errorReason,
|
||||
// modelName,
|
||||
// modelName, TODO
|
||||
});
|
||||
posthogService.capture("tool_call_outcome", {
|
||||
succeeded: false,
|
||||
toolName: toolCall.name,
|
||||
errorReason,
|
||||
duration_ms: duration,
|
||||
// model: options.modelName, TODO
|
||||
});
|
||||
|
||||
// Add error to chat history
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ import { logger } from "../util/logger.js";
|
|||
import { getVersion } from "../version.js";
|
||||
|
||||
import { detectTerminalType, parseOtelHeaders } from "./headerUtils.js";
|
||||
import { posthogService } from "./posthogService.js";
|
||||
|
||||
export interface TelemetryConfig {
|
||||
enabled: boolean;
|
||||
|
|
@ -521,14 +520,6 @@ class TelemetryService {
|
|||
|
||||
// TODO: Implement OTLP logs export
|
||||
logger.debug("Tool result event", attributes);
|
||||
|
||||
posthogService.capture("cli_tool_call_outcome", {
|
||||
succeeded: options.success,
|
||||
toolName: options.toolName,
|
||||
errorReason: options.errorReason,
|
||||
duration_ms: options.durationMs,
|
||||
// model: options.modelName, TODO
|
||||
});
|
||||
}
|
||||
|
||||
public logApiRequest(options: {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
// @ts-ignore
|
||||
import { ContinueError, ContinueErrorReason } from "core/util/errors.js";
|
||||
|
||||
import { posthogService } from "src/telemetry/posthogService.js";
|
||||
|
||||
import {
|
||||
getServiceSync,
|
||||
MCPServiceState,
|
||||
|
|
@ -213,6 +216,11 @@ export async function executeToolCall(
|
|||
durationMs: duration,
|
||||
toolParameters: JSON.stringify(toolCall.arguments),
|
||||
});
|
||||
posthogService.capture("tool_call_outcome", {
|
||||
succeeded: true,
|
||||
toolName: toolCall.name,
|
||||
duration_ms: duration,
|
||||
});
|
||||
|
||||
logger.debug("Tool execution completed", {
|
||||
toolName: toolCall.name,
|
||||
|
|
@ -236,6 +244,12 @@ export async function executeToolCall(
|
|||
errorReason,
|
||||
toolParameters: JSON.stringify(toolCall.arguments),
|
||||
});
|
||||
posthogService.capture("tool_call_outcome", {
|
||||
succeeded: false,
|
||||
toolName: toolCall.name,
|
||||
duration_ms: duration,
|
||||
errorReason,
|
||||
});
|
||||
|
||||
return `Error executing tool "${toolCall.name}": ${errorMessage}`;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ export const callToolById = createAsyncThunk<
|
|||
|
||||
const selectedChatModel = selectSelectedChatModel(state);
|
||||
|
||||
posthog.capture("gui_tool_call_decision", {
|
||||
posthog.capture("tool_call_decision", {
|
||||
model: selectedChatModel,
|
||||
decision: isAutoApproved ? "auto_accept" : "accept",
|
||||
toolName: toolCallState.toolCall.function.name,
|
||||
|
|
@ -135,7 +135,7 @@ export const callToolById = createAsyncThunk<
|
|||
|
||||
// Capture telemetry for tool call execution outcome with duration
|
||||
const duration_ms = Date.now() - startTime;
|
||||
posthog.capture("gui_tool_call_outcome", {
|
||||
posthog.capture("tool_call_outcome", {
|
||||
model: selectedChatModel,
|
||||
succeeded: !error,
|
||||
toolName: toolCallState.toolCall.function.name,
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ export const cancelToolCallThunk = createAsyncThunk<
|
|||
|
||||
if (toolCallState) {
|
||||
// Track tool call rejection
|
||||
posthog.capture("gui_tool_call_decision", {
|
||||
posthog.capture("tool_call_decision", {
|
||||
model: selectedChatModel,
|
||||
decision: "reject",
|
||||
toolName: toolCallState.toolCall.function.name,
|
||||
|
|
|
|||
|
|
@ -567,7 +567,7 @@ describe("streamResponseThunk - tool calls", () => {
|
|||
// Verify telemetry events for auto-approved tool execution
|
||||
// Use partial matching to allow additional fields (e.g. model) in payload
|
||||
expect(mockPosthog.capture).toHaveBeenCalledWith(
|
||||
"gui_tool_call_decision",
|
||||
"tool_call_decision",
|
||||
expect.objectContaining({
|
||||
decision: "auto_accept",
|
||||
toolName: "search_codebase",
|
||||
|
|
@ -576,11 +576,11 @@ describe("streamResponseThunk - tool calls", () => {
|
|||
);
|
||||
|
||||
expect(mockPosthog.capture).toHaveBeenCalledWith(
|
||||
"gui_tool_call_outcome",
|
||||
"tool_call_outcome",
|
||||
expect.objectContaining({
|
||||
succeeded: true,
|
||||
toolName: "search_codebase",
|
||||
errorMessage: undefined,
|
||||
errorReason: undefined,
|
||||
duration_ms: expect.any(Number),
|
||||
}),
|
||||
);
|
||||
|
|
@ -2819,7 +2819,7 @@ describe("streamResponseThunk - tool calls", () => {
|
|||
// Verify telemetry events for manual approval flow
|
||||
// Use partial matching to allow additional fields (e.g. model) in payload
|
||||
expect(mockPosthog.capture).toHaveBeenCalledWith(
|
||||
"gui_tool_call_decision",
|
||||
"tool_call_decision",
|
||||
expect.objectContaining({
|
||||
decision: "accept",
|
||||
toolName: "search_codebase",
|
||||
|
|
@ -2828,11 +2828,11 @@ describe("streamResponseThunk - tool calls", () => {
|
|||
);
|
||||
|
||||
expect(mockPosthog.capture).toHaveBeenCalledWith(
|
||||
"gui_tool_call_outcome",
|
||||
"tool_call_outcome",
|
||||
expect.objectContaining({
|
||||
succeeded: true,
|
||||
toolName: "search_codebase",
|
||||
errorMessage: undefined,
|
||||
errorReason: undefined,
|
||||
duration_ms: expect.any(Number),
|
||||
}),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -58,9 +58,7 @@ describe("multiEditImpl", () => {
|
|||
it("should throw if edits array is empty", async () => {
|
||||
await expect(
|
||||
multiEditImpl({ filepath: "test.txt", edits: [] }, "id", mockExtras),
|
||||
).rejects.toThrow(
|
||||
"edits array is required and must contain at least one edit",
|
||||
);
|
||||
).rejects.toThrow("edits array must contain at least one edit");
|
||||
});
|
||||
|
||||
it("should throw if edit has invalid old_string", async () => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue