fix: make configuration parameter optional for backward compatibility

This commit is contained in:
Roo Code 2025-09-28 19:15:31 +00:00
parent f708a49a05
commit 30a60bf8d4
2 changed files with 9 additions and 3 deletions

View file

@ -23,7 +23,7 @@ export interface McpApi {
export interface RooCodeAPI extends EventEmitter<RooCodeEvents>, McpApi {
// Task Management
startNewTask(options: {
configuration: RooCodeSettings
configuration?: RooCodeSettings
text?: string
images?: string[]
newTab?: boolean

View file

@ -126,7 +126,7 @@ export class API extends EventEmitter<RooCodeEvents> implements RooCodeAPI {
images,
newTab,
}: {
configuration: RooCodeSettings
configuration?: RooCodeSettings
text?: string
images?: string[]
newTab?: boolean
@ -154,7 +154,13 @@ export class API extends EventEmitter<RooCodeEvents> implements RooCodeAPI {
consecutiveMistakeLimit: Number.MAX_SAFE_INTEGER,
}
const task = await provider.createTask(text, images, undefined, options, configuration)
const task = await provider.createTask(
text,
images,
undefined,
options,
configuration || this.getConfiguration(),
)
if (!task) {
throw new Error("Failed to create task due to policy restrictions")