mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-14 10:18:14 +00:00
Merge remote-tracking branch 'origin/dev' into kai/fix/websearch-hook-install-settings-profiles
This commit is contained in:
commit
836c485095
25 files changed
+1278
-55
No files matched your search
@@ -35,8 +35,9 @@ export const CCS_CONTROL_PANEL_SECRET = 'ccs';
|
||||
* v11: Migrated deprecated claude-sonnet-4-6-thinking aliases to claude-sonnet-4-6
|
||||
* v12: Removed denylisted Antigravity Claude 4.5 aliases
|
||||
* v13: Removed aggressive Gemini alias expansion to reduce model list noise in Control Panel
|
||||
* v14: Added Gemini 3.1 Flash Antigravity aliases for upcoming rollout compatibility
|
||||
*/
|
||||
export const CLIPROXY_CONFIG_VERSION = 13;
|
||||
export const CLIPROXY_CONFIG_VERSION = 14;
|
||||
|
||||
interface OAuthModelAliasEntry {
|
||||
name: string;
|
||||
@@ -61,6 +62,7 @@ const DEFAULT_ANTIGRAVITY_ALIASES: OAuthModelAliasEntry[] = [
|
||||
{ name: 'gemini-3-pro-high', alias: 'gemini-3.1-pro-preview' },
|
||||
{ name: 'gemini-3-pro-high', alias: 'gemini-3.1-pro-preview-customtools' },
|
||||
{ name: 'gemini-3-flash', alias: 'gemini-3-flash-preview' },
|
||||
{ name: 'gemini-3-flash', alias: 'gemini-3.1-flash-preview' },
|
||||
{ name: 'claude-sonnet-4-6', alias: 'claude-sonnet-4-6', fork: true },
|
||||
// Backward compatibility: legacy sonnet thinking alias now routes to canonical model ID.
|
||||
{ name: 'claude-sonnet-4-6-thinking', alias: 'claude-sonnet-4-6', fork: true },
|
||||
|
||||
@@ -65,7 +65,7 @@ export function detectTierFromModel(modelName: string): ModelTier {
|
||||
*
|
||||
* @param model - Base model name
|
||||
* @param thinkingValue - Level name (e.g., 'high') or numeric budget
|
||||
* @returns Model name with thinking suffix, e.g., "gemini-3-pro-preview(high)"
|
||||
* @returns Model name with thinking suffix, e.g., "gemini-3.1-pro-preview(high)"
|
||||
*/
|
||||
export function applyThinkingSuffix(model: string, thinkingValue: string | number): string {
|
||||
return applyThinkingSuffixForProvider(model, thinkingValue);
|
||||
|
||||
@@ -34,7 +34,13 @@ import { DEFAULT_BACKEND } from '../platform-detector';
|
||||
import { configureProviderModel, getCurrentModel } from '../model-config';
|
||||
import { reconcileCodexModelForActivePlan } from '../codex-plan-compatibility';
|
||||
import { resolveProxyConfig, PROXY_CLI_FLAGS } from '../proxy-config-resolver';
|
||||
import { supportsModelConfig, isModelBroken, getModelIssueUrl, findModel } from '../model-catalog';
|
||||
import {
|
||||
supportsModelConfig,
|
||||
isModelBroken,
|
||||
getModelIssueUrl,
|
||||
findModel,
|
||||
getSuggestedReplacementModel,
|
||||
} from '../model-catalog';
|
||||
import { CodexReasoningProxy } from '../codex-reasoning-proxy';
|
||||
import { ToolSanitizationProxy } from '../tool-sanitization-proxy';
|
||||
import {
|
||||
@@ -714,9 +720,14 @@ export async function execClaudeWithCLIProxy(
|
||||
if (currentModel && isModelBroken(provider, currentModel)) {
|
||||
const modelEntry = findModel(provider, currentModel);
|
||||
const issueUrl = getModelIssueUrl(provider, currentModel);
|
||||
const replacementModel = getSuggestedReplacementModel(provider, currentModel);
|
||||
console.error('');
|
||||
console.error(warn(`${modelEntry?.name || currentModel} has known issues with Claude Code`));
|
||||
console.error(' Tool calls will fail. Use "gemini-3-pro-preview" instead.');
|
||||
if (replacementModel) {
|
||||
console.error(` Tool calls will fail. Use "${replacementModel}" instead.`);
|
||||
} else {
|
||||
console.error(' Tool calls will fail. Consider changing the model in config.yaml.');
|
||||
}
|
||||
if (issueUrl) {
|
||||
console.error(` Tracking: ${issueUrl}`);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ import {
|
||||
migrateDeniedAntigravityModelAliases,
|
||||
normalizeModelIdForProvider,
|
||||
} from './model-id-normalizer';
|
||||
import { stripModelConfigurationSuffixes } from '../shared/extended-context-utils';
|
||||
import { GEMINI_MINOR_VERSION_COMPATIBILITY_IDS } from '../shared/gemini-minor-version-compatibility';
|
||||
|
||||
/**
|
||||
* Thinking support configuration for a model.
|
||||
@@ -108,9 +110,9 @@ export const MODEL_CATALOG: Partial<Record<CLIProxyProvider, ProviderCatalog>> =
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'gemini-3-pro-preview',
|
||||
name: 'Gemini 3 Pro',
|
||||
description: 'Google latest model via Antigravity',
|
||||
id: 'gemini-3.1-pro-preview',
|
||||
name: 'Gemini 3.1 Pro',
|
||||
description: 'Google latest Gemini Pro model via Antigravity',
|
||||
thinking: { type: 'levels', levels: ['low', 'high'], dynamicAllowed: true },
|
||||
extendedContext: true,
|
||||
},
|
||||
@@ -122,10 +124,10 @@ export const MODEL_CATALOG: Partial<Record<CLIProxyProvider, ProviderCatalog>> =
|
||||
defaultModel: 'gemini-2.5-pro',
|
||||
models: [
|
||||
{
|
||||
id: 'gemini-3-pro-preview',
|
||||
name: 'Gemini 3 Pro',
|
||||
id: 'gemini-3.1-pro-preview',
|
||||
name: 'Gemini 3.1 Pro',
|
||||
tier: 'pro',
|
||||
description: 'Latest model, requires paid Google account',
|
||||
description: 'Latest Gemini Pro model, requires paid Google account',
|
||||
thinking: { type: 'levels', levels: ['low', 'high'], dynamicAllowed: true },
|
||||
extendedContext: true,
|
||||
},
|
||||
@@ -383,6 +385,26 @@ export function getProviderCatalog(provider: CLIProxyProvider): ProviderCatalog
|
||||
return MODEL_CATALOG[provider];
|
||||
}
|
||||
|
||||
/**
|
||||
* Suggest a supported replacement model from the provider catalog.
|
||||
* Prefers the provider default unless it matches the excluded model or is itself broken.
|
||||
*/
|
||||
export function getSuggestedReplacementModel(
|
||||
provider: CLIProxyProvider,
|
||||
excludedModelId?: string
|
||||
): string | undefined {
|
||||
const catalog = MODEL_CATALOG[provider];
|
||||
if (!catalog) return undefined;
|
||||
|
||||
const excludedId = excludedModelId ? findModel(provider, excludedModelId)?.id : undefined;
|
||||
const defaultModel = findModel(provider, catalog.defaultModel);
|
||||
if (defaultModel && !defaultModel.broken && defaultModel.id !== excludedId) {
|
||||
return defaultModel.id;
|
||||
}
|
||||
|
||||
return catalog.models.find((model) => !model.broken && model.id !== excludedId)?.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find model entry by ID
|
||||
* Note: Model IDs are normalized to lowercase for case-insensitive comparison
|
||||
@@ -390,7 +412,7 @@ export function getProviderCatalog(provider: CLIProxyProvider): ProviderCatalog
|
||||
export function findModel(provider: CLIProxyProvider, modelId: string): ModelEntry | undefined {
|
||||
const catalog = MODEL_CATALOG[provider];
|
||||
if (!catalog || !modelId) return undefined;
|
||||
const normalizedId = modelId.trim().toLowerCase();
|
||||
const normalizedId = stripModelConfigurationSuffixes(modelId).trim().toLowerCase();
|
||||
const providerNormalizedId = normalizeModelIdForProvider(normalizedId, provider)
|
||||
.trim()
|
||||
.toLowerCase();
|
||||
@@ -404,6 +426,16 @@ export function findModel(provider: CLIProxyProvider, modelId: string): ModelEnt
|
||||
lookupCandidates.add(migratedProvider);
|
||||
}
|
||||
|
||||
for (const candidate of [...lookupCandidates]) {
|
||||
const compatibilityId =
|
||||
GEMINI_MINOR_VERSION_COMPATIBILITY_IDS[
|
||||
candidate as keyof typeof GEMINI_MINOR_VERSION_COMPATIBILITY_IDS
|
||||
];
|
||||
if (compatibilityId) {
|
||||
lookupCandidates.add(compatibilityId);
|
||||
}
|
||||
}
|
||||
|
||||
return catalog.models.find((m) => lookupCandidates.has(m.id.toLowerCase()));
|
||||
}
|
||||
|
||||
|
||||
@@ -32,11 +32,16 @@ const GEMINI_CLI_GROUPS: Record<
|
||||
> = {
|
||||
'gemini-flash-series': {
|
||||
label: 'Gemini Flash Series',
|
||||
models: ['gemini-3-flash-preview', 'gemini-2.5-flash', 'gemini-2.5-flash-lite'],
|
||||
models: [
|
||||
'gemini-3-flash-preview',
|
||||
'gemini-3.1-flash-preview',
|
||||
'gemini-2.5-flash',
|
||||
'gemini-2.5-flash-lite',
|
||||
],
|
||||
},
|
||||
'gemini-pro-series': {
|
||||
label: 'Gemini Pro Series',
|
||||
models: ['gemini-3-pro-preview', 'gemini-2.5-pro'],
|
||||
models: ['gemini-3-pro-preview', 'gemini-3.1-pro-preview', 'gemini-2.5-pro'],
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Shared Gemini preview aliases for minor-version rollouts.
|
||||
* Keep CLIProxy backend and dashboard model resolution on the same compatibility pairs.
|
||||
*/
|
||||
export const GEMINI_MINOR_VERSION_COMPATIBILITY_IDS = Object.freeze({
|
||||
'gemini-3-pro-preview': 'gemini-3.1-pro-preview',
|
||||
'gemini-3.1-pro-preview': 'gemini-3-pro-preview',
|
||||
'gemini-3-flash-preview': 'gemini-3.1-flash-preview',
|
||||
'gemini-3.1-flash-preview': 'gemini-3-flash-preview',
|
||||
});
|
||||
@@ -718,6 +718,16 @@ const MODEL_PRICING_ALIASES: Record<string, string> = {
|
||||
'qwen3-235b': 'qwen3-max',
|
||||
'qwen3-vl-plus': 'qwen3.5-plus',
|
||||
'qwen3-32b': 'qwen3.5-plus',
|
||||
'gemini-3-flash-preview': 'gemini-2.5-flash',
|
||||
'gemini-3-flash-preview-customtools': 'gemini-2.5-flash',
|
||||
'gemini-3.1-pro-preview': 'gemini-3-pro-preview',
|
||||
'gemini-3.1-flash-preview': 'gemini-2.5-flash',
|
||||
'gemini-3.1-pro-preview-customtools': 'gemini-3-pro-preview',
|
||||
'gemini-3.1-flash-preview-customtools': 'gemini-2.5-flash',
|
||||
'gemini-3-1-pro-preview': 'gemini-3-pro-preview',
|
||||
'gemini-3-1-flash-preview': 'gemini-2.5-flash',
|
||||
'gemini-3-1-pro-preview-customtools': 'gemini-3-pro-preview',
|
||||
'gemini-3-1-flash-preview-customtools': 'gemini-2.5-flash',
|
||||
};
|
||||
|
||||
// Default pricing for unknown models
|
||||
|
||||
Reference in new issue
Block a user