mirror of
https://github.com/BaaRai/ARTEX.git
synced 2026-11-17 13:40:53 +08:00
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:
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user