Skip to content

Commit 841f8c0

Browse files
authored
fix: uses empty system prompt by default (#290)
fix #289
1 parent 5256af2 commit 841f8c0

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/claude_agent_sdk/_internal/transport/subprocess_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def _build_command(self) -> list[str]:
9797
cmd = [self._cli_path, "--output-format", "stream-json", "--verbose"]
9898

9999
if self._options.system_prompt is None:
100-
pass
100+
cmd.extend(["--system-prompt", ""])
101101
elif isinstance(self._options.system_prompt, str):
102102
cmd.extend(["--system-prompt", self._options.system_prompt])
103103
else:

tests/test_transport.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ def test_build_command_basic(self):
4646
assert "stream-json" in cmd
4747
assert "--print" in cmd
4848
assert "Hello" in cmd
49+
assert "--system-prompt" in cmd
50+
assert cmd[cmd.index("--system-prompt") + 1] == ""
4951

5052
def test_cli_path_accepts_pathlib_path(self):
5153
"""Test that cli_path accepts pathlib.Path objects."""

0 commit comments

Comments
 (0)