Skip to content

Commit 17caf80

Browse files
committed
fix(cliproxy): map token type values to provider names for account discovery
1 parent 3a1e8c0 commit 17caf80

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/cliproxy/account-manager.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,21 @@ export function discoverExistingAccounts(): void {
292292
// Skip if no type field
293293
if (!data.type) continue;
294294

295-
const provider = data.type.toLowerCase() as CLIProxyProvider;
295+
// Map token type values to internal provider names
296+
// CLIProxyAPI uses different type values in tokens (e.g., "antigravity" vs "agy")
297+
const typeToProvider: Record<string, CLIProxyProvider> = {
298+
gemini: 'gemini',
299+
antigravity: 'agy',
300+
codex: 'codex',
301+
qwen: 'qwen',
302+
iflow: 'iflow',
303+
};
304+
305+
const typeValue = data.type.toLowerCase();
306+
const provider = typeToProvider[typeValue];
296307

297-
// Validate provider
298-
if (!['gemini', 'codex', 'agy', 'qwen', 'iflow'].includes(provider)) {
308+
// Skip if unknown provider type
309+
if (!provider) {
299310
continue;
300311
}
301312

0 commit comments

Comments
 (0)