disable round-robin for sequential

This commit is contained in:
2026-05-31 09:30:08 -04:00
parent 99b944d10e
commit d2a7dfa5fe
2 changed files with 4 additions and 7 deletions

View File

@@ -113,10 +113,11 @@ prompts:
> tasks, only the first two models are used. The third model is only touched when > tasks, only the first two models are used. The third model is only touched when
> a third concurrent task starts. Freed model slots are reused before new ones > a third concurrent task starts. Freed model slots are reused before new ones
> are allocated. > are allocated.
>
> **Automatic failover**: if a provider/API is unreachable (rate limit, 503, etc.), > **Automatic failover**: if a provider/API is unreachable (rate limit, 503, etc.),
> the task automatically cycles to the next model in the list without counting it > the task automatically cycles to the next model in the list without counting it
> as a task failure. Each model is tried once before the task is marked as failed. > as a task failure. Each model is tried once before the task is marked as failed.
> **NOTE**: this is only used in parallel execution, in sequential mode the
> parent pi session's model is used
## State Files ## State Files

View File

@@ -411,10 +411,9 @@ export async function executeBatch(
return; return;
} }
// Execute sequentially // Execute sequentially (no round-robin — inherit parent model)
for (const task of tasks) { for (const task of tasks) {
try { try {
const model = roundRobin?.assign(task.id);
await executeTask( await executeTask(
task, task,
project, project,
@@ -423,14 +422,11 @@ export async function executeBatch(
ctx, ctx,
sendChatMessage, sendChatMessage,
projectDir, projectDir,
undefined,
model,
roundRobin,
); );
} catch (error) { } catch (error) {
// Task failed — stop the batch. Dependent tasks are blocked by // Task failed — stop the batch. Dependent tasks are blocked by
// the DAG layer (getBlockedTasks) so they won't appear in this batch. // the DAG layer (getBlockedTasks) so they won't appear in this batch.
roundRobin?.release(task.id);
const errorMsg = error instanceof Error ? error.message : String(error); const errorMsg = error instanceof Error ? error.message : String(error);
progress.markFailed(task.id, errorMsg); progress.markFailed(task.id, errorMsg);
sendChatMessage?.(`${task.id} · ${task.title}${errorMsg}`); sendChatMessage?.(`${task.id} · ${task.title}${errorMsg}`);