fix(bot,webapp): /record start's refusals stay private, and a refused start no longer leaves the session live (#843) #867
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/843-record-start-followups"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #843.
1. Refusals stay private
record_startdeferred the interaction publicly, and a followup after a public defer inherits that visibility. So every "private" refusal could appear in the channel: session not found, the backend's 409s, nobody in voice, and D171's warning.ephemeral=True, thinking=True.interaction.channelinstead of a followup./record stop.2. A refused start no longer leaves the session live (D116)
On the Discord path, the bot used to flip the session to
in_progressbefore joining voice. If the join then failed, the session was stuck live with no recording.?dry_run=trueonPOST /api/bot/sessions/{id}/recording-started. It runs the same checks (D10, D123), with the same 409 body, but doesn't flip. The bot:connect();listen(), once capture has started.check_version_syncpasses.Tests
test_table_live67 passed. A dry run doesn't flip, still enforces D10, and the real call flips afterwards.docs/API.mdis updated.🤖 Generated with Claude Code
record_start deferred publicly, so the first followup after it — including SESSION_NOT_FOUND, the backend's 409s, a failed voice join, and D171's private "couldn't announce" warning — inherited that visibility regardless of its own ephemeral flag. The defer is now ephemeral, and the announcement itself is posted through the channel rather than the interaction followup, so it stays public; the command-success path now also answers the deferred interaction privately, or Discord would leave "thinking..." on screen. Separately, the bot used to flip a session to in_progress (D116) in the same backend call that checked D10/D123, before joining voice, so a voice join that then failed left the session live with nothing being recorded. POST /api/bot/sessions/{id}/recording-started gains an additive ?dry_run=true (no contract bump, BOT_CONTRACT_VERSION stays 2): the bot checks with a dry run before joining voice, and only flips the session after it has actually joined and started capture. A refusal on the second (real) call only warns, since capture cannot be undone by that point. Tests: - bot: full suite, 491 passed, 1 skipped. New coverage for the ephemeral defer, the announcement staying on the channel, the check-then-flip ordering, and a join failure never flipping the session. - backend: targeted webapp/backend/tests/test_table_live.py, 67 passed. New coverage for a dry run not flipping, still refusing D10, and the real call flipping normally afterwards. - check_version_sync.py passes; ruff check + format --check clean over webapp/backend, scripts, webapp/frontend/e2e. Closes #843 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>