Conversation
The pipeline stores local media as "file://" + str(path). On Windows that is file://C:\...\x.mp4, which urlparse splits into netloc="C:\..." and an empty path, so every Path(parsed.path) caller decided the clip was missing and fell through to an HTTP download that then failed. Add agent.utils.paths.file_url_to_path (netloc+path via url2pathname, so both as_uri() and the naive form work) and use it in video_reviewer, api/videos, api/projects and assistant_provider. Make the two test_cli_providers assertions spell /tmp the way the host OS does. Windows: 12 failed -> 0 failed (445 passed).
Owner
|
is that fixes work for both other OS systems? |
OmniVoice.generate() returns list[numpy.ndarray] (1-D). torchaudio.save needs (channels, samples), so every TTS call failed at the last step with 'Expected 2D Tensor, got 1D' after the model had generated fine. Wrap the item via a shared _to_wav_tensor helper in both inline scripts. Also pass config.TTS_DEVICE through to device_map instead of hardcoding cpu — TTS_DEVICE already existed in config but was never used. On an RTX 3060 a template takes ~23s including model load vs minutes on CPU.
PeerapolSelanon
added a commit
to PeerapolSelanon/flowkit
that referenced
this pull request
Sep 29, 2026
Port of crisng95#69 (khnhlt). "file://" + str(path) on Windows parses with the path in netloc and an empty .path, so every local clip/image looked missing to review, concat/finalize, thumbnails and the assistant provider. Adds agent.utils.paths.file_url_to_path and routes all callers through it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
added 4 commits
September 30, 2026 12:59
The queue path (GENERATE_VIDEO -> FlowProvider._run_video) was hardwired
to Veo. Omni Flash was reachable only through the ad-hoc
/api/flow/generate-video endpoint, which does not persist results to the
scene, so choosing Omni meant leaving the pipeline (no review, no concat,
no retry-repoll).
Add project.video_model_family ('veo' | 'omni_flash', default veo, with
schema migration), thread it through ProjectCreate/ProjectUpdate, the SDK
model/repository, and into job.extra. _run_video dispatches on it:
omni_flash -> generate_omni_flash_first_frame_video / _first_last_video,
which return the same batch-operation shape, so polling and the
already-submitted guard are shared. Defaults come from
OMNI_FLASH_DURATION_S / OMNI_FLASH_RESOLUTION.
Each generate mints a reCAPTCHA in the Flow tab. A worker firing ~30 of them 10s apart from a background tab degrades the session score until Flow returns PUBLIC_ERROR_UNUSUAL_ACTIVITY on every call, while the same account still generates fine by hand. Expose the provider's max_concurrent and cooldown_s via env so operators can slow down without editing code; defaults unchanged.
…id-vowel OmniVoice returns audio that stops at the last voiced sample: zero release tail, final vowel clipped. Any pipeline that trims video to narrator length then cuts exactly where the voice is still ringing, which reads as an abrupt scene change. Fade the last 60 ms and append 0.4 s of silence inside the save path so every wav ends cleanly and downstream trims get a breath.
A scene whose narration runs 7.6s cannot breathe inside an 8s clip; the only post fix is a frozen last frame, which reads as a glitch. Pass scene.duration into job.extra and round it UP to the next supported Omni Flash step (4/6/8/10) in the provider — rounding down would clip the voice. Veo ignores the field. Defaults unchanged.
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On Windows every local clip/image looked "missing" to the pipeline, so review, concat/finalize, thumbnail generation and the assistant provider all failed even though the files were on disk.
Root cause. Local media is stored as
"file://" + str(path). On POSIX that isfile:///tmp/x.mp4andurlparse(url).pathreads it back fine. On Windows it isfile://C:\...\x.mp4, whichurlparsesplits intonetloc="C:\...\x.mp4"andpath=""— so everyPath(parsed.path)caller got an empty path, decided the file did not exist, and fell through to an HTTP download of afile://URL (InvalidUrlClientError: backslash not allowed in authority).Fix. Add
agent.utils.paths.file_url_to_path()—netloc + paththroughurllib.request.url2pathname, so both the RFC 8089 formPath.as_uri()produces (file:///C:/x/y.png, percent-encoded) and the naive stored form work on every OS — and use it in the five places that parsedfile://by hand:agent/services/video_reviewer.py—_local_media_path(also treats a bareC:\...path as a path, not a scheme)agent/api/videos.py—_resolve_media_local(concat / finalize)agent/api/projects.py— thumbnail copy from provideragent/sdk/services/assistant_provider.py—register_existing_image,_audio_resultTwo
test_cli_providersassertions hard-coded/tmp; they now spell it viastr(Path(...))so they hold on any OS. No behaviour change on POSIX.Test plan
tests/unit/test_file_url_paths.py(6 cases: naive form,as_uri()form with%20, POSIX form, non-file / empty /None, bare path, Windows drive-letter form) — written red first, green after the fixpython -m agent.mainstarts,/health→status: okNotes
/tmpintest_cli_providersresolves to\tmpon Windows — the assertions were the only thing wrong there; the code under test is fine.