Skip to content

Commit de69ca3

Browse files
committed
Handle Docker TTY flags in non-interactive runs
Only pass -i when stdin is a TTY and -t when stdout is a TTY. This prevents `docker run` from failing with "the input device is not a TTY" when the local runner is executed from non-interactive environments (like the agent harness) while preserving interactive behavior in regular terminals.
1 parent 00f15ad commit de69ca3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

docker/run_tests.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,11 @@ def build_docker_run_command(
343343
tests_dir: str | None,
344344
pattern: str | None,
345345
) -> list[str]:
346-
command = ["docker", "run", "--rm", "-t"]
346+
command = ["docker", "run", "--rm"]
347347
if sys.stdin.isatty():
348348
command.append("-i")
349+
if sys.stdout.isatty():
350+
command.append("-t")
349351

350352
command.extend(["-e", f"PACKAGE={package_name}"])
351353
command.extend(["-e", f"UNITTESTING_SCHEDULER_DELAY_MS={scheduler_delay_ms}"])

0 commit comments

Comments
 (0)