mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-02 14:19:56 +00:00
fix(cliproxy): map token type values to provider names for account discovery
This commit is contained in:
@@ -292,10 +292,21 @@ export function discoverExistingAccounts(): void {
|
|||||||
// Skip if no type field
|
// Skip if no type field
|
||||||
if (!data.type) continue;
|
if (!data.type) continue;
|
||||||
|
|
||||||
const provider = data.type.toLowerCase() as CLIProxyProvider;
|
// Map token type values to internal provider names
|
||||||
|
// CLIProxyAPI uses different type values in tokens (e.g., "antigravity" vs "agy")
|
||||||
|
const typeToProvider: Record<string, CLIProxyProvider> = {
|
||||||
|
gemini: 'gemini',
|
||||||
|
antigravity: 'agy',
|
||||||
|
codex: 'codex',
|
||||||
|
qwen: 'qwen',
|
||||||
|
iflow: 'iflow',
|
||||||
|
};
|
||||||
|
|
||||||
// Validate provider
|
const typeValue = data.type.toLowerCase();
|
||||||
if (!['gemini', 'codex', 'agy', 'qwen', 'iflow'].includes(provider)) {
|
const provider = typeToProvider[typeValue];
|
||||||
|
|
||||||
|
// Skip if unknown provider type
|
||||||
|
if (!provider) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user