feat(hooks): extend image analyzer to all CLIProxy providers

- Derive supported profiles from provider_models config dynamically
- Add qwen and iflow to default provider_models
- Full parity with WebSearch hook injection pattern

Providers now covered: agy, gemini, codex, kiro, ghcp, claude, qwen, iflow
This commit is contained in:
kaitranntt
2026-02-04 00:14:42 -05:00
parent ec4e1ae31c
commit 3252228e5c
2 changed files with 8 additions and 5 deletions
+2
View File
@@ -545,6 +545,8 @@ export const DEFAULT_IMAGE_ANALYSIS_CONFIG: ImageAnalysisConfig = {
kiro: 'kiro-claude-haiku-4-5',
ghcp: 'claude-haiku-4.5',
claude: 'claude-haiku-4-5-20251001',
qwen: 'vision-model',
iflow: 'qwen3-vl-plus',
},
};
@@ -94,14 +94,15 @@ export function ensureProfileHooks(profileName: string): boolean {
return false;
}
// Only inject for CLIProxy profiles with vision support
const visionProfiles = ['agy', 'gemini'];
if (!visionProfiles.includes(profileName)) {
const imageConfig = getImageAnalysisConfig();
// Only inject for profiles that have a model mapping in provider_models
// This allows dynamic extension without hardcoding profile names
const configuredProviders = Object.keys(imageConfig.provider_models);
if (!configuredProviders.includes(profileName)) {
return false;
}
const imageConfig = getImageAnalysisConfig();
// Skip if image analysis is disabled
if (!imageConfig.enabled) {
return false;