fix(claude-code): inject HOME and null stdin in stream() subprocess

Mirror the same environment fixes applied to complete(): inject HOME so
the CLI locates ~/.claude/credentials when running as a service, and set
stdin to null so the process does not block on interactive input.

Refs: RightNow-AI/openfang#295
This commit is contained in:
jam
2026-03-23 09:35:05 +01:00
parent d7bd5c6636
commit 4b3b602457
@@ -474,6 +474,11 @@ impl LlmDriver for ClaudeCodeDriver {
Self::apply_env_filter(&mut cmd);
// Same HOME and stdin hygiene as the non-streaming path.
if let Some(home) = home_dir() {
cmd.env("HOME", &home);
}
cmd.stdin(std::process::Stdio::null());
cmd.stdout(std::process::Stdio::piped());
cmd.stderr(std::process::Stdio::piped());