Repository navigation
refactor: resolve the video size of a context in one place - #5359
Merged
Merged
Conversation
_record_video already resolves recordVideo's size from the size given, the viewport or 1280x720. New Context, New Persistent Context and register_adopted_context worked it out again with _video_size for the context cache, each in its own way. They now cache the resolved size, and a context without a video caches none, since only an embedded video reads it. The video dict that Node returns and _embed_video reads is typed as ContextVideo, and _video_size and _record_video take RecordVideo and ViewportDimensions instead of mappings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aaltat
force-pushed
the
video-size-once
branch
from
October 17, 2026 18:16
7221d95 to
d64fe70
Compare
aaltat
marked this pull request as ready for review
October 17, 2026 18:16
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
Follow-up to #5326; the tests from #5358 guard this change.
The video size of a context was worked out twice:
_record_videoresolvesrecordVideo["size"](size given, else viewport, else 1280x720), and then every route worked it out again for the context cache, each in its own way. Now the resolved size is the one that is cached._embed_videoreads the cache, and it returns before reading it when there is novideo_path; Node sendsvideo_path: nullfor a context that does not record.{video_path, contextUuid}) isContextVideoindata_types.py, next to the other internal TypedDicts;_video_sizeand_record_videotakeRecordVideoandViewportDimensionsinstead ofMapping[str, Any].Evidence
new_context(viewport=...)without a video caches 800x600 for a context that never embeds a video.After:
test_context_without_video_caches_no_video_size(written red first): no cache entry for New Context, New Persistent Context or an adopted context without a video.utest/test_get_video_size.pypasses{}instead ofNone(the narrower signature); its approved output is unchanged.inv utest: 857 passed.inv atestsuites Video, Persistent State, Tracing Groups,05 JS Tests: all passed.Merge Danger
Door: two-way
Blast Radius: small
register_adopted_contextnow readsoptions["recordVideo"]["size"], whichadopted_context_optionsalways fills (its docstring saysoptionscome from there). Options built by hand with arecordVideowithoutsizeget aKeyErrorinstead of a 1280x720 fallback. The Electron library passes the options ofadopted_context_optionsunchanged.🤖 Generated with Claude Code