Repository navigation
M4/M5: the video assistant - #5
Merged
Merged
Conversation
The assistant's foundations, copied from GAM's M6 (which came from Notes): per-user AI providers with encrypted keys, the SSRF guard, the retrying upstream call, usage events and list-price pricing (Claude table brought up to date), and a Settings page with the provider panel and spend. New over GAM: the clients are multi-turn and call tools. Each keeps its history in the provider's own wire format and only appends to it, so an Anthropic turn's content (thinking blocks included) is replayed exactly. Ollama is served over its OpenAI-compatible /v1 endpoint, tools and all. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016fiRJAt34ag62iPiuMkNhm
An assistant beside every page, collapsible as in Notes, that knows the whole VideoSpec: it drafts a video from a prompt and the GAM library, or makes any edit to the one open. - Tools: the Notes spec doc's 8.2 operations, addressed by id, over a working copy of the spec. Every edit is validated as it is made and the issues go back to the model; a valid spec is never broken, a draft with mistakes is repaired step by step. - A turn is a background job: prompt, starting draft, steps, reply and proposal live on its row, so it finishes with the page closed and waits for Apply. The caller's token stays in memory only; a restart ends a turn and says so. - The proposal applies into the editor's draft (or, from the project list, becomes a new project with source brief and author ai), with a warning when the project was saved in between. - A header marker shows a turn running or waiting anywhere in the app. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016fiRJAt34ag62iPiuMkNhm
davior
marked this pull request as ready for review
October 16, 2026 12:45
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.
M4 (AI drafting) and M5 (AI editing) from the plan of attack, built together as one assistant:
What you can do
Settings (gear icon in the header): add an AI provider (Anthropic, OpenAI, DeepSeek, Ollama or a custom endpoint), test it, and make it the active one. The page also shows what the assistant has spent, always labelled an estimate.
On the project list: describe a video, for example "A 3-minute video about the Colorado River water wars, using clips where people talk about it." The assistant:
Create this video turns the draft into a project marked as drafted from a prompt, with the conversation moved over to it.
On a project: ask for any change, for example "dissolve into the river scene", "find footage of people talking about water for this scene", or "change the music after chapter 2 to something calmer".
It keeps working with the page closed. Close the project, the tab or the browser, and the request still runs to the end on the server.
Panel details:
How
Part 1: providers, usage and Settings. Copied from GAM's M6, which came from Notes:
api_key_configured;UsageEventattributed to a project and a turn, with no foreign keys, so deleting a project keeps its spend.New over GAM: multi-turn conversations that call tools. Each keeps its history in the provider's own wire format and only ever appends to it, so an Anthropic turn's content, thinking blocks included, is replayed exactly as it came. Anthropic requests cache the reference and the project as system blocks, plus top-level automatic caching. Ollama goes through its OpenAI-compatible
/v1endpoint.The tool set (
app/assistant/tools.py): the Notes spec doc's §8.2 operations, addressed by id, never by list position (that doc's open decision 14).get_spec,search_assets,get_asset,estimate.add_segment,update_segment,move_segment,remove_segment(which reports anything still anchored to the removed segment).set_visual(a hit's spoken moment becomes the trim),add_placeholder, and add, update and remove for overlays.set_projectandreplace_specfor whole drafts.The system prompt (
app/assistant/prompt.py) has two parts:Background jobs (
app/assistant/worker.py), on the render queue's runner:AssistantTurnrow as they happen.API (
/api/assistant):Deleting a project deletes its conversations.
Migrations: two, for providers and usage, then for assistant sessions and turns. Both were checked upgrading, downgrading and upgrading again.
Tests
Backend:
pytest -qpasses, 609 tests. New ones cover:Frontend: format, lint,
npm test(119 tests) and build pass. New tests cover:End to end in a browser: the real backend and frontend, with stand-ins for GAM and for the model. The stand-in model is a scripted OpenAI-compatible server set up as an Ollama provider through Settings.
There are no Claude credentials in this environment, so no real model ran. The first run against your key is the real test of the prompt.
Deploy notes
claude-opus-5-5is the placeholder.🤖 Generated with Claude Code
https://claude.ai/code/session_016fiRJAt34ag62iPiuMkNhm