discord_radio: desired-state streams, logout on release, no mention controls (#25) #32
Merged
logan
merged 1 commits from 2026-10-04 18:22:30 -04:00
feat/discord-system into main
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
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
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/node-26#32
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.
Fixes node-26#25. Companion server PR: logan/server-26
feat/discord-system(server-26#203/#204). Merge both together. This edge ignores legacydiscord_join/discord_leavecommands, so on an old C2 it would not stream at all.What changed (
drb-edge-node)discord_radio.pyis rewritten asRadioManager. It reconciles C2's retainednodes/{id}/discord/desiredand publishesnodes/{id}/discord/actual={applied_seq, sessions, streams}after every change and every ~60s.client.close(), not just disconnected from voice. C2 frees the token only after this node reports it gone.@bot leave/joinmention handling. The intents areguilds+voice_statesonly.POST /api/discord/joinnow returns 409 with an explanation (it was a TypeError 500).POST /api/discord/leavepauses locally until C2 sends a new list. AddedGET /api/discord.not_in_guild).DISCORD_MQTT_LOSS_STOP_SECONDS(300), which is below C2's 600s lease grace.-f pulseonsettings.pulse_source, never Icecast. Nothing touchescall_recorder.py.Tests
pytest:299 passed, 9 skipped, 1 warning. That includes 12 new tests intests/test_discord_radio.py, run against a faked Discord client: reconcile, fan-out, logout on release, stale seq, watchdog recovery, not-in-guild/login-failure reporting, the MQTT-loss fail-safe, local pause, and no message-content intent.flake8 drb-edge-node/app --max-line-length=120: clean. The DEFERRED.md row about pre-existing flake8 failures indiscord_radio.pyis now stale.Not done
drb-audio-reviewhas NOT been run. It is required before merge fordiscord_radio.pychanges, and this agent could not spawn it. Please run it.🤖 Generated with Claude Code
- Rewritten as RadioManager reconciling C2's retained nodes/{id}/discord/desired (token ids) and publishing nodes/{id}/discord/actual {applied_seq, sessions, streams}. - One gateway session per leased token, one voice connection per (token, guild); a token no stream needs is logged OUT (client.close()), which is what lets C2 free it safely (item 1). - Watchdog is a separate reconcile loop; recovering a dead session can no longer cancel it (item 2). Presence kept across rejoins. - No message-content intent and no @bot leave/join mention controls (item 3). - Local dashboard: /api/discord/join returns 409 with an explanation instead of a TypeError 500; /api/discord/leave pauses locally; GET /api/discord shows state (item 4). Join/leave results are reported to C2 (item 5). - Token strings fetched over HTTPS from C2 (lease holder only), memory only. - MQTT-loss fail-safe: logs every bot out after DISCORD_MQTT_LOSS_STOP_SECONDS (300, below C2's 600s lease grace). - Legacy discord_join/discord_leave MQTT commands are ignored. - Audio path unchanged: FFmpeg -f pulse on settings.pulse_source per connection, never Icecast. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>