Repository navigation
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: this branch fixes the visible missing-button symptom, but it resolves bare provider/index callbacks against the current model list and is weaker than the open, proof-positive canonical sibling with stale-list guards. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Close this duplicate branch and converge on one legacy-compatible index/fingerprint Telegram callback fix through #98694 if maintainers accept that callback format. So I’m closing this here and keeping the remaining discussion on #98694. Review detailsBest possible solution: Close this duplicate branch and converge on one legacy-compatible index/fingerprint Telegram callback fix through #98694 if maintainers accept that callback format. Do we have a high-confidence way to reproduce the issue? Yes, source-level. Current main and v2026.6.11 return Is this the best way to solve the issue? No. The index fallback direction is right, but this PR's bare provider/index callback is not the best fix because it lacks stale-list identity guards already present in the canonical sibling. Security review: Security review cleared: The diff is limited to Telegram callback parsing/rendering and tests, with no dependency, workflow, permission, secret, or package-resolution changes. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 8e95e56e2dac. |
Mantis Telegram Desktop ProofSummary: Mantis captured native Telegram Desktop before/after GIFs showing the /models picker for a long model name.
Motion-trimmed clips: |
|
Independent review note for current head I rechecked this PR against current The new Mantis Telegram Desktop proof is useful evidence that this branch makes the long-name button visible, but it does not change the best-fix ranking. This branch still encodes only For the competing fixes, #98694 is still the stronger canonical path: it keeps legacy name-based callback parsing for in-flight buttons, uses bounded index callback data, and adds count/fingerprint stale-list guards plus tests for same-count/different-list drift. I would close this duplicate or move any useful Mantis proof/context over to #98694, rather than landing this bare-index variant. |
|
🦞✅ Reason: structured ClawSweeper close marker: close-required (sha=5ff28b4659202acbff5d4b95f17c4364b597dfe6) Closed:
|




What Problem This Solves
Closes #98221.
Telegram's inline
callback_datafield has a hard 64-byte limit. The/modelspicker currently has two encodings:mdl_sel_{provider}/{model}— used when it fits.mdl_sel/{model}— used as a fallback.When both exceed 64 bytes (e.g. long Ollama namespaced names like
llama3.1:70b-instruct-q6_K-xlarge-accelerated-release-candidate),buildModelSelectionCallbackDatareturnsnullandbuildModelsKeyboardsilently drops the model from the picker. Users on providers with long IDs see an incomplete model list with no indication that models are missing.Why This Change Was Made
Adds a third fallback encoding:
mdl_idx_{provider}_{index}, whereindexis the model's position in the provider's alphabetically sorted model list. The resolver looks the index up in the sorted list to recover the original model ID.mdl_idx_<provider>_<N>is far under 64 bytes —mdl_idx_openrouter_999is 23 bytes — so this fallback covers virtually every real-world case where the compact form overflows.bot-handlers.runtime.tsalready sorts the provider's models alphabetically before paginating, andresolveModelSelectionnow performs the same sort on thebyProviderset, so the index in the callback lines up with the model the user clicked.User Impact
Users on providers with long model IDs (Ollama namespaced names, some OpenRouter aliases, Bedrock inference profile ARNs) will now see all models in the
/modelspicker instead of a silently truncated list. Selecting a previously-dropped model now works and sets the session override as expected.Evidence
extensions/telegram/src/model-buttons.test.ts:parseModelCallbackDataacceptsmdl_idx_openai_0andmdl_idx_anthropic_42, rejects malformed variants (mdl_idx_openai,mdl_idx_openai_-1,mdl_idx_openai_abc).buildModelSelectionCallbackDatareturnsmdl_idx_openai_5when standard and compact both overflow, and returnsnullonly when the index encoding also overflows.buildModelsKeyboardno longer drops long models — they get an index-based callback (mdl_idx_openrouter_2).resolveModelSelectionresolvesselect-indexcallbacks via sorted-list position and returns an ambiguous result for unknown provider or out-of-range index.extensions/telegram/src/bot-handlers.runtime.tsnow handlesselect-indexcallbacks alongsideselect.extensions/telegram/src/model-buttons.test.ts— 31 passed.oxlintclean on all three changed files.🤖 Generated with Claude Code