Skip to content

fix: restore deployable AI backend - #3

Open
interfluve-wav wants to merge 5 commits into
Ekaanth:mainfrom
interfluve-wav:cursor/fix-digitalocean-deployment
Open

fix: restore deployable AI backend#3
interfluve-wav wants to merge 5 commits into
Ekaanth:mainfrom
interfluve-wav:cursor/fix-digitalocean-deployment

Conversation

@interfluve-wav

@interfluve-wav interfluve-wav commented Jul 16, 2026

Copy link
Copy Markdown

⚠️ READ BEFORE SUBMITTING ⚠️

We are not currently accepting PRs except for critical bugs.

If this is a bug fix:

  • I've opened an issue first
  • This was approved by a maintainer

If this is a feature:

This PR will be closed. Please open an issue to discuss first.

Summary

  • restore the missing Pydantic API model package required for backend startup
  • fix the missing Field import in engagement routes
  • pin TTS torchaudio==2.5.1 to match torch==2.5.1 (fixes ABI crash)
  • disable TTS autoload and lower memory limit for 8GB hosts
  • replace web healthcheck curl with Node fetch (Alpine image has no curl)
  • add DigitalOcean cloud-init automation for the full Docker Compose stack

Test plan

  • Built and started the stack on an 8 GB DigitalOcean Droplet
  • Verified all service health endpoints return HTTP 200
  • Confirmed web + TTS containers report healthy

Made with Cursor


Session Details

  • Session: View Session
  • Requested by: Unknown
  • Address comments on this PR. Add (aside) to your comment to have me ignore it.

Hermes Agent and others added 3 commits July 16, 2026 18:10
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>
@interfluve-wav
interfluve-wav marked this pull request as ready for review July 17, 2026 05:28
Hermes Agent and others added 2 commits July 17, 2026 01:43
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 Ekaanth left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/models Pydantic package that routes/engagement.py imports (backend startup fix) and adds the missing Field import.
  • generateAICommitMessage now matches the real backend contract ({message} + NDJSON {token}/{done}), confirmed against routes/llm.py; the canonical ai-client.ts caller 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 fetch swap is valid (output: "standalone", node:20-alpine).
  • crypto.randomUUIDgenerateUUID() 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.

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.

2 participants