Skip to content

approver: silence ⚠️ timeout for lobby rooms nobody joined#41

Merged
amiller merged 1 commit into
mainfrom
approver-silence-ghost-timeouts
May 26, 2026
Merged

approver: silence ⚠️ timeout for lobby rooms nobody joined#41
amiller merged 1 commit into
mainfrom
approver-silence-ghost-timeouts

Conversation

@amiller
Copy link
Copy Markdown
Collaborator

@amiller amiller commented May 20, 2026

Summary

  • The shared-code lobby flow (one signup code, many uses) gets opened by link-preview bots, accidental reloads, and aborted clicks. Each hits /join/api, which mints a fresh public room with challenged=[]. 2h later the cleanup sweeper closes those rooms with closed_reason="timeout" and the operator notify room sees a ⚠️ lobby failed for (no users joined) for every one of them — clusters of 3+ around each actual signup.
  • This PR suppresses the announcement for timeout closures with empty challenged, marks the room as seen so the announce loop doesn't re-evaluate it forever, and keeps firing for the actionable bucket (user joined, never completed the haiku).
  • No state-file format changes. Existing seen-records keep working. Safe to apply during low-traffic window — no service restart needed beyond the usual approver container restart.

Test plan

  • python3 tests/announce_unit.py — all four tests pass, including the new test_ghost_timeout_suppressed_but_real_timeout_announced which models open→timeout transition with one ghost room and one room where a user actually joined.
  • Existing tests (test_no_flood_on_historical_closed_rooms, test_open_room_still_announced, test_seen_persists_across_cycles_for_open_then_closed) still pass.
  • After deploy: confirm no ⚠️ lobby failed for (no users joined) messages appear in the operator notify room over a 24h window.
  • Confirm a deliberately-failed lobby (join + skip haiku for 2h) still fires ⚠️ lobby failed for @user:server (reason=timeout, code=…).

🤖 Generated with Claude Code

Every POST /join/api mints a fresh lobby room. In prod the same shared
signup code (`XsqpEfyP`, 20 uses) gets opened by link-preview bots in
Slack/Element/iMessage, accidental reloads, and aborted clicks — each
creates a room with `challenged=[]` that then expires 2h later. That
fires `⚠️ lobby failed for (no users joined)` once per ghost room, and
the operator notify room sees clusters of 3+ such messages around each
actual signup.

Suppress the announcement when `closed_reason == "timeout"` and
`challenged` is empty. Still mark the room as seen so the announce loop
doesn't re-evaluate it forever. Timeouts where a user actually joined
but didn't finish the haiku (the actionable bucket) still fire.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@amiller amiller merged commit 9f7c727 into main May 26, 2026
1 of 3 checks passed
@amiller amiller deleted the approver-silence-ghost-timeouts branch May 26, 2026 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant