mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 08:17:40 +00:00
Telegram: fix model button review issues
- Add currentModel to callback handler for checkmark display - Add 64-byte callback_data limit protection (skip long model IDs) - Add tests for large model lists and callback_data limits
This commit is contained in:
committed by
Ayaan Zaidi
parent
16349b6e93
commit
202c554d09
@@ -474,9 +474,14 @@ export const registerTelegramHandlers = ({
|
||||
const totalPages = calculateTotalPages(models.length, pageSize);
|
||||
const safePage = Math.max(1, Math.min(page, totalPages));
|
||||
|
||||
// Get current model from config for checkmark display
|
||||
const modelCfg = cfg.agents?.defaults?.model;
|
||||
const currentModel = typeof modelCfg === "string" ? modelCfg : modelCfg?.primary;
|
||||
|
||||
const buttons = buildModelsKeyboard({
|
||||
provider,
|
||||
models,
|
||||
currentModel,
|
||||
currentPage: safePage,
|
||||
totalPages,
|
||||
pageSize,
|
||||
|
||||
Reference in New Issue
Block a user