(task: Task)
| 444 | // When the task is completed, the top instance is removed, reactivating the |
| 445 | // previous task. |
| 446 | async addClineToStack(task: Task) { |
| 447 | // Add this cline instance into the stack that represents the order of |
| 448 | // all the called tasks. |
| 449 | this.clineStack.push(task) |
| 450 | task.emit(RooCodeEventName.TaskFocused) |
| 451 | |
| 452 | // Perform special setup provider specific tasks. |
| 453 | await this.performPreparationTasks(task) |
| 454 | |
| 455 | // Ensure getState() resolves correctly. |
| 456 | const state = await this.getState() |
| 457 | |
| 458 | if (!state || typeof state.mode !== "string") { |
| 459 | throw new Error(t("common:errors.retrieve_current_mode")) |
| 460 | } |
| 461 | } |
| 462 | |
| 463 | async performPreparationTasks(cline: Task) { |
| 464 | // LMStudio: We need to force model loading in order to read its context |
no test coverage detected