From b0893a3699e807e29f127e5b004aec71d42969b7 Mon Sep 17 00:00:00 2001 From: marauder-actual Date: Fri, 29 May 2026 14:18:47 +0200 Subject: [PATCH] =?UTF-8?q?feat(transport):=20swap=20Anthropic=20=E2=86=92?= =?UTF-8?q?=20opencode;=20add=20persona=20switcher?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Part 1 — Transport swap: - Replace anthropic.AsyncAnthropic streaming with httpx SSE client calling opencode's OpenAI-compat /v1/chat/completions on sin:4096 - Auth: basic auth opencode:$OPENCODE_PASSWORD - Env: OPENCODE_URL (default http://sin:4096), OPENCODE_PASSWORD - Sidecar binding (sin:4098) consulted per message to resolve active persona; voice read from binding → cart → env default - Helper _session_id_for_user: deterministic sha256 slug per email so sidecar binding survives WebSocket reconnects - anthropic dep retained in pyproject.toml (not removed — P4 may use it) Part 2 — Persona switcher: - PERSONAS dict: bt7274, friday, samantha (slug → voice/backend/prompt) - POST /api/persona — bind persona via sidecar, maps slug → full config - GET /api/persona/current — return current binding - GET /api/personas — list available personas - chat.html: persona + + {% for p in personas %} + + {% endfor %} + + + {% if bound_display %}{{ bound_display }}{% endif %} + + + · + sign out Saiden