fix(telegram): pass modelNames to buildModelsKeyboard in button-click callback

When navigating the /models picker via provider button click, the model
list showed raw model IDs (e.g. gemini-3.1-pro-preview) instead of
configured display names (e.g. Gemini 3.1 Pro (Bridge)).

Root cause: the button-click callback handler destructured modelData as
{ byProvider, providers } omitting modelNames, then called
buildModelsKeyboard() without it. buildModelsKeyboard falls back to the
raw model ID via modelNames?.get(...) ?? model when modelNames is absent.

The text-command path (/models <provider>) already passes modelNames
correctly through buildTelegramModelsListChannelData, confirming the fix.

Fix: destructure modelNames from modelData and forward it to
buildModelsKeyboard in the button-click callback handler.

Closes #70560
This commit is contained in:
Atlas Bot
2026-04-24 17:05:41 +09:00
committed by Peter Steinberger
parent ead8be96fd
commit d1386ada5a

View File

@@ -1562,7 +1562,7 @@ export const registerTelegramHandlers = ({
} catch (err) {
throw new TelegramRetryableCallbackError(err);
}
const { byProvider, providers } = modelData;
const { byProvider, providers, modelNames } = modelData;
const editMessageWithButtons = async (
text: string,
@@ -1646,6 +1646,7 @@ export const registerTelegramHandlers = ({
currentPage: safePage,
totalPages,
pageSize,
modelNames,
});
const text = formatModelsAvailableHeader({
provider,