Skip to content

Commit 7402f04

Browse files
Kasper JungeRalphify
authored andcommitted
refactor: inline stream_cmd into Popen call in _run_agent_streaming
The local was constructed and read exactly once on the very next statement as the first positional arg to `subprocess.Popen(...)`. The three appended tokens are already named constants (`_OUTPUT_FORMAT_FLAG`, `_STREAM_FORMAT`, `_VERBOSE_FLAG`) so the intent reads clearly at the call site without the intermediate binding. Same Phase 4 inline-alias shape as 66d6c60 (`remaining`), b24accf (`reader`), 2fda4f0 (`visible`), and e1ad87a (`binary`). Co-authored-by: Ralphify <noreply@ralphify.co>
1 parent 1161e2d commit 7402f04

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/ralphify/_agent.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,6 @@ def _run_agent_streaming(
419419
stderr volume can't deadlock the child on a full OS pipe buffer while
420420
the main thread is reading stdout.
421421
"""
422-
stream_cmd = cmd + [_OUTPUT_FORMAT_FLAG, _STREAM_FORMAT, _VERBOSE_FLAG]
423422
start = time.monotonic()
424423
deadline = (start + timeout) if timeout is not None else None
425424

@@ -428,7 +427,7 @@ def _run_agent_streaming(
428427
stderr_thread: threading.Thread | None = None
429428

430429
proc = subprocess.Popen(
431-
stream_cmd,
430+
cmd + [_OUTPUT_FORMAT_FLAG, _STREAM_FORMAT, _VERBOSE_FLAG],
432431
stdin=subprocess.PIPE,
433432
stdout=subprocess.PIPE,
434433
stderr=subprocess.PIPE,

0 commit comments

Comments
 (0)