From e31d1abd1eef522a06ecf5bfda8f5851acc991f8 Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Sun, 17 May 2026 13:36:59 +0200 Subject: [PATCH] u/cascade: add session name to results; sync schema with actual fields --- scripts/u/cascade | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/u/cascade b/scripts/u/cascade index f27378b..d3962a5 100755 --- a/scripts/u/cascade +++ b/scripts/u/cascade @@ -110,6 +110,7 @@ $instruction" > "${tmpdir}/${sid}.out" 2>&1 && touch "${tmpdir}/${sid}.ok" && br sleep "$((attempt * 2))" done echo "$attempt" > "${tmpdir}/${sid}.attempts" + echo "$name" > "${tmpdir}/${sid}.session" ) & pids+=($!) done @@ -131,13 +132,14 @@ for sid in "${workers[@]}"; do fi out=$(cat "${tmpdir}/${sid}.out" 2>/dev/null || echo "(no output)") attempts=$(cat "${tmpdir}/${sid}.attempts" 2>/dev/null || echo 1) + session_name=$(cat "${tmpdir}/${sid}.session" 2>/dev/null || echo "$sid") if [ "${#out}" -gt "$MAX_OUTPUT" ]; then out="${out:0:$MAX_OUTPUT} ...(truncated, ${#out} chars total)" fi [ "$first" -eq 1 ] && first=0 || results_json="${results_json}," - results_json="${results_json}$(jq -n --arg id "$sid" --arg status "$status" --arg output "$out" --argjson attempts "$attempts" \ - '{id: $id, status: $status, attempts: $attempts, output: $output}')" + results_json="${results_json}$(jq -n --arg id "$sid" --arg status "$status" --arg output "$out" --argjson attempts "$attempts" --arg session "$session_name" \ + '{id: $id, status: $status, attempts: $attempts, session: $session, output: $output}')" done results_json="${results_json}]" @@ -154,7 +156,7 @@ else synth_flags+=(-json) 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\": [\"\"]} +Output schema: {\"summary\": \"\", \"answer\": \"\", \"worker_results\": [{\"id\": \"\", \"status\": \"done|failed\", \"attempts\": , \"session\": \"\", \"output\": \"\"}], \"errors\": [\"\"]} ORIGINAL TASK: $task