diff --git a/README.md b/README.md index d8bf4d7..5dc107c 100644 --- a/README.md +++ b/README.md @@ -77,9 +77,12 @@ Rotation assigns successive worker intents A, B, A, B, regardless of completion order. Separate intents can run concurrently on different providers; each intent keeps its selected provider unless it fails over. Planner and other unbound roles continue using the task's current profile. Turning rotation off restores ordered -task-level failover. Exhausted providers are skipped; saving the chain resets their -failure state. Changes do not interrupt in-flight calls. The rotation cursor starts -again after a server restart; the profile order and switch remain persisted. +task-level failover. An excluded provider is skipped, so an intent pinned to an +exhausted profile falls back to the task's current profile instead of retrying it; +rotation keeps cycling the whole list and does not rebalance around a dead provider. +Saving the chain resets their failure state. Changes do not interrupt in-flight +calls. The rotation cursor starts again after a server restart and saving the chain +does not reset it; the profile order and switch remain persisted. The task creation and `PUT /api/tasks/{id}/llm` APIs accept `llm_rotate: true` alongside the ordered `llm_profile_ids`. Omitting `llm_rotate` on an update preserves its value. diff --git a/web/src/components/task-llm-profile-chain.tsx b/web/src/components/task-llm-profile-chain.tsx index 2bc5b4c..3ff98ad 100644 --- a/web/src/components/task-llm-profile-chain.tsx +++ b/web/src/components/task-llm-profile-chain.tsx @@ -60,12 +60,13 @@ export function TaskLLMProfileChain({ portalContainer, }: TaskLLMProfileChainProps) { const rotationID = React.useId(); - const [workerBinding, setWorkerBinding] = React.useState(undefined); + const [workerBinding, setWorkerBinding] = React.useState(null); + const [bindingCheckFailed, setBindingCheckFailed] = React.useState(false); React.useEffect(() => { api .agents() .then((agents) => setWorkerBinding(agents.find((a) => a.key === "worker")?.llm_profile_id ?? null)) - .catch(() => setWorkerBinding(undefined)); + .catch(() => setBindingCheckFailed(true)); }, []); const profilesByID = React.useMemo(() => new Map(profiles.map((profile) => [profile.id, profile])), [profiles]); const itemIDs = React.useMemo(() => profiles.map((profile) => profile.id), [profiles]); @@ -126,7 +127,7 @@ export function TaskLLMProfileChain({ settings to use these profiles.

)} - {rotate && workerBinding === undefined && ( + {rotate && bindingCheckFailed && (

Worker binding could not be checked. A fixed Worker model overrides rotation; verify Agent settings.

diff --git a/web/src/lib/api.ts b/web/src/lib/api.ts index b15e6fc..5d1e8ca 100644 --- a/web/src/lib/api.ts +++ b/web/src/lib/api.ts @@ -316,6 +316,7 @@ export const api = { put<{ id: string; llm_profile_ids: number[]; + llm_rotate: boolean; active_llm_profile_id?: number; llm_failover_state: string; reopened_intents: number;