- On-air toggle uploads status.json to BunnyCDN + purges cache, website
polls it every 15s to show live ON AIR / OFF AIR badge
- Publish script downloads Castopod's copy of audio for CDN upload
(byte-exact match), removes broken slug fallback, syncs all episode
media to CDN after publishing
- Fix f-string syntax error in publish_episode.py (Python <3.12)
- Enable CORS on BunnyCDN pull zone for json files
- CDN URLs for website OG images, stem recorder bug fixes, LLM token
budget tweaks, session context in CLAUDE.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
New stem recording system captures 5 time-aligned WAV files (host, caller,
music, sfx, ads) during live shows. Standalone postprod.py processes stems
into broadcast-ready MP3 with gap removal, voice compression, music ducking,
and EBU R128 loudness normalization.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Music crossfade: smooth 3-second blend between tracks instead of hard stop/start
- Emotional detection: analyze host mood from recent messages so callers adapt tone
- AI caller summaries: generate call summaries with timestamps for show history
- Returning callers: persist regular callers across sessions with call history
- Session export: generate transcripts with speaker labels and chapter markers
- Caller screening: AI pre-screens phone callers to get name and topic while queued
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Callers now have strong food opinions (Sparky's green chile, Blake's
Lotaburger, etc.), nostalgic memories of how their town used to be,
and 60% chance of having a strong reaction to a previous caller that
they bring up early in the call by name.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Weather lookup via Open-Meteo API with 30-min cache, time/day
awareness (Mountain time), moon phase calculation, seasonal context
with local events, and probabilistic situational details: road
context, phone situation, background music, recent errands, TV tonight.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Named relationships (20M/20F): "my buddy Ray", "my wife Linda" — not generic
- Relationship status with detail: "married 15 years, second marriage"
- Vehicle they drive: rural southwest flavor (F-150s, Tacomas, old Broncos)
- What they were doing before calling: grounds call in a physical moment
- Specific memory/story to reference: flash floods, poker wins, desert nights
- Food/drink right now: Tecate on the porch, third cup of coffee
- Strong random opinions: speed limits, green chile, desert philosophy
- Contradictions/secrets: tough guy who cries at TV, reads physics at work
- Verbal fingerprints: 2 specific phrases per caller
- Emotional arcs: mood shifts during the call
- Show relationship: first-timer, regular, skeptic, reactive
- Late-night reasons: why they're awake
- Topic drift tendencies for some callers
- Regional speech patterns in prompt (over in, down the road, out here)
- Opening line variety based on personality
- Local town news enrichment via SearXNG
- Ad channel now configurable in settings UI
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 30% of callers now call about topics (prestige TV, science, poker,
astrophotography, physics, tech, US news) instead of personal problems
- 86 curated interests weighted toward shows like Severance, Breaking Bad,
The Wire, LOST, Westworld, etc. Removed reality TV/celebrity gossip
- 32-town knowledge base with real facts so callers don't invent landmarks
- Smart topic detection for news enrichment (keyword->search query mapping)
- Enrichment now summarizes articles naturally via LLM instead of quoting headlines
- Prompt rewrite for varied response lengths and no rehashing
- Extra weight for Animas and Lordsburg callers
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add dedicated ad playback system (no loop, own channel)
- Ad channel defaults to 11, saved/loaded with audio settings
- Separate play_ad/stop_ad methods and API endpoints
- Frontend stop button now calls /api/ads/stop instead of stopMusic
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Primary model gets 15s, then auto-falls back through gemini-flash,
gpt-4o-mini, llama-3.1-8b (10s each)
- Always returns a response — canned in-character line as last resort
- Reuse httpx client instead of creating new one per request
- Remove asyncio.timeout wrappers that were killing requests before
the LLM service could try fallbacks
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Instead of injecting research into every LLM call (which bloated prompts
and caused timeouts), do one quick SearXNG search when a caller is picked
up and add a relevant headline to their background. 3s timeout — if search
is slow, caller just doesn't reference news. Zero impact on live conversation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Research results were bloating the system prompt, making LLM calls
slower and hitting the 20s timeout. Callers don't need news awareness
to have good conversations.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use local SearXNG at localhost:8888 instead of Google News RSS
- No more 302 redirects or blocked requests — local is fast and reliable
- 5s timeout on all SearXNG requests
- Removed async locks (no contention needed for local service)
- Re-enabled research and headlines
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Google News RSS returns 302: add follow_redirects and User-Agent header
- Cache failed headline fetches for 5min so they don't retry every call
- Add 8s timeout on background research tasks
- Fix keyword extraction: skip short texts, require 2+ proper nouns (not names),
increase min word length to 6, add radio show filler to stop words
- Stops garbage searches like "Megan welcome" and "sounds thats youre"
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add 30s timeout to all frontend fetch calls (safeFetch)
- Add 20s asyncio.timeout around lock+LLM in chat, ai-respond, auto-respond
- Reduce OpenRouter timeout from 60s to 25s
- Reduce Inworld TTS timeout from 60s to 25s
- Return graceful fallback responses on timeout instead of hanging
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add ads playback system with backend endpoints and frontend UI
- Diversify AI callers: randomize voices per session, expand jobs/problems/interests/quirks/locations
- Update website tagline and descriptions to "biologically questionable organisms"
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Expanded meta description with keywords
- Canonical URL
- JSON-LD PodcastSeries structured data
- RSS alternate link for feed discovery
- robots.txt allowing all crawlers
- sitemap.xml
- llms.txt for LLM indexing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When off air, callers hear a message and get disconnected. When on
air, calls route normally. Toggle button added to frontend header
with pulsing red ON AIR indicator.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Warm rustic bar palette (dark wood browns, orange neon accent, cream
text) replacing the previous navy/pink theme. Added ?v=2 to all
cover art URLs to force new image.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fetches episodes from Castopod RSS feed, renders episode cards with
play buttons, and provides a sticky bottom audio player with progress
bar and seeking. Falls back to CORS proxy if direct fetch fails.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Static site for lukeattheroost.com with cover art, phone number,
subscribe buttons (Spotify, YouTube, Apple, RSS), and OG meta tags.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove gpt-4o-realtime (WebSocket-only) from OpenRouter models
- Increase OpenRouter timeout to 60s and max_tokens to 150
- Handle empty LLM responses
- Fix publish_episode.py for current Castopod API fields
- Add port conflict check and graceful shutdown to run.sh
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add streamSid tracking and per-caller send locks for SignalWire
- Improve TTS streaming with real-time pacing and detailed logging
- Block host audio to caller during TTS playback
- Randomize caller names between sessions from name pools
- Update page title and show phone number in UI
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace aggressive sentence-count limiting with ensure_complete_thought()
which only trims if the LLM was actually cut off mid-sentence
- Softer prompt guidance for natural brevity instead of rigid sentence count
- max_tokens at 100 as natural length cap
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- max_tokens back to 150 so LLM can finish thoughts
- New limit_sentences() keeps only first 2 complete sentences
- Never cuts mid-sentence — always ends at punctuation
- Applied to both chat and auto-respond paths
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Log chunk count and peak audio level on recording stop
- Add null check on _recorded_audio in callback
- Small delay after stopping piggybacked recording for callback to finish
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Reduce max_tokens from 100 to 75 for shorter output
- Add truncate_to_complete_sentence() to trim at last punctuation
- Applied to both chat and auto-respond paths
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Much stronger prompt language: "no more than 2 sentences EVER"
- Added "DO NOT ramble" instruction
- Reduced max_tokens back to 100 as hard limit
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Increase max_tokens from 100 to 150 to avoid mid-sentence truncation
- Tighten prompt to 1-2 short sentences with emphasis on completing them
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Mute host mic forwarding while TTS is streaming to prevent interleaving
both audio sources into the same playback buffer
- Replace nearest-neighbor downsampling with box-filter averaging on both
server (host mic) and browser (caller mic) for anti-aliased resampling
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
TTS audio was sent as a single huge WebSocket frame that overflowed the
browser's 3s ring buffer. Now streams in 60ms chunks at real-time rate.
Also increased browser ring buffer from 3s to 10s as safety net.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The auto-respond function played AI TTS to the local Loopback channel
but didn't send it over WebSocket to the live caller in the browser.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace per-callback async task spawning with persistent queue-based sender
- Buffer host mic to 60ms chunks (was 21ms) to reduce WebSocket frame rate
- Reduce server ring buffer prebuffer from 150ms to 80ms
- Reduce browser playback jitter buffer from 150ms to 100ms
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When a live caller is on air, the host stream already has an InputStream
open. Opening a second one for push-to-talk recording causes a conflict.
Now recording piggybacks on the host stream callback instead.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>