Repository navigation
Attach screen recordings as sampled, labelled video frames - #1629
Conversation
Solenta-Message-Id: 80ff2bc5-ae7e-4581-a118-33057219090b
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ee715c9d5f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ? await save.image(dataUrl) | ||
| : await save.file(file.name, dataUrl); |
There was a problem hiding this comment.
Sample oversized web videos before uploading them
For web/remote users, the original recording is fully read as base64 and sent through save.file before frame sampling begins. Files over the host's 20 MiB limit are guaranteed to be rejected, and a roughly 75 MiB recording exceeds the WebSocket server's default 100 MiB message limit after base64 expansion; that disconnect rejects this await, so the object-URL sampling below is never reached. Detect videos first and sample them before, or independently from, the capped original-file upload.
Useful? React with 👍 / 👎.
| const note = | ||
| a.kind === "image" && a.name && a.name !== path.basename(a.path) | ||
| ? ` (${a.name.replace(/[\r\n\]]+/g, " ")})` |
There was a problem hiding this comment.
Keep frame labels when routing images natively
These labels never reach two native-image paths: electron/runner.js lines 2119–2137 excludes all images from promptAttachments for Codex vision models and excludes all files/images for OpenCode. Codex then receives only the random stored path as a localImage, while OpenCode receives that path through -f, so neither agent can associate a frame with its clip or timestamp. Add the frame-label mapping to the prompt independently of the attachment path filtering, or preserve the metadata through the native route.
Useful? React with 👍 / 👎.
What
You can now attach a screen recording (
.mp4,.m4v,.mov,.webm) to a thread, and the agent gets still frames from it (#266). The clip stays an ordinary file chip. The renderer then samples frames with Chromium's own<video>decoder and adds each one as an image attachment, labelled with the clip name and time (repro.mov @ 0:03). The runner already routes image attachments to each provider, so the frames reach the agent without any per-provider changes.Frame sampling:
src/coder/videoFrames.ts(new)Infinity), it takes only the first frame.Desktop picks and drops
useCoderWorkspacepasses picked and dropped attachments throughwithVideoFrames, which puts each video's frames right after its chip. The folder-only picker (includeImages: false) is unchanged.<video>loads the file throughsolenta-media://local/using a newlocalVideoResponse:Access-Control-Allow-Origin: *, so drawing frames to a canvas doesn't taint it.attachments.jsaddsresolveVideoFile, which shares its checks withresolveImageFilethrough a newresolveLocalFile. Video has no size cap because it is streamed. Extension lookup now usesObject.hasOwn.index.htmlgetsmedia-src 'self' blob: solenta-media:.Web uploads
filesToAttachmentssamples frames from a blob URL. It does this even when the clip itself was too big to upload, since the frames are what the agent actually looks at.Prompt labelling
attachmentPromptSectionadds the display name when it differs from the file's basename:- Image: /u/1-ab.jpg (repro.mov @ 0:03). Newlines and]are removed from the name so it can't break out of the bracketed section.Tests
test/videoFrames.test.ts: video extension matching, frame timing (spacing, the cap of 8, unknown durations), andm:ssformatting. jsdom can't decode video, so actual frame decoding isn't unit-tested.electron/test/media-protocol.test.js: a range request for a video returns 206 with the right content type and the CORS header. Image, artifact and missing-file URLs returnnull.electron/test/attachments.test.js: frame labels appear in the dispatch prompt section.🤖 Generated with Claude Code