mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 10:16:49 +00:00
feat(env): add debug logging for global env injection
- log injected global env var names in debug mode (CCS_DEBUG) - log when telemetry/reporting env vars are applied in CLIProxy
This commit is contained in:
@@ -499,6 +499,12 @@ async function main(): Promise<void> {
|
||||
const globalEnvConfig = getGlobalEnvConfig();
|
||||
const globalEnv = globalEnvConfig.enabled ? globalEnvConfig.env : {};
|
||||
|
||||
// Log global env injection for visibility (debug mode only)
|
||||
if (globalEnvConfig.enabled && Object.keys(globalEnv).length > 0 && process.env.CCS_DEBUG) {
|
||||
const envNames = Object.keys(globalEnv).join(', ');
|
||||
console.error(`[i] Global env: ${envNames}`);
|
||||
}
|
||||
|
||||
// CRITICAL: Load settings and explicitly set ANTHROPIC_* env vars
|
||||
// to prevent inheriting stale values from previous CLIProxy sessions.
|
||||
// Environment variables take precedence over --settings file values,
|
||||
|
||||
@@ -530,6 +530,10 @@ export async function execClaudeWithCLIProxy(
|
||||
if (Object.keys(webSearchEnv).length > 0) {
|
||||
log(`Claude env: WebSearch config=${JSON.stringify(webSearchEnv)}`);
|
||||
}
|
||||
// Log global env vars for visibility
|
||||
if (envVars.DISABLE_TELEMETRY || envVars.DISABLE_ERROR_REPORTING || envVars.DISABLE_BUG_COMMAND) {
|
||||
log(`Claude env: Global env applied (telemetry/reporting disabled)`);
|
||||
}
|
||||
|
||||
// Filter out CCS-specific flags before passing to Claude CLI
|
||||
// Note: Proxy flags (--proxy-host, etc.) already stripped by resolveProxyConfig()
|
||||
|
||||
Reference in New Issue
Block a user