feat(media): video_understand — watch a video (video→text) (v0.140.0)#239
Merged
Conversation
New governed MCP tool: delegates to an Atlas multimodal LLM (chat endpoint, video_url content part) and returns a text answer about a video — Claude can't see video natively. Source is a Library id, working-folder file, or URL (inlined as base64). New backend media-understand.ts, route /api/agent/video/understand, capability video.understand (money-capped). Verified live. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Agents can now "see" a video — the inverse of everything we've built so far (which all generates). Claude can't watch video natively; the new
video_understandMCP tool delegates to an Atlas multimodal LLM and returns a text answer.videoaccepts the same three sources as the other media tools: a Library artifact id (e.g. onevideo_generatejust made), a working-folder file (written or terminal-uploaded), or an http(s) URL. Local files inlined as base64 (no hosting needed).promptoptional (default: a detailed description). Also handles stills viakind:"image".How
videoininput_modalities(qwen3.5, glm-5v, kimi-k2…). New backendsrc/edge/media-understand.tscalls the OpenAI-compatible/v1/chat/completionswith a{type:"video_url", video_url:{url}}content part (the shape verified to work;{type:"video"}is silently ignored by the models).terminal.understandVideoreuses the media-ref resolver (generalized tokind: 'image'|'video'), gatesvideo.understand(cost estimate → money-cap), auditsvideo.understood.POST /api/agent/video/understand; MCP tool exposed whenever Atlas is configured (VIDEO_UNDERSTANDenv, set at launch). Default modelqwen/qwen3.5-27b.Verified
typecheck,build,test:governance(68/68) pass.Atlas-only. Token-priced (video eats tokens) — the gate uses an estimate; real usage-cost captured when Atlas returns it. New route + MCP tool → server restart + session relaunch to take effect.
🤖 Generated with Claude Code