docs: update CHANGELOG for env var whitelist fix

This commit is contained in:
Hibryda 2026-03-08 22:49:02 +01:00
parent 74ce1ee083
commit 6585208233
3 changed files with 12 additions and 5 deletions

View file

@ -66,10 +66,13 @@ impl SidecarManager {
log::info!("Starting sidecar: {} {}", cmd.program, cmd.args.join(" "));
// Build a clean environment stripping all CLAUDE* vars to prevent
// the SDK from detecting nesting when BTerminal is launched from a Claude Code terminal
// Build a clean environment stripping CLAUDE* vars to prevent
// the SDK from detecting nesting when BTerminal is launched from a Claude Code terminal.
// Whitelist CLAUDE_CODE_EXPERIMENTAL_* so feature flags (e.g. agent teams) pass through.
let clean_env: Vec<(String, String)> = std::env::vars()
.filter(|(k, _)| !k.starts_with("CLAUDE"))
.filter(|(k, _)| {
!k.starts_with("CLAUDE") || k.starts_with("CLAUDE_CODE_EXPERIMENTAL_")
})
.collect();
let mut child = Command::new(&cmd.program)

View file

@ -83,10 +83,13 @@ async function handleQuery(msg: QueryMessage) {
const controller = new AbortController();
// Strip CLAUDE* env vars to prevent nesting detection by the spawned CLI
// Strip CLAUDE* and ANTHROPIC_* env vars to prevent nesting detection by the spawned CLI.
// Whitelist CLAUDE_CODE_EXPERIMENTAL_* so feature flags (e.g. agent teams) pass through.
const cleanEnv: Record<string, string | undefined> = {};
for (const [key, value] of Object.entries(process.env)) {
if (!key.startsWith('CLAUDE') && !key.startsWith('ANTHROPIC_')) {
if (key.startsWith('CLAUDE_CODE_EXPERIMENTAL_')) {
cleanEnv[key] = value;
} else if (!key.startsWith('CLAUDE') && !key.startsWith('ANTHROPIC_')) {
cleanEnv[key] = value;
}
}