mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-06 16:19:31 +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;
|
sonnet: CompositeTierConfig;
|
||||||
haiku: 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];
|
const v = variants[name];
|
||||||
if ('type' in v && v.type === 'composite') {
|
if ('type' in v && v.type === 'composite') {
|
||||||
const composite = v as CompositeVariantConfig;
|
const composite = v as CompositeVariantConfig;
|
||||||
|
const tiers = composite.tiers;
|
||||||
|
const hasFallback = !!(
|
||||||
|
tiers.opus.fallback ||
|
||||||
|
tiers.sonnet.fallback ||
|
||||||
|
tiers.haiku.fallback
|
||||||
|
);
|
||||||
result[name] = {
|
result[name] = {
|
||||||
provider: composite.tiers[composite.default_tier].provider,
|
provider: tiers[composite.default_tier].provider,
|
||||||
settings: composite.settings,
|
settings: composite.settings,
|
||||||
port: composite.port,
|
port: composite.port,
|
||||||
type: 'composite',
|
type: 'composite',
|
||||||
default_tier: composite.default_tier,
|
default_tier: composite.default_tier,
|
||||||
tiers: composite.tiers,
|
tiers,
|
||||||
|
hasFallback,
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
const single = v as CLIProxyVariantConfig;
|
const single = v as CLIProxyVariantConfig;
|
||||||
|
|||||||
@@ -97,6 +97,14 @@ export interface CompositeTierConfig {
|
|||||||
model: string;
|
model: string;
|
||||||
/** Account nickname (optional, references oauth_accounts) */
|
/** Account nickname (optional, references oauth_accounts) */
|
||||||
account?: string;
|
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