From 1bf4310f60b647f48e42716b91fe71c822563dc7 Mon Sep 17 00:00:00 2001 From: Sean Kim Date: Sat, 4 Jul 2026 12:44:06 -0700 Subject: [PATCH] fix: join root task sections with newlines build_root_task assembled section headers and per-item bullets as separate list elements, then joined them with a single space. Scans with more than one target (or diff-scope constraints) rendered every bullet on one run-on line, e.g. "URLs: - a - b" instead of a proper list. Join with a newline to match the sibling child_initial_input builder. Add a regression test covering multiple targets. Closes #682 --- strix/core/inputs.py | 2 +- tests/test_inputs.py | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) 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": [],