Skip to content

Harden Discord session thread reconnect#95

Merged
shiny-code-bot merged 1 commit into
mainfrom
harden/session-thread-reconnect
Jun 16, 2026
Merged

Harden Discord session thread reconnect#95
shiny-code-bot merged 1 commit into
mainfrom
harden/session-thread-reconnect

Conversation

@shiny-code-bot

Copy link
Copy Markdown
Collaborator

Summary

  • add session: <session_id> to new Discord session start markers so future reconnects have a stable identity beyond pid
  • preserve exact matching for legacy start markers without the session line
  • allow pid-relaxed reconnect only for new session-id-bearing markers, and only when exactly one candidate matches
  • add diagnostics for pid-relaxed reuse, ambiguity, and no-match cases

Validation

  • uv run python -m unittest tests.test_every_code -q
  • uv run ruff format --check discord_blue/doodads/every_code/bridge.py discord_blue/doodads/every_code/threads.py tests/test_every_code.py
  • uv run ruff check discord_blue/doodads/every_code/bridge.py discord_blue/doodads/every_code/threads.py tests/test_every_code.py
  • uv run mypy discord_blue/doodads/every_code/bridge.py discord_blue/doodads/every_code/threads.py tests/test_every_code.py
  • git diff --check

Review agents first flagged the wrong-thread risk in pid-relaxed matching; this version requires the persisted session id before relaxing pid and was re-reviewed as safe to merge.

@shiny-code-bot shiny-code-bot merged commit 884a81b into main Jun 16, 2026
6 checks passed
@shiny-code-bot shiny-code-bot deleted the harden/session-thread-reconnect branch June 16, 2026 02:03
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.

2 participants