diff --git a/packages/core/lib/v3/external_clients/aisdk.ts b/packages/core/lib/v3/external_clients/aisdk.ts index 5a6eb41603..55de7b85fe 100644 --- a/packages/core/lib/v3/external_clients/aisdk.ts +++ b/packages/core/lib/v3/external_clients/aisdk.ts @@ -86,6 +86,7 @@ export class AISdkClient extends LLMClient { model: this.model, messages: formattedMessages, schema: options.response_model.schema, + allowSystemInMessages: true, }); return { @@ -113,6 +114,7 @@ export class AISdkClient extends LLMClient { model: this.model, messages: formattedMessages, tools, + allowSystemInMessages: true, }); return { diff --git a/packages/core/lib/v3/handlers/v3AgentHandler.ts b/packages/core/lib/v3/handlers/v3AgentHandler.ts index cff08c8a28..773c3e67b7 100644 --- a/packages/core/lib/v3/handlers/v3AgentHandler.ts +++ b/packages/core/lib/v3/handlers/v3AgentHandler.ts @@ -374,7 +374,7 @@ export class V3AgentHandler { tools: allTools, stopWhen: (result) => this.handleStop(result, maxSteps), toolChoice: "auto", - + allowSystemInMessages: true, prepareStep: this.createPrepareStep( callbacks?.prepareStep, captchaSolver, @@ -511,6 +511,7 @@ export class V3AgentHandler { tools: allTools, stopWhen: (result) => this.handleStop(result, maxSteps), toolChoice: "auto", + allowSystemInMessages: true, prepareStep: this.createPrepareStep( callbacks?.prepareStep, captchaSolver, diff --git a/packages/core/lib/v3/llm/aisdk.ts b/packages/core/lib/v3/llm/aisdk.ts index 355b46d425..81bb924dcf 100644 --- a/packages/core/lib/v3/llm/aisdk.ts +++ b/packages/core/lib/v3/llm/aisdk.ts @@ -248,6 +248,7 @@ You must respond in JSON format. respond WITH JSON. Do not include any other tex messages: formattedMessages, schema: options.response_model.schema, temperature, + allowSystemInMessages: true, ...(Object.keys(providerOptions).length > 0 ? { providerOptions } : {}), @@ -379,6 +380,7 @@ You must respond in JSON format. respond WITH JSON. Do not include any other tex : "auto" : undefined, temperature, + allowSystemInMessages: true, }); } catch (err) { // Log error response to maintain request/response pairing diff --git a/packages/evals/lib/AISdkClientWrapped.ts b/packages/evals/lib/AISdkClientWrapped.ts index 213aaa0f34..934a686e03 100644 --- a/packages/evals/lib/AISdkClientWrapped.ts +++ b/packages/evals/lib/AISdkClientWrapped.ts @@ -180,6 +180,7 @@ You must respond in JSON format. respond WITH JSON. Do not include any other tex messages: formattedMessages, schema: options.response_model.schema, temperature, + allowSystemInMessages: true, providerOptions: resolvedReasoningEffort ? { openai: { @@ -289,6 +290,7 @@ You must respond in JSON format. respond WITH JSON. Do not include any other tex : "auto" : undefined, temperature, + allowSystemInMessages: true, }); // Transform AI SDK response to match LLMResponse format expected by operator handler.