Skip to content

[codex] Prevent Telegram market symbol auto-links#109

Merged
Pigbibi merged 1 commit into
mainfrom
codex/telegram-symbol-autolinks
Jun 24, 2026
Merged

[codex] Prevent Telegram market symbol auto-links#109
Pigbibi merged 1 commit into
mainfrom
codex/telegram-symbol-autolinks

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • stop Telegram from auto-linking market symbols such as SOXL.US and 00700.HK
  • keep real URLs unchanged
  • add focused Telegram payload coverage

Validation

  • python -m py_compile on touched files
  • python -m unittest discover -s tests -p 'test_strategy_plugin_telegram_notifications.py' -v
  • git diff --check

@Pigbibi
Pigbibi merged commit 293d187 into main Jun 24, 2026
1 check passed
@Pigbibi
Pigbibi deleted the codex/telegram-symbol-autolinks branch June 24, 2026 20:04

@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: a12706938d

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



DEFAULT_TELEGRAM_BOT_API_BASE_URL = "https://api.telegram.org"
_TELEGRAM_MARKET_SYMBOL_LINK_RE = re.compile(r"(?<![A-Za-z0-9_])([A-Z0-9]{1,12})\.([A-Z]{2,4})(?![A-Za-z0-9_])")

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 Preserve uppercase URL hosts before breaking symbols

When a notification contains an uppercase host/domain, this pattern still matches the domain token because it runs over the whole message and only excludes adjacent alphanumerics; for example https://EXAMPLE.COM/report is rewritten with U+2060 inside the host. That breaks preservation of real links even though the added test only covers lowercase URLs, so guard URL spans or otherwise avoid substituting domain matches before sending.

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