Skip to content

Commit 040e758

Browse files
committed
Merge branch 'main' into static-context-ide-readfile
2 parents 9166bda + cc2a6c3 commit 040e758

Some content is hidden

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

54 files changed

+3654
-886
lines changed

core/config/markdown/loadMarkdownRules.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,13 @@ export async function loadMarkdownRules(ide: IDE): Promise<{
7979
uriType: "file",
8080
fileUri: file.path,
8181
});
82-
rules.push({ ...rule, source: "rules-block", sourceFile: file.path });
82+
if (!rule.invokable) {
83+
rules.push({
84+
...rule,
85+
source: "rules-block",
86+
sourceFile: file.path,
87+
});
88+
}
8389
} catch (e) {
8490
errors.push({
8591
fatal: false,

core/index.d.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,11 +359,15 @@ export interface ToolResultChatMessage {
359359
role: "tool";
360360
content: string;
361361
toolCallId: string;
362+
/** Arbitrary per-message metadata (IDs, provider-specific info, etc.) */
363+
metadata?: Record<string, unknown>;
362364
}
363365

364366
export interface UserChatMessage {
365367
role: "user";
366368
content: MessageContent;
369+
/** Arbitrary per-message metadata (IDs, provider-specific info, etc.) */
370+
metadata?: Record<string, unknown>;
367371
}
368372

369373
export interface ThinkingChatMessage {
@@ -372,6 +376,12 @@ export interface ThinkingChatMessage {
372376
signature?: string;
373377
redactedThinking?: string;
374378
toolCalls?: ToolCallDelta[];
379+
reasoning_details?: {
380+
signature?: string;
381+
[key: string]: any;
382+
}[];
383+
/** Arbitrary per-message metadata (IDs, provider-specific info, etc.) */
384+
metadata?: Record<string, unknown>;
375385
}
376386

377387
/**
@@ -400,11 +410,15 @@ export interface AssistantChatMessage {
400410
content: MessageContent;
401411
toolCalls?: ToolCallDelta[];
402412
usage?: Usage;
413+
/** Arbitrary per-message metadata (IDs, provider-specific info, etc.) */
414+
metadata?: Record<string, unknown>;
403415
}
404416

405417
export interface SystemChatMessage {
406418
role: "system";
407419
content: string;
420+
/** Arbitrary per-message metadata (IDs, provider-specific info, etc.) */
421+
metadata?: Record<string, unknown>;
408422
}
409423

410424
export type ChatMessage =

core/llm/autodetect.ts

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,47 @@ const PROVIDER_HANDLES_TEMPLATING: string[] = [
6363
"watsonx",
6464
"nebius",
6565
"relace",
66+
"openrouter",
67+
"deepseek",
68+
"xAI",
69+
"groq",
70+
"gemini",
71+
"docker",
72+
// TODO add these, change to inverted logic so only the ones that need templating are hardcoded
73+
// Asksage.ts
74+
// Azure.ts
75+
// BedrockImport.ts
76+
// Cerebras.ts
77+
// Cloudflare.ts
78+
// CometAPI.ts
79+
// CustomLLM.ts
80+
// DeepInfra.ts
81+
// Fireworks.ts
82+
// Flowise.ts
83+
// FunctionNetwork.ts
84+
// HuggingFaceInferenceAPI.ts
85+
// HuggingFaceTEI.ts
86+
// HuggingFaceTGI.ts
87+
// Inception.ts
88+
// Kindo.ts
89+
// LlamaCpp.ts
90+
// LlamaStack.ts
91+
// Llamafile.ts
92+
// Mock.ts
93+
// Moonshot.ts
94+
// NCompass.ts
95+
// OVHcloud.ts
96+
// Replicate.ts
97+
// Scaleway.ts
98+
// SiliconFlow.ts
99+
// TARS.ts
100+
// Test.ts
101+
// TextGenWebUI.ts
102+
// TransformersJsEmbeddingsProvider.ts
103+
// Venice.ts
104+
// Vllm.ts
105+
// Voyage.ts
106+
// etc
66107
];
67108

68109
const PROVIDER_SUPPORTS_IMAGES: string[] = [
@@ -105,6 +146,8 @@ const MODEL_SUPPORTS_IMAGES: RegExp[] = [
105146
/\bgemma-?3(?!n)/, // gemma3 supports vision, but gemma3n doesn't!
106147
/\b(pali|med)gemma/,
107148
/qwen(.*)vl/,
149+
/mistral-small/,
150+
/mistral-medium/,
108151
];
109152

110153
function modelSupportsImages(
@@ -142,7 +185,12 @@ function modelSupportsReasoning(
142185
if (!model) {
143186
return false;
144187
}
145-
if ("anthropic" === model.underlyingProviderName) {
188+
// do not turn reasoning on by default for claude 3 models
189+
if (
190+
model.model.includes("claude") &&
191+
!model.model.includes("-3-") &&
192+
!model.model.includes("-3.5-")
193+
) {
146194
return true;
147195
}
148196
if (model.model.includes("deepseek-r")) {

0 commit comments

Comments
 (0)