From 5c802b0daa3e3d8f72e10025fa1eec63b7fbee5b Mon Sep 17 00:00:00 2001 From: Dinakar Sarbada Date: Wed, 6 May 2026 12:35:50 -0700 Subject: [PATCH 1/2] fix: route parallel web backend through grounding --- skills/last30days/scripts/lib/pipeline.py | 2 +- tests/test_pipeline_v3.py | 26 +++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/skills/last30days/scripts/lib/pipeline.py b/skills/last30days/scripts/lib/pipeline.py index 30bcbbf..5f095dc 100644 --- a/skills/last30days/scripts/lib/pipeline.py +++ b/skills/last30days/scripts/lib/pipeline.py @@ -203,7 +203,7 @@ def run( available = [source for source in available if source in requested_sources] if web_backend == "none": available = [s for s in available if s != "grounding"] - elif web_backend in ("brave", "exa", "serper") and "grounding" not in available: + elif web_backend in ("brave", "exa", "serper", "parallel") and "grounding" not in available: available.append("grounding") if not available: raise RuntimeError("No sources are available for this run.") diff --git a/tests/test_pipeline_v3.py b/tests/test_pipeline_v3.py index 5ccddd1..01c970d 100644 --- a/tests/test_pipeline_v3.py +++ b/tests/test_pipeline_v3.py @@ -52,6 +52,32 @@ class PipelineV3Tests(unittest.TestCase): # At least one per-subquery line. self.assertIn("[Planner] sq1 label=", output) + def test_parallel_web_backend_enables_grounding_source(self): + plan = { + "intent": "news", + "freshness_mode": "balanced_recent", + "cluster_mode": "timeline", + "subqueries": [ + { + "label": "primary", + "search_query": "test topic", + "ranking_query": "What happened with test topic?", + "sources": ["grounding"], + } + ], + "source_weights": {"grounding": 1.0}, + } + report = pipeline.run( + topic="test topic", + config={"LAST30DAYS_REASONING_PROVIDER": "auto"}, + depth="quick", + requested_sources=["grounding"], + web_backend="parallel", + external_plan=plan, + ) + self.assertIn("grounding", report.errors_by_source) + self.assertIn("PARALLEL_API_KEY", report.errors_by_source["grounding"]) + class TestSourceFetchCap(unittest.TestCase): """X source fetch count must be capped by MAX_SOURCE_FETCHES.""" From ec0b126af60e1c72c22dadfcd42b66287be8067c Mon Sep 17 00:00:00 2001 From: Trevin Chow Date: Sun, 17 May 2026 00:21:57 -0700 Subject: [PATCH 2/2] test(pipeline): relax grounding assertion to stable source key --- tests/test_pipeline_v3.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_pipeline_v3.py b/tests/test_pipeline_v3.py index 01c970d..27e1cfd 100644 --- a/tests/test_pipeline_v3.py +++ b/tests/test_pipeline_v3.py @@ -75,8 +75,12 @@ class PipelineV3Tests(unittest.TestCase): web_backend="parallel", external_plan=plan, ) + # Anchor on the stable source key, not the exact wording of the + # grounding.py error message. Phrasing can shift (e.g., when the + # missing-key check moves or the message is reworded) without + # changing the contract that the grounding source registers an + # error when its required backend key is unset. self.assertIn("grounding", report.errors_by_source) - self.assertIn("PARALLEL_API_KEY", report.errors_by_source["grounding"]) class TestSourceFetchCap(unittest.TestCase):