fix(cliproxy): add missing OAuth callback ports for codex, agy, iflow

Port cleanup before OAuth was skipped for providers whose ports were
only in comments. This caused hanging when stale processes blocked
the callback port from previous auth attempts.

Changes:
- auth-types.ts: Add codex (1455), agy (51121), iflow (11451) to map
- oauth-port-diagnostics.ts: Update iflow from device_code to auth_code flow
- Add Claude (54545) to doc comments for future reference
This commit is contained in:
kaitranntt
2026-01-06 10:32:08 -05:00
parent f2d9073b0d
commit cfe604a97c
2 changed files with 10 additions and 7 deletions
+8 -5
View File
@@ -15,17 +15,20 @@ import { AccountInfo } from '../account-manager';
* - Gemini: Authorization Code Flow with local callback server on port 8085
* - Codex: Authorization Code Flow with local callback server on port 1455
* - Agy: Authorization Code Flow with local callback server on port 51121
* - Qwen: Device Code Flow (polling-based, NO callback port needed)
* - Kiro: Authorization Code Flow with local callback server on port 9876
* - iFlow: Authorization Code Flow with local callback server on port 11451
* - Claude: Authorization Code Flow with local callback server on port 54545 (Anthropic OAuth)
* - Qwen: Device Code Flow (polling-based, NO callback port needed)
* - GHCP: Device Code Flow (polling-based, NO callback port needed)
*/
export const OAUTH_CALLBACK_PORTS: Partial<Record<CLIProxyProvider, number>> = {
gemini: 8085,
kiro: 9876,
// codex uses 1455
// agy uses 51121
// qwen uses Device Code Flow - no callback port needed
// ghcp uses Device Code Flow - no callback port needed
codex: 1455,
agy: 51121,
iflow: 11451,
// qwen: Device Code Flow - no callback port
// ghcp: Device Code Flow - no callback port
};
/**
+2 -2
View File
@@ -31,7 +31,7 @@ export const OAUTH_CALLBACK_PORTS: Record<CLIProxyProvider, number | null> = {
codex: 1455,
agy: 51121,
qwen: null, // Device Code Flow - no callback port
iflow: null, // Device Code Flow - no callback port
iflow: 11451, // Authorization Code Flow
kiro: 9876, // Authorization Code Flow
ghcp: null, // Device Code Flow - no callback port
};
@@ -49,7 +49,7 @@ export const OAUTH_FLOW_TYPES: Record<CLIProxyProvider, OAuthFlowType> = {
codex: 'authorization_code',
agy: 'authorization_code',
qwen: 'device_code',
iflow: 'device_code',
iflow: 'authorization_code',
kiro: 'authorization_code',
ghcp: 'device_code',
};