Repository navigation
feat: scale edit timeouts, write outputs atomically, report progress (#81) - #136
Merged
Merged
Conversation
…81) All edit and produce tools now go through runEditJob: the timeout scales with the media's duration (SCREENCAST_JOB_TIMEOUT_MS overrides), ffmpeg writes a .partial sibling that is renamed on success and deleted on any failure, and -progress pipe:1 is forwarded as MCP progress notifications when the request has a progressToken. Cancelling a request kills ffmpeg. runCapture now waits for a killed child to exit before rejecting, so Windows cleanup no longer races the dying process (EPERM). Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Closes #81.
What
A new
src/utils/jobs.tswithrunEditJob(args, { output, durationSec, extra }), used by all 17 edit/produce tools in place ofrunFfmpeg(args, <fixed timeout>):max(10 min, 4 × duration); 30 min when the length can't be probed;SCREENCAST_JOB_TIMEOUT_MSoverrides. Each tool passes the length of what it writes (trim/clip segment length, speed ÷ factor, concat/assemble sum, title card duration, etc.).<name>.partial.<ext>(extension kept so the muxer doesn't change), renamed ontooutputon success, deleted on failure / timeout / cancel. A retry no longer trips "Output already exists".-progress pipe:1 -nostats, parsed incrementally (out_time_us, robust to chunk splits), forwarded asnotifications/progress(0-100, whole-percent throttled) when the request has aprogressToken.extra.signalkills ffmpeg.Bug found along the way
The new cancellation test failed on Windows with
EPERM:runCapturerejected as soon as it sent the kill, so cleanup tried to delete the.partialwhile the dying ffmpeg still held it open. It now settles after the child'sclose(with a 5 s grace timer ifclosenever comes). This also affects the old timeout path, so it fixes a latent issue there too.Tests
jobs.test.ts): timeout scaling / env override, partial naming, output retargeting, progress parser across chunk boundaries, reporter throttling and the no-token case.output; a cancelled job kills ffmpeg and leaves no partial.onprogress:compresson a 20 s 720p clip got 8 progress events ending at 100, output present, no.partial.Version 0.13.0, README, ROADMAP, CHANGELOG updated.
🤖 Generated with Claude Code