@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
66 lines • 3.18 kB
TypeScript
import type { FallbackChains } from "./chains.ts";
export interface ProviderRetrySettings {
timeoutMs?: number;
streamStartTimeoutMs?: number;
keepAliveTimeoutMs?: number;
streamRetryTimeoutMs?: number;
maxRetries?: number;
maxRetryDelayMs?: number;
}
export interface RetrySettings {
enabled?: boolean;
maxRetries?: number;
baseDelayMs?: number;
/** Hard ceiling on one agent-level retry wait, applied after profile/hint/jitter planning; default: 60000. */
maxAgentDelayMs?: number;
provider?: ProviderRetrySettings;
providers?: Record<string, import("./profile-override.ts").RetryPolicyOverride>;
modelFallback?: boolean;
fallbackChains?: Record<string, string[]>;
fallbackRevertPolicy?: "cooldown-expiry" | "never";
abortServerSideFallback?: boolean;
hintedWaitCapMs?: number;
probeBackMaxMs?: number;
}
export interface ResolvedRetryFallbackSettings {
modelFallback: boolean;
chains: FallbackChains;
revertPolicy: "cooldown-expiry" | "never";
}
/**
* Shipped defaults are declared as model families (bare ids, no provider prefix).
* `canonicalizeFallbackChains` expands them against the live registry, so the chain
* follows Fable 5 whichever provider serves it - the builtin Anthropic provider, the
* Anthropic Subscription extension, a gateway, or Bedrock.
*
* The Fable ladders never leave Anthropic. A previous shipped default was removed because it
* led with cross-family rungs (`k3`, `kimi-k3`), which moved a Claude session onto another
* vendor mid-turn and could rank a guaranteed-refusal OAuth lane first. There is still
* deliberately no wildcard lane.
*
* Opus 5.5 is the one chain that leaves Anthropic, by the owner's order (senpi#6699): Fable 5.2
* at medium effort, then Kimi K3.1 Pro at max (its highest level), and nothing after. No Opus
* rung follows, since Anthropic meters Opus on its own quota window and a rate limit on
* Opus 5.5 also holds every other Opus rung on that account (senpi#6385).
*
* Rungs stay on current-generation Opus: a Claude session must never step down to
* `claude-opus-4-8` or `claude-opus-4-6` (senpi#3727).
*/
export declare const DEFAULT_FALLBACK_CHAINS: FallbackChains;
/**
* `sessionPolicy`: the chains were supplied by the session's opener (`open_session.retryFallback`,
* `set_retry_fallback`), so they are the session's whole policy and the shipped defaults are not merged
* back under them (senpi#4673). Settings-file chains still layer over the defaults.
*/
export declare function resolveRetryFallbackSettings(settings: RetrySettings | undefined, options?: {
readonly sessionPolicy?: boolean;
}): ResolvedRetryFallbackSettings;
export declare function resolveAbortServerSideFallback(settings: RetrySettings | undefined): boolean;
export declare const DEFAULT_HINTED_WAIT_CAP_MS = 300000;
export declare const DEFAULT_PROBE_BACK_MAX_MS = 3600000;
export interface ResolvedHintPolicySettings {
hintedWaitCapMs: number;
probeBackMaxMs: number;
}
export declare function resolveHintPolicySettings(settings: RetrySettings | undefined): ResolvedHintPolicySettings;
//# sourceMappingURL=settings.d.ts.map