Skip to content

fix(notify): prefer injected unified Telegram token over firstrade-telegram-token - #404

Merged
Pigbibi merged 1 commit into
mainfrom
fix/unified-telegram-token
Oct 9, 2026
Merged

Pigbibi merged 1 commit into
mainfrom
fix/unified-telegram-token

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Why

2026-10-09 decision: all quant notifications go through the unified bot QSL资产管家 (quant-sentinel-telegram-bot-token). NOTIFY-01 audit found Firstrade still read Secret Manager firstrade-telegram-token first in main._get_telegram_token() (runtime error alerts), with the injected TELEGRAM_TOKEN only as an exception fallback.

Change

  • New runtime_config_support.resolve_telegram_token() order:
    1. injected TELEGRAM_TOKEN (Cloud Run secret ref, synced from repo var TELEGRAM_TOKEN_SECRET_NAME=quant-sentinel-telegram-bot-token)
    2. Secret Manager TELEGRAM_TOKEN_SECRET_NAME, if set
    3. legacy firstrade-telegram-token — last fallback only
  • main._get_telegram_token() and PlatformRuntimeSettings.tg_token both use it (blank env values no longer short-circuit to an empty token).
  • Tests: tests/test_telegram_token_resolution.py.

No strategy / execution / env / IAM changes.

Test

  • pytest -q → 830 passed

@Pigbibi
Pigbibi merged commit 23a8fc2 into main Oct 9, 2026
1 check passed
@Pigbibi
Pigbibi deleted the fix/unified-telegram-token branch October 9, 2026 21:54
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