Unify Firstrade Telegram notifications#10
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 933d44f2dd
ℹ️ 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".
| if has_signal_display and _is_dashboard_signal_line(line): | ||
| continue |
There was a problem hiding this comment.
Preserve small-account warnings from dashboard text
When signal_display is non-empty, this branch removes every dashboard line classified as a signal line, including lines containing small account warning / 小账户提示. If a strategy emits the warning only in dashboard_text (and not as a | detail in signal_display), the warning is dropped entirely and never re-added by _format_signal_lines, so users can miss an important account-size warning.
Useful? React with 👍 / 👎.
Summary
Firstrade Telegram notifications were still receiving raw strategy translation keys in some paths, so messages could include
signal_blend_*codes, parameter strings, duplicated dashboard signal rows, and untranslated small-account warning text.This PR routes strategy evaluation through the platform translator, expands Firstrade's i18n keys to match the US-equity strategy notifications used by other platforms, and renders structured status/signal annotations into compact localized lines. Dashboard signal rows are suppressed when the dedicated signal block is present, so the account/holding dashboard stays readable while the small-account warning is preserved as a separate bullet.
Validation
.venv/bin/python -m pytest tests/test_rebalance_service.py -q.venv/bin/python -m pytest tests/test_request_handling.py -q.venv/bin/python -m py_compile application/rebalance_service.py notifications/telegram.py main.py.venv/bin/python -m pytest -q