mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-23 19:08:22 -06:00
390f46d042
Co-authored-by: 1052326311 <65798732+1052326311@users.noreply.github.com>
31 lines
888 B
TypeScript
31 lines
888 B
TypeScript
/**
|
|
* Shared candidate and attempt types for model fallback execution.
|
|
*/
|
|
import type { FailoverReason } from "./embedded-agent-helpers/types.js";
|
|
|
|
// Shared model fallback record types used by selection, observation, and retry
|
|
// reporting.
|
|
export type ModelCandidate = {
|
|
provider: string;
|
|
model: string;
|
|
};
|
|
|
|
export type ModelFallbackRouteOrigin = "requested" | "configured-fallback" | "configured-primary";
|
|
export type ModelFallbackRouteResolution = "raw" | "resolved";
|
|
|
|
/** A runnable route plus the selection edge and resolution state it arrived with. */
|
|
export type ModelFallbackCandidate = ModelCandidate & {
|
|
routeOrigin: ModelFallbackRouteOrigin;
|
|
routeResolution: ModelFallbackRouteResolution;
|
|
};
|
|
|
|
export type FallbackAttempt = {
|
|
provider: string;
|
|
model: string;
|
|
error: string;
|
|
reason?: FailoverReason;
|
|
authMode?: string;
|
|
status?: number;
|
|
code?: string;
|
|
};
|