Skip to content

fix: suppress VaceEncodingBlock per-chunk crash storm for stale asset paths (#689)#691

Open
livepeer-tessa wants to merge 1 commit intomainfrom
fix/vace-stale-asset-path-689
Open

fix: suppress VaceEncodingBlock per-chunk crash storm for stale asset paths (#689)#691
livepeer-tessa wants to merge 1 commit intomainfrom
fix/vace-stale-asset-path-689

Conversation

@livepeer-tessa
Copy link
Contributor

Summary

Fixes #689.

When a saved workflow references an image path that no longer exists on the current fal.ai worker (ephemeral workers don't persist /home/rio/.daydream-scope/assets/), VaceEncodingBlock was crashing on every processed chunk, producing 150+ identical ERROR lines in a single session.

Root cause: Image.open(ref_path) in load_and_prepare_reference_images throws FileNotFoundError unconditionally. The pipeline processor catches the exception per-chunk and keeps running — so a single stale asset floods logs for the entire session.

Changes

vace_encoding.py

  • Add _logged_missing_assets: set[str] to __init__ — tracks which missing paths have already been reported
  • Add _validate_image_paths(paths) — checks os.path.exists() for every referenced image before encoding; logs ERROR once per unique missing path, then silently suppresses repeats
  • In __call__, call _validate_image_paths before any encoding attempt; short-circuit with vace_context=None if any path is missing (same behaviour as the existing no-inputs skip path)

tests/test_vace_encoding_block_missing_asset.py (new)

9 tests covering:

  • Valid / None / missing path return values
  • Log-once suppression (150-chunk storm simulation asserts exactly 1 ERROR)
  • Mixed valid + missing paths
  • Multiple distinct missing paths each logged once
  • Full __call__ integration: skips encoding, sets vace_context=None, logs once

Behaviour after this fix

Situation Before After
Stale asset path FileNotFoundError × N chunks 1× ERROR, N-1 silent skips
Valid path Encodes normally Encodes normally (unchanged)
No images provided Skips (no change) Skips (no change)

Related

… paths (#689)

When a saved workflow references an image path that no longer exists on
the current fal.ai worker (ephemeral workers don't persist
/home/rio/.daydream-scope/assets/), VaceEncodingBlock was crashing on
every processed chunk — producing 150+ identical ERROR lines in a single
session (fal.ai job f01568f1-17dd-4ff7-97f5-ca0912140395, 2026-03-14).

Fix:
- Add _validate_image_paths() helper that checks os.path.exists() for
  every referenced image (vace_ref_images, first_frame_image,
  last_frame_image) before attempting to encode.
- First missing path → logs ERROR with clear guidance to re-upload.
- Subsequent calls for the same missing path → silent (no repeat storm).
- Block returns early with vace_context=None, matching the existing
  'no inputs provided' skip path.

Adds 9 regression tests covering the log-once suppression behaviour,
including a 150-chunk simulation that asserts exactly 1 ERROR is emitted.

Related: #524 (Windows-style asset paths — same block, different cause)
Related: #685, #673 (same per-chunk flood pattern, different root cause)
Signed-off-by: livepeer-robot <robot@livepeer.org>
@coderabbitai
Copy link

coderabbitai bot commented Mar 14, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5424b35a-a5fe-4e8f-8714-1476984ed882

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/vace-stale-asset-path-689
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

🚀 fal.ai Preview Deployment

App ID daydream/scope-pr-691--preview
WebSocket wss://fal.run/daydream/scope-pr-691--preview/ws
Commit e39d4b9

Testing

Connect to this preview deployment by running this on your branch:

uv run build && SCOPE_CLOUD_APP_ID="daydream/scope-pr-691--preview/ws" uv run daydream-scope

🧪 E2E tests will run automatically against this deployment.

@github-actions
Copy link
Contributor

✅ E2E Tests passed

Status passed
fal App daydream/scope-pr-691--preview
Run View logs

Test Artifacts

Check the workflow run for screenshots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VaceEncodingBlock crashes on fal.ai: stale asset path not present on worker (/home/rio/.daydream-scope/assets/)

1 participant