Skip to content

feat(chat): /video in the web chat; unknown slash commands never reach the LLM - #306

Merged
ralyodio merged 1 commit into
masterfrom
web-chat-video
Nov 11, 2026
Merged

ralyodio merged 1 commit into
masterfrom
web-chat-video

Conversation

@ralyodio

Copy link
Copy Markdown
Collaborator

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 to POST /api/v1/videos. adult: true is sent exactly as /image sends it (attested account + 18+ switch on, key absent otherwise).
  • Progress card: stage, queue position, ETA, worker (when the network reports one), elapsed time. Polls 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 or error.retry: true (deploy restarts) keep polling; real failures, 404 expiries and policy refusals (422/403) show the server's message in the card.
  • Result: inline <video> player + download link; adult clips render blurred until clicked (download hidden until then).
  • Unknown commands: any line starting with / that no parser takes is answered locally: /help lists commands, bare /image etc. show usage, anything else shows "unknown command /x" + the list. Never sent to the LLM.
  • Help/docs: /video in the empty-state help, placeholder, /help, and a new [ chat commands ] section on /docs.
  • Shared grammar: parseVideoCommand moves into apps/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 to apps/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 test in apps/web/src/lib/chat: 61 pass, 1 fail. The failure is music.test.ts and it fails on master too. TUI: 55 pass. tsc --noEmit is clean in apps/web and apps/tui.

🤖 Generated with Claude Code

…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>
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

13 finding(s)

HIGH/CRITICAL: 1 | MEDIUM: 8 | LOW: 4

Severity Rule Location
HIGH js-ssrf-outbound-request apps/web/public/sw.js:24
MEDIUM js-unescaped-html-sink apps/web/src/app/blog/[slug]/page.tsx:53
MEDIUM js-unescaped-html-sink apps/web/src/app/layout.tsx:89
MEDIUM sh-remote-script-execution scripts/dev-setup.sh:25
MEDIUM sh-eval-expansion scripts/dev-setup.sh:35
MEDIUM sh-remote-script-execution scripts/install.sh:185
MEDIUM sh-remote-script-execution scripts/install.sh:210
MEDIUM sh-remote-script-execution scripts/install.sh:408
MEDIUM sh-remote-script-execution scripts/install.sh:450
LOW py-ssrf-outbound-request examples/business-strategist-agent/chat.py:37
LOW py-ssrf-outbound-request examples/business-strategist-agent/train.py:54
LOW secret-generic-credential node/crates/c0mpute-core/src/webhook.rs:1171
LOW py-path-traversal node/crates/c0mpute-core/tests/fixtures/fake-infernet-text:29

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit 0e4cfc2 into master Nov 11, 2026
12 checks passed
@ralyodio ralyodio mentioned this pull request Nov 11, 2026
ralyodio added a commit that referenced this pull request Nov 11, 2026
… in web chat; #307 Wan 2.2 5B on 24 GiB cards; #302 Windows desktop bundle) (#308)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant