Skip to content

fix(gateway): preserve case-sensitive chat IDs in DeliveryTarget.parse - #11893

Closed
nightq wants to merge 1 commit into
NousResearch:mainfrom
nightq:fix/issue-11768-delivery-target-parsing
Closed

fix(gateway): preserve case-sensitive chat IDs in DeliveryTarget.parse#11893
nightq wants to merge 1 commit into
NousResearch:mainfrom
nightq:fix/issue-11768-delivery-target-parsing

Conversation

@nightq

@nightq nightq commented Apr 18, 2026

Copy link
Copy Markdown

Summary

Fixes issue #11768 where DeliveryTarget.parse() was lowercasing the entire target string, corrupting case-sensitive chat IDs like Slack C123ABC.

Root Cause

The original code used target.strip().lower() on the entire target string before splitting. This caused:

  1. Slack channel IDs like C123ABC to become c123abc (Slack IDs are case-sensitive)
  2. Any mixed-case chat ID to lose its original case

Fix

  • Only lowercase the platform prefix for case-insensitive matching
  • Preserve the original case for chat_id and thread_id values
  • Platform names remain case-insensitive (e.g., TELEGRAM, Telegram, telegram all work)

Test Plan

  • Added regression tests for case-sensitive chat ID parsing
  • Verified Slack uppercase IDs are preserved
  • Verified mixed-case chat IDs survive roundtrip
  • Verified platform names remain case-insensitive
  • All existing tests pass

Closes #11768

Fixes NousResearch#11768

Root cause: target.strip().lower() was lowercasing the entire target string,
corrupting case-sensitive chat IDs like Slack C123ABC and Matrix !RoomABC.

Fix: Only lowercase the platform prefix for case-insensitive matching;
preserve the original case for chat_id and thread_id values.
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery platform/slack Slack app adapter labels Apr 24, 2026
@kshitijk4poor

Copy link
Copy Markdown
Collaborator

Merged via PR #18553. Your commit was cherry-picked onto current main with your authorship preserved (rebase merge). Thanks for the contribution! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/slack Slack app adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(gateway): DeliveryTarget.parse corrupts explicit chat IDs and Matrix room targets

3 participants