fix: restore deployable AI backend - #3
Conversation
Restore missing API models and add cloud-init automation so a fresh DigitalOcean host can start the full stack without manual patching. Co-authored-by: Cursor <cursoragent@cursor.com>
Pin torchaudio to match torch 2.5.1, stop TTS from autoloading on 8GB hosts, and use a Node-based web healthcheck since Alpine has no curl. Co-authored-by: Cursor <cursoragent@cursor.com>
- Gate Databuddy analytics behind NEXT_PUBLIC_DATABUDDY_CLIENT_ID (was hardcoded, causing 402 batch/errors requests) - Route AI commit messages through the AI backend only; drop direct browser calls to localhost:11434 Ollama - Fix chat/stream payload shape (message field) and parse NDJSON response, fixing 422 errors - Make Ollama health URL configurable via NEXT_PUBLIC_OLLAMA_URL - Replace remaining crypto.randomUUID() uses with generateUUID() fallback for insecure contexts Co-authored-by: Cursor <cursoragent@cursor.com>
Normal play was advancing at shuttleSpeed (0), so at t=0 every rAF hit newTime<=0 and stormed playback-seek events, restarting audio each frame. Also bake NEXT_PUBLIC_* URLs as Docker build args so VPS client bundles do not hardcode localhost service endpoints. Co-authored-by: Cursor <cursoragent@cursor.com>
- Transitions rendered blank/transparent source frames because TransitionNode never drew actual video/image content onto the offscreen canvases before compositing. Build a VideoNode/ImageNode per source and render into the offscreen context so transitions actually blend real content. - Sharpen shader's unsharp-mask math was wrong, making it a no-op. Replaced with a correct 4-neighbor unsharp mask. - Track-level audio effects (EQ, compressor, reverb, noise gate, de-esser, limiter) were defined and had a UI panel, but were never connected into the Web Audio graph and had no way to be opened from the editor. Added audioEffects to the track types, wired connectAudioEffectsChain into AudioManager's per-track node graph, fixed the reverb dry/wet routing, and exposed the effects chain panel from the timeline mixer via a per-track FX popover. Co-authored-by: Cursor <cursoragent@cursor.com>
Ekaanth
left a comment
There was a problem hiding this comment.
Reviewed the full diff (29 files, +849/−145) and ran a security scan for malicious patterns — no malicious code found.
Security scan (clean): no obfuscation (eval/Function/hex escapes/fromCharCode), no reverse shells or /dev/tcp, no SSH authorized_keys/cron tampering, and no malicious dependency injection. All network references are benign: local service URLs, the standard DigitalOcean metadata endpoint 169.254.169.254 (reads the public IPv4 only, no credentials), the official get.docker.com installer, and a clone of this repo. Databuddy analytics already existed on main and is now gated behind NEXT_PUBLIC_DATABUDDY_CLIENT_ID. The only dependency change is pinning torchaudio==2.5.1 to match torch==2.5.1.
Legitimate fixes verified against the codebase:
- Restores the missing
app/modelsPydantic package thatroutes/engagement.pyimports (backend startup fix) and adds the missingFieldimport. generateAICommitMessagenow matches the real backend contract ({message}+ NDJSON{token}/{done}), confirmed againstroutes/llm.py; the canonicalai-client.tscaller already used this shape, so no other call site breaks.- Reverb dry path fix (previously disconnected) with a unity fan-out node and
dry.gain = 1 - wetLevel. - Playback shuttle reset fixes a seek-storm/bootloop at t=0.
- Alpine healthcheck curl→
node -e fetchswap is valid (output: "standalone",node:20-alpine). crypto.randomUUID→generateUUID()helper for insecure-HTTP deploys.
Minor non-blocking note: the sed block in scripts/do-cloud-init.yaml targets the old quoted ENV NEXT_PUBLIC_*="http://localhost..." Dockerfile lines, which this same PR rewrites to $VAR form — so that sed now silently no-ops (dead code). Harmless since the compose build-args (patched by the Python block) inject the IP-based URLs, but worth cleaning up in a follow-up.
Approving.
We are not currently accepting PRs except for critical bugs.
If this is a bug fix:
If this is a feature:
This PR will be closed. Please open an issue to discuss first.
Summary
Fieldimport in engagement routestorchaudio==2.5.1to matchtorch==2.5.1(fixes ABI crash)Test plan
Made with Cursor
Session Details
(aside)to your comment to have me ignore it.