feat(proxy): add universal proxy support and fix Gemini model resolution (#536)

Integrated undici ProxyAgent for native fetch and HttpsProxyAgent for axios/openai/anthropic. Upgraded @google/generative-ai to fix #536. Added OCO_PROXY config.

Co-authored-by: uni <uni@hanwei.ink>
This commit is contained in:
sky
2026-03-28 16:14:49 +00:00
committed by uni
parent f51393e37a
commit e27007b6fe
16 changed files with 123 additions and 158893 deletions

View File

@@ -5,9 +5,10 @@ import { cli } from 'cleye';
import packageJSON from '../package.json';
import { commit } from './commands/commit';
import { commitlintConfigCommand } from './commands/commitlint';
import { configCommand } from './commands/config';
import { configCommand, getConfig } from './commands/config';
import { hookCommand, isHookCalled } from './commands/githook.js';
import { prepareCommitMessageHook } from './commands/prepare-commit-msg-hook';
import { setupProxy } from './utils/proxy';
import {
setupCommand,
isFirstRun,
@@ -18,6 +19,9 @@ import { modelsCommand } from './commands/models';
import { checkIsLatestVersion } from './utils/checkIsLatestVersion';
import { runMigrations } from './migrations/_run.js';
const config = getConfig();
setupProxy(config.OCO_PROXY);
const extraArgs = process.argv.slice(2);
cli(