Notify Telegram on Firstrade runtime errors#58
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d8f6a83a53
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| crisis_token = os.getenv("CRISIS_ALERT_TELEGRAM_BOT_TOKEN") | ||
| for chat_id in _split_env_list(os.getenv("CRISIS_ALERT_TELEGRAM_CHAT_IDS")): | ||
| if crisis_token and chat_id: | ||
| targets.append((crisis_token, chat_id)) |
There was a problem hiding this comment.
Respect disabled crisis Telegram channels
When a deployment leaves CRISIS_ALERT_TELEGRAM_* configured but sets CRISIS_ALERT_CHANNELS to exclude telegram (the documented/runtime channel list is the enablement control for crisis alerts), this branch still adds those chat IDs and sends every /run fatal-error alert to Telegram. Gate these crisis targets on the channel list including telegram so disabled or staged Telegram credentials do not receive runtime-error notifications.
Useful? React with 👍 / 👎.
Summary
/runexception fallback that logs the stack trace and attempts Telegram notification before returning 500Verification
/usr/bin/python3 -m py_compile main.py tests/test_request_handling.pygit diff --checkTargeted pytest could not be run on this VPS because the active Python environment does not have
pytestinstalled.