Commit e88667d
fix: clear CLAUDECODE env to prevent nested-session detection
When claude-agent-acp is spawned from within a Claude Code session
(e.g. via acpx or other orchestrators), the parent process sets
CLAUDECODE=1. This env var is inherited by the subprocess, causing
Claude Code to detect a "nested session" and exit immediately.
The result is a generic -32603 "Internal error" with details
"Query closed before response received" on every session/new call.
Fix: clear CLAUDECODE in the subprocess environment so the spawned
Claude Code instance starts normally.
Also improve error handling for session/new: the v0.20.0 fix for
"Query closed before response received" only covered the loadSession
path (resume). The same error on newSession was left unhandled,
producing an opaque "Internal error". Now it returns a meaningful
message suggesting to check Claude Code installation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent c13edf3 commit e88667d
1 file changed
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1227 | 1227 | | |
1228 | 1228 | | |
1229 | 1229 | | |
| 1230 | + | |
1230 | 1231 | | |
1231 | 1232 | | |
1232 | 1233 | | |
| |||
1303 | 1304 | | |
1304 | 1305 | | |
1305 | 1306 | | |
1306 | | - | |
1307 | 1307 | | |
1308 | 1308 | | |
1309 | 1309 | | |
1310 | | - | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
1311 | 1320 | | |
1312 | 1321 | | |
1313 | 1322 | | |
| |||
0 commit comments