diff --git a/strix/core/inputs.py b/strix/core/inputs.py index 2bcc077d7..b5aaf3ad2 100644 --- a/strix/core/inputs.py +++ b/strix/core/inputs.py @@ -73,7 +73,7 @@ def build_root_task(scan_config: dict[str, Any]) -> str: if deleted: parts.append(f"- {label}: {deleted} deleted file(s) are context-only") - task = " ".join(parts) + task = "\n".join(parts) if user_instructions: task = f"{task}\n\nSpecial instructions: {user_instructions}" return task diff --git a/tests/test_inputs.py b/tests/test_inputs.py index c8fcf6013..ee9aa43be 100644 --- a/tests/test_inputs.py +++ b/tests/test_inputs.py @@ -93,6 +93,20 @@ def test_build_root_task_web_application_with_instructions() -> None: assert "Special instructions: Focus on auth." in task +def test_build_root_task_multiple_targets_are_newline_separated() -> None: + config = { + "targets": [ + {"type": "web_application", "details": {"target_url": "https://a.example.com"}}, + {"type": "web_application", "details": {"target_url": "https://b.example.com"}}, + ], + } + task = build_root_task(config) + + assert "\n- https://a.example.com" in task + assert "\n- https://b.example.com" in task + assert "https://a.example.com - https://b.example.com" not in task + + def test_build_root_task_diff_scope() -> None: config = { "targets": [],