From 42929b4c57e8e26a2f5335862887731a34f2eaec Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Sun, 17 May 2026 13:32:43 +0200 Subject: [PATCH] u/cascade: pass JSON results directly to planner synthesis prompt --- scripts/u/cascade | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/scripts/u/cascade b/scripts/u/cascade index ffe747f..30b0d74 100755 --- a/scripts/u/cascade +++ b/scripts/u/cascade @@ -125,29 +125,26 @@ if [ "$synthesize" -eq 0 ]; then printf '%s\n' "$results_json" | jq . [ "$failures" -gt 0 ] && exit 1 else - # Render results as readable text for the planner prompt. - results_text=$(printf '%s\n' "$results_json" | jq -r '.[] | "--- \(.id) [STATUS: \(.status)] ---\n\(.output)\n"') - synth_flags=(-backend "$PB" -model "$PM") if [ "$json_output" -eq 1 ]; then synth_flags+=(-json) - synth_prompt="Synthesize these worker results into a structured JSON response for the original task. Note: workers marked [STATUS: failed] did not complete successfully — include them in errors. + synth_prompt="Synthesize these worker results into a structured JSON response for the original task. Note: workers with status \"failed\" did not complete successfully — include them in errors. Output schema: {\"summary\": \"\", \"answer\": \"\", \"worker_results\": [{\"id\": \"\", \"status\": \"done|failed\", \"output\": \"\"}], \"errors\": [\"\"]} ORIGINAL TASK: $task -WORKER RESULTS: -$results_text" +WORKER RESULTS (JSON): +$results_json" else - synth_prompt="Synthesize these worker results into a final, coherent answer to the original task. Note: workers marked [STATUS: failed] did not complete successfully — account for this in your synthesis. + synth_prompt="Synthesize these worker results into a final, coherent answer to the original task. Note: workers with status \"failed\" did not complete successfully — account for this in your synthesis. ORIGINAL TASK: $task -WORKER RESULTS: -$results_text" +WORKER RESULTS (JSON): +$results_json" fi "$B" "${synth_flags[@]}" "$synth_prompt" fi