feat: /model inline keyboard buttons#70
Conversation
When /model is used without arguments, shows clickable buttons for each available model (Opus 4.7, Opus 4.6, Sonnet 4.6, Haiku 4.5). Clicking a button immediately switches the model. Falls back to text list if inline keyboard fails. 393 tests green.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 096ba1d810
ℹ️ 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".
| // Try to send with inline keyboard via telegramFetch | ||
| const adapter = thread?.adapter; | ||
| if (adapter?.telegramFetch) { | ||
| const chatId = thread?.platformThreadId?.split(":")?.[0] ?? thread?.id?.split(":")?.[0]; |
There was a problem hiding this comment.
Parse Telegram thread ID from the numeric segment
The inline-keyboard path derives chat_id with split(":")[0], but Telegram threads are encoded as telegram:<chatId> (see src/transports/telegram/telegram-adapter.ts:88-90, which reads index 1). In Telegram chats this makes chat_id become "telegram", so sendMessage fails and the new button UI always falls back to plain text instead of rendering clickable model buttons.
Useful? React with 👍 / 👎.
| export const MODEL_ALIASES: Record<string, { provider: string; model: string; label: string }> = { | ||
| "opus": { provider: "amazon-bedrock", model: "us.anthropic.claude-opus-4-6", label: "Claude Opus 4.6" }, | ||
| "opus-4.6": { provider: "amazon-bedrock", model: "us.anthropic.claude-opus-4-6", label: "Claude Opus 4.6" }, | ||
| "opus-4.7": { provider: "amazon-bedrock", model: "us.anthropic.claude-opus-4-7", label: "Claude Opus 4.7" }, | ||
| "sonnet": { provider: "amazon-bedrock", model: "us.anthropic.claude-sonnet-4-6", label: "Claude Sonnet 4.6" }, | ||
| "sonnet-4.6": { provider: "amazon-bedrock", model: "us.anthropic.claude-sonnet-4-6", label: "Claude Sonnet 4.6" }, | ||
| "haiku": { provider: "amazon-bedrock", model: "us.anthropic.claude-haiku-4-5", label: "Claude Haiku 4.5" }, |
There was a problem hiding this comment.
Restore versioned model aliases to avoid invalid model writes
Dropping versioned aliases (for example sonnet-4.6, haiku-4.5, opus-4.6) regresses existing /model <alias> inputs: these now miss MODEL_ALIASES and fall into the raw-ID branch in applyModelSelection, which writes values like defaultModel = "sonnet-4.6" even though Bedrock expects full IDs (for example us.anthropic...). Users who previously used these aliases will silently persist invalid model IDs.
Useful? React with 👍 / 👎.
/modelnow shows clickable Telegram buttons:Clicking a button immediately switches the model. No typing needed.
Falls back to text list if inline keyboard unavailable.
393 tests green.