fix(agent-loop): redirect stdin from /dev/null to prevent tmux PTY blocking
Without `< /dev/null`, claude detects the tmux PTY as stdin and blocks waiting for user input that never arrives (the PTY never sends EOF). The 3-second stdin-timeout only fires for pipe stdin, not TTY stdin. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
a44a2e4834
commit
cc052db6c7
@@ -179,7 +179,7 @@ def _start_agent(prompt: str, session_name: str) -> str:
|
||||
f"claude --dangerously-skip-permissions"
|
||||
f" --name {shlex.quote(session_name)}"
|
||||
f" -p {shlex.quote(prompt)}"
|
||||
f" 2>&1 | tee {shlex.quote(str(log_file))}"
|
||||
f" < /dev/null 2>&1 | tee {shlex.quote(str(log_file))}"
|
||||
)
|
||||
subprocess.run(
|
||||
["tmux", "new-session", "-d", "-s", session_name, "bash", "-c", shell_cmd],
|
||||
|
||||
Reference in New Issue
Block a user