Print what each task's jobs did, not only how they ended

roledesk job embed and job score reported the final job's tally, which
says a job finished but not how many roles it embedded or scored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-09-23 12:22:21 +02:00
1 parent bc60324fab
commit 1f436104f3
1 file changed
+9 -2
+9 -2
View File
@@ -93,10 +93,17 @@ def run_job(args: argparse.Namespace) -> int:
started = queue.jobs.of_task(task_id)
if not started:
return 0
finals = [j for j in queue.jobs.of_cascade(started[0].cascade_id) if j.kind == FINAL]
cascade = queue.jobs.of_cascade(started[0].cascade_id)
finals = [j for j in cascade if j.kind == FINAL]
for final in finals:
# A task's own jobs say what the work did; the final job only
# tallies how they ended. Up to five, so a pull of twenty board
# batches stays one readable line.
work = [j.result for j in cascade if j.task_id == final.task_id
and j.kind != FINAL][:5]
print(json.dumps({"id": final.id, "state": final.state,
"result": final.result, "error": final.error}))
"result": final.result, "work": work,
"error": final.error}))
return 0 if all(f.state == "done" for f in finals) else 1
queued = queue.enqueue(args.kind)
queue.drain()