Skip to content

[codex] compact market regime Telegram alerts#169

Merged
Pigbibi merged 1 commit into
mainfrom
codex/compact-telegram-plugin-alerts
Jul 2, 2026
Merged

[codex] compact market regime Telegram alerts#169
Pigbibi merged 1 commit into
mainfrom
codex/compact-telegram-plugin-alerts

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Compact Telegram delivery for market-regime strategy plugin alerts to the same four-line operator format used by unified alerts.
  • Preserve detailed alert metadata and existing non-market-regime Telegram behavior.
  • Add regression coverage for the compact Telegram body.

Root cause

Market-regime alerts built through the shared QuantPlatformKit Telegram channel still sent the generic detailed strategy-plugin subject/body, while the unified market-regime workflow had a repo-local compact renderer.

Validation

  • python3 -m pytest tests/test_strategy_plugin_telegram_notifications.py::StrategyPluginTelegramNotificationTests::test_publish_strategy_plugin_telegram_alerts_compacts_market_regime_body -q
  • python3 -m pytest tests/test_strategy_plugin_telegram_notifications.py tests/test_strategy_plugin_alert_dispatcher.py -q
  • python3 -m pytest tests/test_strategy_plugins.py tests/test_strategy_plugin_telegram_notifications.py tests/test_strategy_plugin_alert_dispatcher.py tests/test_notification_redaction.py -q
  • python3 -m pytest -q
  • python3 -m ruff check .

Notes

  • python3 -m build was not run because the local Python environment does not have the build module installed.

Co-Authored-By: Codex <noreply@openai.com>
@Pigbibi Pigbibi merged commit b9a7df8 into main Jul 2, 2026
2 checks passed
@Pigbibi Pigbibi deleted the codex/compact-telegram-plugin-alerts branch July 2, 2026 20:01

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dbd8ff0407

ℹ️ 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".

"opportunity_watch": "抄底机会",
"panic_reversal": "抄底机会",
"taco_rebound": "抄底机会",
"risk_reduced": "机会被否决",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Map risk_reduced alerts to de-levering

For market_regime_control signals with canonical_route == "risk_reduced" and suggested_action == "delever", the existing localization and alert metadata describe a risk-reduced/de-lever state, but the new compact Telegram body renders the only market-state line as "opportunity vetoed"/"机会被否决". In that scenario operators get a misleading status for a de-lever alert; this route should be labeled as risk-reduced/de-levering in both locale maps.

Useful? React with 👍 / 👎.

message.body,
metadata.get("situation"),
metadata.get("recommendation"),
metadata.get("reason_summary"),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Derive the compact locale from displayed text

When an English/default alert falls back to a Chinese-only localized_messages.labels.reason_codes entry, reason_summary contains Chinese even though the compact body does not display that trigger text; including it here makes _message_uses_zh render the visible headings and route label in Chinese while the situation/recommendation remain English. This produces mixed-language Telegram alerts for otherwise English/default notifications, so the compact locale should come from the requested translator or fields that are actually rendered.

Useful? React with 👍 / 👎.

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.

1 participant