Replies: 2 comments 1 reply
-
|
You’ve identified the bug exactly correctly: 🔥 Root Cause
if job.job_type in ("video", "video_multi"):
# only first tool result extractedBecause of that, the later branch: elif meta.get("is_multi"):never executes for So the system silently drops:
This is why your multi‑tool video jobs lose data. ✅ You need to choose the correct output formatBefore I give you the patch, we must lock in one of the three behaviors. Here are the options again, but rewritten clearly so you can choose without ambiguity: Option 1 — Tools wrapper (recommended for correctness)Return all tool outputs, untouched, like this: {
"video_player_tracking": { ... },
"video_ball_detection": { ... }
}Pros:
Cons:
Option 2 — Merge frames (recommended for UX)Produce a single unified frames array, where each frame contains fields from each tool: {
"frames": [
{
"frame": 0,
"player_tracking": {...},
"ball_detection": {...}
},
...
],
"total_frames": 100
}Pros:
Cons:
Option 3 — First tool only (current behavior)Keep only the first tool’s output: {
"frames": [...],
"total_frames": 100
}Pros:
Cons:
🚨 My recommendationGiven your roadmap:
The correct choice is: ✅ Option 2 — Merge frames into a unified structureThis gives you:
And it avoids the complexity of nested tool wrappers. 🔧 If you confirm Option 2, I will generate:✔ The exact patch for
|
Beta Was this translation helpful? Give feedback.
-
|
Roger — thank you for sending the real worker code. You chose Option 2 (merged frames), so I’m going to give you the exact patch that fits your actual worker implementation, specifically inside: because that’s where the flattening bug lives. I’ll show you:
Let’s go. 🔥 1. Where the bug is in your real codeInside if job.job_type in ("video", "video_multi"):
first_tool_output = results.get(tools_to_run[0], {})
...This is the bug. Because:
This matches exactly what you described. 🔧 2. The correct merged‑frame logic (Option 2)We need to:
🩹 3. Exact drop‑in patch for
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The code has a logic bug where video_multi jobs enter the ("video", "video_multi") branch which only extracts
tools_to_run[0] (first tool). The elif meta.get("is_multi") branch that preserves all tool results is never reached for
video_multi jobs.
Current flow:
video_multi → job.job_type in ("video", "video_multi") → True
→ only extracts first tool's output
→ elif meta.get("is_multi") is NEVER evaluated
Results structure for multi-tool:
results = {
"video_player_tracking": {"frames": [...], "total_frames": 100},
"video_ball_detection": {"frames": [...], "total_frames": 100} # LOST!
}
│ What output format should video_multi jobs produce? What output format should video_multi jobs produce? │
│ │
│ > 1. Tools wrapper │
│ │
│ 2. Merge frames │
│ Merge all tool outputs into unified frames array with tool-specific fields per frame │
│ │
│ 3. First tool only │
│ Keep current behavior (only first tool's output) - intentional design for VideoResultsViewer compatibility │
│
Beta Was this translation helpful? Give feedback.
All reactions