#22025: fix(telegram): accept colon provider ids in mdl_list callbacks
channel: telegram
size: XS
Cluster:
Session Management Enhancements
## Summary
- Fix Telegram `/models` callback parsing for provider ids containing `:` (example: `ollama:cloud`).
- Root cause: `mdl_list` regex rejected `:` so callback data like `mdl_list_ollama:cloud_1` fell through to non-callback handling.
- Change: widen `mdl_list` provider regex from `[a-z0-9_-]+` to `[a-z0-9_:-]+`.
- Add regression test for colon provider ids.
## Linked Issue
- Closes #21939
## Scope
- `src/telegram/model-buttons.ts`
- `src/telegram/model-buttons.test.ts`
## Verification
- `node $(ls -d node_modules/.pnpm/vitest@*/node_modules/vitest/vitest.mjs | head -n 1) run src/telegram/model-buttons.test.ts`
- Result: 29 tests passed.
- `node_modules/.pnpm/oxfmt@0.33.0/node_modules/oxfmt/bin/oxfmt --check src/telegram/model-buttons.ts src/telegram/model-buttons.test.ts`
- Result: formatting check passed.
- `node_modules/.pnpm/oxlint@1.48.0_oxlint-tsgolint@0.14.1/node_modules/oxlint/bin/oxlint src/telegram/model-buttons.ts src/telegram/model-buttons.test.ts`
- Result: lint check passed (0 warnings, 0 errors).
## Notes
- No behavior changes for `mdl_sel` parsing or button rendering.
- Callback format remains constrained to `mdl_list_<provider>_<numeric_page>`.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Fixes Telegram `/models` callback parsing to accept provider IDs containing colons (e.g. `ollama:cloud`). The regex pattern for `mdl_list` callbacks was broadened from `[a-z0-9_-]+` to `[a-z0-9_:-]+`, allowing colon as a valid character in provider names. Includes regression test coverage for the colon case.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The change is minimal, well-scoped, and properly tested. The regex modification is backward-compatible and doesn't introduce parsing ambiguity since the pattern remains anchored and the page delimiter is strictly numeric. The fix addresses a real bug that caused callbacks with colon-containing provider IDs to fail parsing.
- No files require special attention
<sub>Last reviewed commit: 304d8ef</sub>
<!-- greptile_other_comments_section -->
<sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#21992: fix(telegram): allow colon in provider name for model callback pars...
by lailoo · 2026-02-20
92.1%
#20136: Telegram: fix cross-provider model checkmark in /models keyboard
by powerdot · 2026-02-18
79.4%
#20204: fix(sessions): allow negative IDs and colon separators in session IDs
by zerone0x · 2026-02-18
75.3%
#14443: fix(telegram): skip General topic thread ID for all chat types (#14...
by lailoo · 2026-02-12
73.0%
#19213: Telegram: preserve DM topic thread in direct replies
by Kemalau · 2026-02-17
73.0%
#3496: fix(tui): handle /model status and /model list subcommands
by zerone0x · 2026-01-28
72.9%
#12936: fix(telegram): omit message_thread_id for private DM chats
by omair445 · 2026-02-09
72.7%
#21998: fix(models): prioritize exact model-id match over fuzzy scoring (#2...
by lailoo · 2026-02-20
72.7%
#8166: fix(telegram): lifecycle fixes for duplicate messages and auto-reco...
by cheenu1092-oss · 2026-02-03
72.5%
#3368: fix: sessions navigation, DM thread display, and DM thread delivery...
by Lukavyi · 2026-01-28
72.2%