Repository navigation
Videos: the bot picks sound and frame, /draw /video /gif for everyone, admin-only ! shortcuts - #315
Merged
Merged
Conversation
…sults rendered again The dialog model answered every video request with make_video, even !кино. The scheduler now decides: a VIP gets a video with sound unless the message asks for a GIF or no sound, everyone else gets a silent clip (no vip_only refusal). Both video tools take orientation (portrait for vertical, 9:16, phone, Stories, Reels, TikTok or Shorts) and quality (high: 4 steps). The MiniMax-H3 optimizer gets the requested frame in the user message, returns its own orientation when the dialog gave none, and composes for it; draw-api receives orientation and steps for videos with sound only. /draw, /video and /gif join /song for everyone and in the command menus; /movie is gone. The ! shortcuts work only for configured admins: their turn skips the debounce and the enqueue limit, and their generation runs in the VIP queue at ADMIN_COMMAND_PRIORITY. A command without a subject gets a two-minute usage hint, and the bot deletes the command where it may. Help and VIP lists mention the new commands and videos with sound. A draw-api status poll may take 90 s: a finished MP4 is several MB of base64 over a link that drops to 180 KB/s. Discovery deletes a job once read, so a 404 after a failed read means the result was lost, and the video pipeline renders it once more.
Owner
Author
|
Danger warnings:
PR-Agent failed on HTTP 429 from the model endpoint before publishing anything; re-dispatched as run 47148061462. |
Telegram keeps a bot upload as sent in private chats and groups and adds transcoded qualities only in big channels; comparing the uploaded and stored sizes shows that in production.
Every message in a forum topic replies to the topic's first message; that reply is not the command's subject.
Owner
Author
|
PR-Agent failed four times on HTTP 429 from the GLM Coding Plan endpoint (runs 47147854623 attempts 1–2, 47150699890 attempts 1–2) and published nothing. The owner approved merging without it. Instead I reviewed the full diff myself; it found one bug, fixed in a7d3027: in a forum topic every message replies to the topic's first message, so an empty |
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.
The bot, not the dialog model, now decides between a video with sound and a GIF; videos with sound take their frame from the request; generation commands get slash forms for everyone; and a video whose result was lost in transfer is rendered again.
Why
After #314 the dialog model (Gemma 4 26B) answered every video request in production with
make_video, even!кино(taskman jobs 5984899, 5984941 and 5984974 went to FastFrames as silent clips). Job 5984899 also failed outright: FastFrames rendered the clip in 22 s, but the status poll that carried the MP4 (about 3.5 MB of base64) ran past its 30 s timeout. The Tailscale link from the farm to the bot host measured 180 KB/s to 1 MB/s with a 282 ms RTT. Discovery deletes a finished job once it has been read, so the next poll got404 job not found.Changes
Video routing.
make_videoandmake_movieshare one argument list and one scheduler. A VIP user gets a video with sound unless the message asks for a GIF or a clip without sound (gif,гифка,без звука,беззвучный,silent,/gif). Every other user gets a silent clip for any video request; thevip_onlyrefusal is gone. Tool descriptions, the dialog system prompt andget_user_statusentitlements say the same.Frame and quality. Both video tools take
orientation(portraitfor a vertical, 9:16 or phone video, or for Stories, Reels, TikTok and Shorts, including earlier in the conversation; landscape otherwise) andquality(high→ 4 steps). The job meta storesorientation; the MiniMax-H3 optimizer gets the requested frame as aFrame:line in the user message, returns anorientationfield, and composes for it. When the dialog gave no frame, the optimizer's answer is used. draw-api receivesorientation: "portrait"andstepsonly for videos with sound; FastFrames renders 832×480 only, so silent clips stay landscape. 576p is not exposed: the farm measured 96 s render and 117 s HTTP for 4 steps at 576p (cold) against 46 s at 480p.Lost results. One draw-api status poll may take 90 s (was 30 s), body included. A
404after a failed status read becomesdraw-api result lost, and the video pipeline submits the render once more (video-<id>-retry).Commands.
/draw,/videoand/gifjoin/songfor everyone (in groups with the bot's name) and in the Telegram command menus;/movieis removed. The!shortcuts (!рис,!draw,!песня,!song,!видео,!video,!кино,!movie,!гиф,!gif) work only for configured admins; their dialog turn skips the 5 s debounce and the enqueue limit, and the generation they ask for runs in the VIP queue atADMIN_COMMAND_PRIORITY, above every other job. A command without a subject (no text, no reply, no media) does not start a turn: the bot replies with a usage hint that disappears after 2 minutes and deletes the command message where it may.Help.
/starthelp, the VIP benefit lists and the VIP upsell mention/draw,/video,/gifand videos with sound.Prompt changes
prompts/video/movie_optimizer.promptandprompts/aifarm/system.promptkeep their{{role}}markers. The optimizer template data gains one optional field,frame, rendered in the user message, so the optimizer's system part stays identical for every request. The dialog system prompt changes one sentence, so its prefix cache is rebuilt once after deploy.Verification
cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warnings: clean.cargo test --workspace --no-fail-fast: all pass (one command-order test updated for the new menus).!shortcuts refused for non-admins; usage hint and delete plan for empty commands; reply or media as a subject; lost-result re-render and no re-render for an unknown job; optimizer frame line and schema.