I put two images on the video editor, created a shot from them, and then generated a video based on this shot - but the shots seems to have disappeared: 1b5c2eb0-6111-446c-b3cf-409f46628484
User
Assistant
Shot exists in DB. Let me check its images and see if there's a UI/state issue.
Assistant
Diagnosis
The shot is not actually deleted — it's still in the DB. But the newly-generated video is orphaned, which likely explains why the UI looks wrong.
Shot 1b5c2eb0 ("Shot 15") exists with:
2 image children at timeline frames 0 & 50 ✅
1 video parent generation 9c052f69 (placeholder, location: NULL)
Under the video parent, there's only one child: 314fcf6d — a video from an earlier run (task 1b5d286a, 00:07:25, output seg00_output_000719).
The run you just did — task faf4361d (travel_segment, Complete at 00:13:58, output ) — is . No generation row references it:
User
THe shot is stll ther ebut the queston is why did it disappear from the video editor
Assistant
Why the shot would disappear from the editor UI
I traced the data path and I don't see a filter that excludes this shot. Here's what I found:
useListShots (src/shared/hooks/shots/useShotsQueries.ts:21) returns every row in shots for the project, ordered by position. No status/visibility/has-location filter. Shot 15 comes back as normal with:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Debug a production issue in the Reigh workspace. Use the debugging router below to diagnose the problem described in: Shot 1b5c2eb0-6111-446c-b3cf-409f46628484 disappeared from video editor after creating it from two images and generating a video from the shot
If no arguments are provided, run ./debug status from the workspace root to show current system state, then ask what to investigate.
Debugging Router
When something breaks, use this to find the right repo, tool, and log.
Repo Map
code
reigh-workspace/ <-- you are here
reigh-app/ Frontend (React/Vite) + Supabase edge functions + main debug CLI
reigh-worker/ GPU worker (Python, runs on RunPod pods)
reigh-worker-orchestrator/ Worker scaling + API task dispatch (runs on Railway)
Quick Start
bash
# From the workspace root:
./debug why <task_id> # Why did this task fail? (error + pipeline + worker)
./debug why <id1> <id2> # Investigate multiple tasks at once
./debug status # What's happening? (workers, queue, failures)
./debug kill <worker_id> # Kill a stuck/old worker
./debug reset <task_id> # Reset a task to Queued
For deeper investigation, use the per-repo tools:
Full task timeline — cd reigh-app && python scripts/debug.py task <task_id>
Pipeline tree + health — cd reigh-app && python scripts/debug.py pipeline <task_id>
Why was a worker killed — cd reigh-app && python scripts/debug.py why-killed <worker_id>
User clicks Generate
-> Frontend builds payload reigh-app/src/shared/lib/tasks/
-> Calls create-task edge function reigh-app/supabase/functions/create-task/
-> Row inserted in `tasks` table (status: Queued)
-> Worker polls claim-next-task edge function reigh-app/supabase/functions/claim-next-task/
-> Worker processes task on GPU reigh-worker/worker.py
-> Worker calls complete_task edge function reigh-app/supabase/functions/complete_task/
-> DB trigger creates generation row
-> Realtime broadcasts to UI
-> Video appears in gallery
For pipelines: Orchestrator creates parent task -> spawns child segment tasks -> each child follows the flow above -> stitch task joins outputs.
system_logs: Central Log
Every layer writes to system_logs Postgres table. 48h retention.
Who writes
source_type value
Edge Functions
edge_function
GPU Workers
worker
Orchestrator
orchestrator_gpu / orchestrator_api
Browser
browser (only when VITE_PERSIST_LOGS=true)
bash
cd reigh-app && python scripts/debug.py task <task_id> # Full timeline for a task
cd reigh-app && python scripts/debug.py logs --source worker --hours 1 # Filter by source
cd reigh-app && python scripts/debug.py logs --latest --tag MyTag # Browser logs by tag
docs/debugging.md — this routing document in full detail
seg00_output_001348_abea26.mp4
orphaned
code
tasks[] on 314fcf6d = ["1b5d286a-…"] ← only first run
updated_at = 00:07:25 ← never updated
Root cause
complete_task logged "Adding segment as variant to existing generation" and called createVariantOnParent(existingGenId=314fcf6d, …) — but the variant never landed. The parent's tasks array and updated_at are unchanged since the first run, and no other generation references task faf4361d or its output file.
So createVariant (in supabase/functions/complete_task/generation-parent.ts:194) silently no-op'd or its writes weren't committed. The edge function still logged "Task completed successfully" because the outer try was clean, but the actual variant row/update is missing.
Suggested next step
Look at createVariant (called from generation-parent.ts:194) — check whether it's writing to a separate variants table, the parent's children JSON, or doing a PATCH on the parent. Then inspect system_logs for that specific DB operation around 00:13:56–00:13:58 for task faf4361d. Want me to pull that and the createVariant source?
3 joined shot_generations rows (2 images + 1 video-parent placeholder)
All 3 referenced generation rows exist
All needed primary_variants exist
ShotsContext (src/shared/contexts/ShotsContext.tsx) passes them through unfiltered.
ShotsPanelContent (src/features/editor/components/ShotsPanelContent.tsx:223) only applies a search/sort — no visibility filter. ShotCard renders even when imageCount === 0, just showing "No images".
mapShotGenerationToRow (src/shared/hooks/shots/mappers.ts:50) only returns null if the joined generations row is missing — none are.
Where it could still go wrong (to verify in the browser)
Since DB + query + rendering all look clean, the cause is almost certainly client-state, not data:
Project selection — useListShots is keyed on selectedProjectId. If the editor is on a different project than 76262fc8-992c-4742-8647-de10df8d3193, Shot 15 won't appear. Check useProject()'s selectedProjectId in React DevTools.
React Query cache — staleTime: 5m, placeholderData: previousData. If a mutation (e.g. createShot / addImageToShot / video generation flow) did an optimistic update with a bad writer, the cached shots array could drop this entry while DB stays correct. Hit the "refresh shots" path or hard-reload; if the shot returns, that's the bug.
isProjectTransitioning (ShotsContext.tsx:25-58) forces shots = undefined while a project change is in-flight — if stuck, the panel shows "Loading shots…" instead of shots.
Horizontal scroll — the panel is flex-wrap, flexDirection: column, overflow-x-auto; with 15 shots it may simply be scrolled off-screen.
Want me to add a temporary [Shots] console tag logging shots.map(s => [s.id, s.name]) in ShotsContext so we can confirm whether shot 15 is in the client array at all?