Skip to content
Open
Changes from 1 commit
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
16 changes: 13 additions & 3 deletions packages/core/lib/v3/v3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,7 @@ export class V3 {
? typeof options?.model === "string"
? { value: options.model, type: "string" }
: { value: options.model.modelName, type: "string" }
: { value: this.llmClient.modelName, type: "string" },
: { value: this.modelName, type: "string" },
systemPrompt: { value: options?.systemPrompt ?? "", type: "string" },
tools: { value: JSON.stringify(options?.tools ?? {}), type: "object" },
...(options?.integrations && {
Expand Down Expand Up @@ -1473,8 +1473,13 @@ export class V3 {
try {
if (this.apiClient && !this.experimental) {
const page = await this.ctx!.awaitActivePage();
// Ensure model is set for API calls - use the resolved modelName
const agentConfigWithModel: AgentConfig = {
...options,
model: options?.model || modelName,
};
result = await this.apiClient.agentExecute(
options,
agentConfigWithModel,
resolvedOptions,
page.mainFrameId(),
);
Expand Down Expand Up @@ -1576,8 +1581,13 @@ export class V3 {
try {
if (this.apiClient && !this.experimental) {
const page = await this.ctx!.awaitActivePage();
// Ensure model is set for API calls - default to V3's modelName if not specified
const agentConfigWithModel: AgentConfig = {
...options,
model: options?.model || this.modelName,
};
result = await this.apiClient.agentExecute(
options,
agentConfigWithModel,
resolvedOptions,
page.mainFrameId(),
);
Expand Down