Discord: several radio streams per voice channel; adding never overwrites (#213) #227
No Reviewers
Labels
Clear labels
area/ai-pipeline
area/auth
area/billing
area/correlation
area/discord
area/frontend
area/governance
area/growth
area/infra-deploy
area/legal
area/map
area/mqtt
area/node-ota
area/osint
area/recording-audio
area/sdr-radio
area/transcription
board
board:agenda
minutes:draft
minutes:final
role:ceo
role:cfo
role:cio
role:ciso
role:cmo
role:coo
role:cto
Scene/entity extraction, summarizer, AI providers, embeddings
AuthN/Z, roles, tenancy/org scoping, API keys, credentials
Plans, entitlements, AI spend accounting and caps
Incident correlation, linking, lifecycle, severity, corr_debug
Discord bot, radio bots, voice streams, bot tokens, webhooks
Web UI: Next.js app and the edge-node local dashboard
Board process, minutes, unattended runner, agent tooling
Go-to-market, outreach, cold email, discovery conversations
CI/CD, VM, registry, Firestore rules/indexes deploy, Terraform/Caddy
ToS, retention, licences/DAAs, CAN-SPAM, E&O, name suppression
Live map: pins, paths, tiles, legend, geocoding
Node-C2 MQTT, checkins, commands, node sweeper, dynsec
Node install, enrollment, OTA updater, image skew
External feeds: cameras, 511, ADS-B, AIS, outages, and their licences
Call capture, boundaries, PulseAudio, ring buffer, trimming, attribution
OP25 decode, SDR hardware/tuning, conventional, second SDR, mesh radio
STT, transcript correction, place verification, name accuracy
Board process: minutes and board-filed items
Needs board scoping at the next sitting; CEO removes the label once scoped
One exec pre-read, closed by CEO
CEO ruling; open until enacted
Filed by the CEO
Filed by the CFO
Filed by the CIO
Filed by the CISO
Filed by the CMO
Filed by the COO
Filed by the CTO
kind
behavior-bug
Wrong product behavior; the instrument reads it correctly
kind
measurement-bug
Corrupts the recording/instrument (debug data, evals, health checks), not behavior
priority
p0
Drop everything: prod broken, live exposure, or owner-ruled P0
priority
p1
Next up: blocks a gate, a customer, or core incident quality
priority
p2
Normal: real defect or planned work, schedule in turn
priority
p3
Low: minor, cosmetic, or someday
status
blocked
Waiting on an external party, spend, or another issue
status
in-progress
Branch or PR open against it
status
needs-decision
Waiting on an owner or board ruling before work
status
needs-info
Root cause or repro unknown; needs a reading first
type
bug
Something built is wrong: code, data, or a measurement
type
chore
Maintenance, refactor, tests, pinning, cleanup: no user-visible change
type
decision
A ruling to make or record: board minutes, owner calls, legal reviews
type
docs
Docs, runbooks, CLAUDE.md, skills, SOPs
type
feature
New capability or an extension of an existing one
type
security
Security, privacy, credential or tenant-isolation exposure
type
tracking
Tracker, checklist, initiative or punch-list spanning several changes
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: logan/server-26#227
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Owner-reported on live: on /settings/discord (and node page, bot /join), adding a radio channel for a server + voice channel that already had one — different label, system, even preferred bot — overwrote the existing stream and made its bot leave. Root cause:
stream_id = guild:channel, one doc per voice channel,start_streamupserted.Owner decision: several radio streams may share one voice channel, each with its own bot, each playing its own system.
What changed
guild:channel:<12 hex>(leases.new_stream_id). Oldguild:channeldocs keep working (no migration) for read, stop, remove, node reports. Every route validator usesleases.STREAM_ID_PATTERN=^[0-9]{1,25}:[0-9]{1,25}(?::[0-9a-f]{8,32})?$.POST /discord/streamswithoutstream_idadds. Same system already on in that channel → returns it (already_on, label/mode untouched). Stopped stream of that system → restarted. Anything else → new doc. Withstream_id→ explicit restart/edit (admin Start button, reconciler), including moving to another bot.pick_tokenskips a token with a stream in the guild, read + write in one txn). Now covered by race tests.preferred_token_idis strict: bot in use in this server → 409preferred_busynaming the stream (busy_stream_id); bot on another node →preferred_other_node; unusable →preferred_unavailable.pool_exhaustedtext now says one-voice-channel-per-server and to add + invite another bot.discord_guild_max_streams(the guild half of #223; per-node cap still open there).POST /discord/guilds/{id}/stoptakesstream_id; admin table Stop/Start/Remove act on the row (one row per stream, "+N other streams in this voice channel", bot column, busy bots disabled in Add form); node picker shows every stream per channel and adds beside other systems; guild overview + join-options carrytoken_name./leavechoice:stream:(autocomplete of this server's streams) stops one;channel:with several streams lists them and asks unlessall:True; bare/leavestill stops the whole server (unchanged)./statusand/joinname each stream's bot;/joinwith an already-playing system says nothing was replaced.Edge node — no Client change
discord_radio.pykeys by opaquestream_id, onediscord.Clientper token, so two tokens in one guild+channel each have their ownguild.voice_client. Verified with a scratch test against Clientmain(5770eca) using per-client guild caches: old id1:11+ new id1:11:0123456789ab, tokens t1/t2 → both connected and playing, presence per bot, dropping one leaves the other playing. No stream_id format validation exists on the edge.Tests
684 passed(~/venvs/drb-5c/bin/python -m pytest -q), incl. newtests/test_discord_multi_stream.py(21): two streams same channel different bots; same preferred bot refused by name; preferred on another node; pool exhausted hint; same-system idempotent + duplicate-bot 409; stop by id leaves sibling; restart/edit by id; reconciler re-places each by id; lease races (two new streams one guild → two bots, last free bot, same preferred bot); concurrent adds dedup + cap (mutation-checked: removing the lock fails both); old-id stop/remove/node-page/report; node page and admin page flows.npx tsc --noEmitexit 0 (portable Node 20 on a copy of this branch).Merge order: standalone on main (
16a609e). No Client PR.🤖 Generated with Claude Code