fix: prefix ibkr telegram notifications with account - #287
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 09026b6b4f
ℹ️ 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".
| webhook_url=_NOTIFICATION_WEBHOOK_URL, | ||
| ) | ||
| sender(message) | ||
| sender(_with_platform_notification_prefix(message)) |
There was a problem hiding this comment.
Record hashes for the prefixed notification text
When a normal cycle is run with notification_delivery_events, application/runtime_notification_adapters.py:38-46 records compact_text_sha256 and compact_text_length from the original message after calling send_message. Prefixing only inside send_tg_message means Telegram receives [acct] ..., but the report's delivery event still hashes and sizes the unprefixed text, so account-scoped dry-run delivery logs become unverifiable/inaccurate while claiming only hash and length are persisted. Apply the prefix before the adapter records the delivery metadata, or have the adapter record the actual text passed to the sink.
Useful? React with 👍 / 👎.
Co-Authored-By: Codex <noreply@openai.com>
09026b6 to
804d9dc
Compare
Summary\n- prefix IBKR Telegram cycle/error notifications with the active account selector when multi-account runtime targets are used\n- derive labels from U-account selectors first, then fallback from live-u account scope\n- keep default/single-account notifications unprefixed\n\n## Tests\n- python3 -m pytest tests/test_request_handling.py::test_platform_notification_prefix_stays_empty_for_default_account tests/test_request_handling.py::test_platform_notification_prefix_uses_ibkr_account_scope tests/test_request_handling.py::test_handle_request_runtime_error_fallback_prefixes_account_scope tests/test_request_handling.py::test_handle_request_runtime_error_fallback_sends_telegram tests/test_runtime_composer.py::test_runtime_composer_builds_runtime_and_config_from_local_builders -q\n- python3 -m ruff check main.py tests/test_request_handling.py\n- git diff --check