Repository navigation
Conversation
Telegram inline button callback_data is capped at 64 bytes. Namespaced
Ollama tags (e.g. 'xentriom/gemma-4-12B-agentic-fable5-composer2.5-v2:latest')
plus the mdl_sel_ or mdl_sel/ prefix overflow that cap, so buildModelsKeyboard
silently dropped those rows and the user could never pick the model.
Add a third-tier callback encoding mdl_idx/{provider}/{i} that stores the
provider name plus the 1-indexed position in the locale-sorted model list.
The handler re-derives the same sort order ([...modelSet].toSorted(localeCompare))
to map the index back to a model, so the user's selection still lands on the
exact row they pressed.
Fixes openclaw#98221
|
Codex review: needs real behavior proof before merge. Reviewed July 1, 2026, 7:59 AM ET / 11:59 UTC. Summary PR surface: Source +70, Tests +49. Total +119 across 3 files. Reproducibility: yes. source-level. Current main returns null for over-limit standard and compact model callbacks, and the keyboard then skips that row while the header still counts the full provider model list. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Keep the length-safe fallback direction, but resolve it through one canonical ordered list plus a compact model-identity or stale-callback guard, then attach redacted real Telegram proof before merge. Do we have a high-confidence way to reproduce the issue? Yes, source-level. Current main returns null for over-limit standard and compact model callbacks, and the keyboard then skips that row while the header still counts the full provider model list. Is this the best way to solve the issue? No, not yet. The length-safe index fallback is the right direction, but the current implementation must use a shared ordering and model-identity or stale-callback guard before it is the best fix. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 94cb14b97ead. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +70, Tests +49. Total +119 across 3 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
What Problem This Solves
Telegram inline button
callback_datais capped at 64 bytes. Namespaced Ollama tags (e.g.xentriom/gemma-4-12B-agentic-fable5-composer2.5-v2:latest) plus themdl_sel_ormdl_sel/prefix overflow that cap, sobuildModelsKeyboardsilently dropped those rows from the /model picker. The user saw a model count that did not match the buttons, and could never select the long-named model.Fixes #98221
Why This Change Was Made
The existing fallback stack (standard → compact) handled real-world IDs from OpenRouter / Bedrock but still failed for Ollama tags with provider namespacing (e.g.
xentriom/...:latest). Dropping the button was the wrong default: every row in the picker should be selectable. A 1-indexed position in the locale-sorted model list fits in 64 bytes for any realistic provider name and total model count, and the handler can re-derive the same sort order ([...modelSet].toSorted(localeCompare)) to map the index back to the exact model the user pressed.User Impact
Ollama / OpenRouter models with long, namespaced tags now appear and are selectable in the Telegram
/modelpicker. Previously the count said "12 models" but only 11 buttons rendered, and the missing one was often the one the user wanted.Evidence
npx vitest run extensions/telegram/src/model-buttons.test.ts→ 29 tests pass (added 4 new cases formdl_idxparser + index fallback inbuildModelSelectionCallbackData/buildModelsKeyboard; updated the prior "skips models that would exceed callback_data limit" test which now asserts the index fallback instead).node scripts/run-oxlint.mjs extensions/telegram/src/{model-buttons.ts,bot-handlers.runtime.ts,model-buttons.test.ts}clean.node scripts/run-tsgo.mjs -p extensions/telegram/tsconfig.jsonshows no new errors (the two reported errors inbot-message-dispatch.tsare pre-existing onmainand unrelated to this change).