Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions llm_claude_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ def _execute_streaming(
self, cmd: list, timeout: int, response: llm.Response, cwd: Optional[str] = None
) -> Iterator[str]:
"""Execute with streaming JSON output."""
# --verbose is required for stream-json with -p mode
cmd.extend(["--output-format", "stream-json", "--verbose"])
# --include-partial-messages provides smoother streaming with partial message content
cmd.extend(["--output-format", "stream-json", "--include-partial-messages"])

try:
process = subprocess.Popen(
Expand Down
8 changes: 4 additions & 4 deletions tests/test_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def kill(self):
class TestStreaming:
"""Tests for streaming response handling."""

def test_streaming_command_includes_verbose(self, mock_llm_response):
"""Test streaming mode includes --verbose flag required by CLI for stream-json with -p."""
def test_streaming_command_includes_required_flags(self, mock_llm_response):
"""Test streaming mode includes required flags for stream-json with -p."""
model = ClaudeCode(model_id="claude-code")

prompt = MagicMock()
Expand All @@ -58,10 +58,10 @@ def test_streaming_command_includes_verbose(self, mock_llm_response):
with patch("subprocess.Popen", return_value=MockProcess(lines)) as mock_popen:
list(model.execute(prompt, stream=True, response=mock_llm_response))

# Verify --verbose is included in the command
# Verify required streaming flags are included in the command
call_args = mock_popen.call_args
cmd = call_args[0][0]
assert "--verbose" in cmd, f"--verbose not found in command: {cmd}"
assert "--include-partial-messages" in cmd, f"--include-partial-messages not found in command: {cmd}"
assert "--output-format" in cmd
stream_json_index = cmd.index("--output-format") + 1
assert cmd[stream_json_index] == "stream-json"
Expand Down