mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-17 00:16:46 +00:00
feat(cliproxy): extend composite schema with fallback and thinking fields
- Add fallback? (provider+model) to CompositeTierConfig for per-tier retry - Add thinking? string to CompositeTierConfig for per-tier thinking budget - Add hasFallback flag to VariantConfig for runtime detection - Propagate new fields in listVariantsFromConfig() Refs #506
This commit is contained in:
@@ -41,6 +41,8 @@ export interface VariantConfig {
|
||||
sonnet: CompositeTierConfig;
|
||||
haiku: CompositeTierConfig;
|
||||
};
|
||||
/** Whether any tier has fallback configured */
|
||||
hasFallback?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -100,13 +102,20 @@ export function listVariantsFromConfig(): Record<string, VariantConfig> {
|
||||
const v = variants[name];
|
||||
if ('type' in v && v.type === 'composite') {
|
||||
const composite = v as CompositeVariantConfig;
|
||||
const tiers = composite.tiers;
|
||||
const hasFallback = !!(
|
||||
tiers.opus.fallback ||
|
||||
tiers.sonnet.fallback ||
|
||||
tiers.haiku.fallback
|
||||
);
|
||||
result[name] = {
|
||||
provider: composite.tiers[composite.default_tier].provider,
|
||||
provider: tiers[composite.default_tier].provider,
|
||||
settings: composite.settings,
|
||||
port: composite.port,
|
||||
type: 'composite',
|
||||
default_tier: composite.default_tier,
|
||||
tiers: composite.tiers,
|
||||
tiers,
|
||||
hasFallback,
|
||||
};
|
||||
} else {
|
||||
const single = v as CLIProxyVariantConfig;
|
||||
|
||||
@@ -97,6 +97,14 @@ export interface CompositeTierConfig {
|
||||
model: string;
|
||||
/** Account nickname (optional, references oauth_accounts) */
|
||||
account?: string;
|
||||
/** Fallback provider+model if primary fails */
|
||||
fallback?: {
|
||||
provider: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'ghcp' | 'claude';
|
||||
model: string;
|
||||
account?: string;
|
||||
};
|
||||
/** Per-tier thinking budget override (e.g. 'xhigh', 'medium', 'off') */
|
||||
thinking?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user