velxio/backend
David Montero Crespo fddfcfd2a6 fix(cors): allow Tauri desktop origins so v0.4.0 agent fetches don't fail
User report after the v0.4.0 desktop agent landed:
> agente devuelve "LLM call failed: Failed to fetch"

"Failed to fetch" is a network-layer error, not 401. Root cause: the
OSS CORS allow_origins list only included http://localhost:517[3-5]
(vite dev) and settings.FRONTEND_URL. The desktop bundle runs from
either tauri://localhost (macOS/Linux) or http://tauri.localhost
(Windows) - both cross-origin to velxio.dev - so the browser
blocked the agent's POST /api/pro/agent/llm preflight before the
backend ever saw it.

Added all three Tauri scheme variants to the allow list. After this
lands + a backend restart the desktop agent's fetch reaches the
real /api/pro/agent/llm and the dual-auth dep from v0.4.0 Phase 1
gets to do its job (Bearer license-key → resolved User → quota
check → upstream LLM proxy).

Origins added:
  tauri://localhost          # macOS / Linux (Tauri 2.x default)
  http://tauri.localhost     # Windows (Tauri 2.x default)
  https://tauri.localhost    # older Tauri 2.x releases

allow_credentials stays True - the existing cookies-from-web flow
still works, the Tauri origins just don't have any cookies to send.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 22:35:51 -03:00
..
app fix(cors): allow Tauri desktop origins so v0.4.0 agent fetches don't fail 2026-05-26 22:35:51 -03:00
scripts
sdk feat(chips): programmable retro CPU chips with external ROM 2026-05-18 23:38:18 -03:00
tests feat(compile): ESP-IDF compile options + request dedup 2026-05-18 21:50:45 -03:00
.env.example chore(oss): drop dead auth/DB dependencies from OSS image 2026-05-14 17:06:27 -03:00
Dockerfile fix(arduino-cli): pin ATTinyCore to 1.4.1 (azduino.com micronucleus host unreachable) 2026-05-22 15:15:53 +02:00
debug_qemu.py
mcp_server.py
mcp_sse_server.py
requirements.txt feat(sim): boot_images module + Pi 3 emulation restored 2026-05-16 05:41:46 +02:00