refactor(hooks): deprecate block-image-read, add CLIProxy fallback

- Remove redundant block-image-read.cjs hook (image-analyzer handles all)
- Add fallback blocking when CLIProxy unavailable (prevents context overflow)
- Simplify fallback message to prevent context pollution/hallucination
- Remove image-read-block-hook-env.ts and related exports
- Update comments per PR #442 review suggestions
- Add defensive check for empty models array

Closes #426
This commit is contained in:
kaitranntt committed 2026-02-04 00:49:52 -05:00
1 parent 26f4021770
commit 51b719ef34
11 files changed
+47 -362

No files matched your search

+2 -4
View File
@@ -7,7 +7,6 @@
import { spawn, ChildProcess } from 'child_process';
import { ErrorManager } from './error-manager';
import { getWebSearchHookEnv } from './websearch-manager';
import { getImageReadBlockHookEnv } from './hooks/image-read-block-hook-env';
/**
* Escape arguments for shell execution (Windows compatibility)
@@ -53,12 +52,11 @@ export function execClaude(
// Get WebSearch hook config env vars
const webSearchEnv = getWebSearchHookEnv();
const imageReadBlockEnv = getImageReadBlockHookEnv();
// Prepare environment (merge with process.env if envVars provided)
const env = envVars
? { ...process.env, ...envVars, ...webSearchEnv, ...imageReadBlockEnv }
: { ...process.env, ...webSearchEnv, ...imageReadBlockEnv };
? { ...process.env, ...envVars, ...webSearchEnv }
: { ...process.env, ...webSearchEnv };
let child: ChildProcess;
if (needsShell) {