Repository navigation
feat(chat): /video in the web chat; unknown slash commands never reach the LLM - #306
Merged
Merged
Conversation
…h the LLM - /video <prompt> (also /clip, /vid, optional --model) posts to /api/v1/videos with adult set exactly as /image does, and shows a card with stage, place in line, ETA and worker, polled every 5 s. The job id is saved with the chat, so polling resumes after a reload; transient 5xx (deploys, `error.retry`) keep polling, a real failure or a policy refusal shows the server's message in the card. Done clips play inline with a download link; adult clips render blurred until clicked. - Any other line starting with "/" answers locally: /help lists the commands, a bare /image|/music|/album|/promo shows its usage, anything else shows "unknown command" plus the list. - The /video grammar moves into lib/chat/videos.ts (the TUI's verbatim copy now imports it, so the drift test covers it). - /docs gets a [ chat commands ] section; the status route marks transient errors with retry: true and passes a worker field through when present. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ThreatCrush Security Scan13 finding(s) HIGH/CRITICAL: 1 | MEDIUM: 8 | LOW: 4
Snippets are redacted; ThreatCrush never prints matched credential material. |
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.
c0mpute.com/chat had no
/video, so/video <prompt>went to the chat LLM as text.What changes
/video <prompt>(aliases/clip,/vid,--model wan2.1-t2v-1.3b|wan2.2-ti2v-5b) posts toPOST /api/v1/videos.adult: trueis sent exactly as/imagesends it (attested account + 18+ switch on, key absent otherwise).GET /api/v1/videos/<id>every 5 s; the job id is saved with the chat so polling resumes after a reload; non-JSON 5xx orerror.retry: true(deploy restarts) keep polling; real failures, 404 expiries and policy refusals (422/403) show the server's message in the card.<video>player + download link; adult clips render blurred until clicked (download hidden until then)./that no parser takes is answered locally:/helplists commands, bare/imageetc. show usage, anything else shows "unknown command /x" + the list. Never sent to the LLM./videoin the empty-state help, placeholder,/help, and a new[ chat commands ]section on /docs.parseVideoCommandmoves intoapps/web/src/lib/chat/videos.ts; the TUI's verbatim copy (apps/tui/src/web/videos.ts, guarded by the existing drift test) now provides it toapps/tui/src/commands.ts.Tests
apps/web/src/lib/chat/videos.test.ts: parser vectors (same as the TUI's), request body adult wiring, progress text, poll outcome (deploy 5xx retry vs. real failure).apps/web/src/lib/chat/commands.test.ts: routing in send() order, unknown-command handling, /help, adult mode gating and the chat's body wiring.bun testin apps/web/src/lib/chat: 61 pass, 1 fail. The failure ismusic.test.tsand it fails on master too. TUI: 55 pass.tsc --noEmitis clean in apps/web and apps/tui.🤖 Generated with Claude Code