Merge pull request #272 from BaaRai/fix/llm-rotation-followups

fix(llm-rotation): precise exhaustion wording and binding check state
This commit is contained in:
BaaRai
2026-11-17 00:01:12 +01:00
committed by GitHub
3 changed files with 11 additions and 6 deletions
+6 -3
View File
@@ -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.
@@ -60,12 +60,13 @@ export function TaskLLMProfileChain({
portalContainer,
}: TaskLLMProfileChainProps) {
const rotationID = React.useId();
const [workerBinding, setWorkerBinding] = React.useState<number | null | undefined>(undefined);
const [workerBinding, setWorkerBinding] = React.useState<number | null>(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.
</p>
)}
{rotate && workerBinding === undefined && (
{rotate && bindingCheckFailed && (
<p className="text-amber-600 text-xs">
Worker binding could not be checked. A fixed Worker model overrides rotation; verify Agent settings.
</p>
+1
View File
@@ -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;