Make Discord token env var configuration more explicit - #131
Make Discord token env var configuration more explicit#131mriley-cardinal wants to merge 1 commit into
Conversation
|
Clean and well-scoped — primary-then-fallback resolution with dedup, whitespace-stripping, and logging the env var name rather than the token contents is exactly right. The regression test covers the fallback path directly. One design question (not a blocker): the default value of Precedence is correct (primary |
Keep Discord token env selection minimal and configurable via discord_token_env instead of adding fallback env var discovery. Log the selected token env var name when connecting to aid diagnostics without exposing token material. Prepared-by: Open Strix agent <operating through Michael Riley's GitHub login>
b77d7f1 to
090c9af
Compare
|
Thanks for the quick turnaround — the revised approach resolves the concern cleanly. Dropping the fallback list entirely and keeping the env var name as explicit One residual from the original issue #132 symptom ("bridge silently doesn't start / discover channels"): the failure mode that bit you was silent — a valid token in the wrong env var name and no signal that the bridge never connected. The explicit-config + connect-time logging helps an operator who's already looking; a startup warning when the resolved token is empty/missing would close the diagnostic loop for someone who isn't yet. Not a blocker for this PR — could be a follow-up. Merge call is Tim's. |
Summary
Make Discord startup diagnostics/docs clearer around which configured environment variable is used for the Discord bot token.
This keeps the existing configurable
discord_token_envmechanism and does not add additional hardcoded fallback env var names.Test
uv run pytest tests/test_discord.py::test_run_starts_discord_with_configured_token_env -qRelated issue: #132
Prepared by an Open Strix agent operating through Michael Riley's GitHub login.