fix(proxy): unset CLAUDECODE env vars before spawning CLI
Allows the proxy to spawn claude CLI even when the dev server was started from within a Claude Code session. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
b08fd86f41
commit
82718a3453
@@ -355,6 +355,11 @@ const server = createServer((req, res) => {
|
|||||||
console.log(`[proxy] → claude -p --model ${modelFlag}${webSearch ? ' [WebSearch]' : ''} "${lastUserMsg.slice(0, 60)}..."`)
|
console.log(`[proxy] → claude -p --model ${modelFlag}${webSearch ? ' [WebSearch]' : ''} "${lastUserMsg.slice(0, 60)}..."`)
|
||||||
|
|
||||||
const procEnv = { ...process.env, NO_COLOR: '1', TERM: 'dumb' }
|
const procEnv = { ...process.env, NO_COLOR: '1', TERM: 'dumb' }
|
||||||
|
// Allow CLI to spawn even when dev server is started from inside Claude Code
|
||||||
|
delete procEnv.CLAUDECODE
|
||||||
|
delete procEnv.CLAUDE_CODE
|
||||||
|
delete procEnv.ANTHROPIC_CLAUDE_CODE
|
||||||
|
delete procEnv.CLAUDE_CODE_ENTRYPOINT
|
||||||
if (webSearch === true) {
|
if (webSearch === true) {
|
||||||
delete procEnv.DISALLOWED_TOOLS
|
delete procEnv.DISALLOWED_TOOLS
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user