openclaw - 💡(How to fix) Fix [Bug]: Telegram `/think` inline-button menu ignores per-session `/model` override, always resolved against `agents.defaults.model` [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#69955Fetched 2026-04-23 07:31:01
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
0
Timeline (top)
commented ×1

On [email protected], the Telegram /think inline-button menu is generated from agents.defaults.model instead of the current session's model, so the menu never reflects per-session /model overrides. The hardcoded argument description string ("off, minimal, low, medium, high, xhigh") is also displayed verbatim in the menu title regardless of which levels the provider actually supports, producing a visible mismatch between the title text and the offered buttons.

The Discord side of the same /think command was fixed in 2026.4.20 (changelog: "Discord/think: only show adaptive in /think autocomplete for provider/model pairs that actually support provider-managed adaptive thinking") because Discord's slash-command autocomplete resolver does pass provider/model. Telegram's inline-button path was not updated.

Root Cause

The Discord side of the same /think command was fixed in 2026.4.20 (changelog: "Discord/think: only show adaptive in /think autocomplete for provider/model pairs that actually support provider-managed adaptive thinking") because Discord's slash-command autocomplete resolver does pass provider/model. Telegram's inline-button path was not updated.

Fix Action

Fix / Workaround

  1. In dist/extensions/telegram/bot-Dm2NPcQu.js, resolve the current session's model (the same way resolveSessionModelRef(...) is used elsewhere) and pass it in. A reasonable source is the already-loaded session entry for baseSessionKey, or — since resolveCommandRuntimeContext already has threadSpec/route — the same ref used by the subsequent chat dispatch in the non-menu branch.

Workaround for users

These text-form commands are dispatched through the normal command handler which does resolve against the session model, so they work correctly on Opus 4.7 even though the buttons don't offer them.

Code Example

const menu = commandDefinition ? resolveCommandArgMenu({
    command: commandDefinition,
    args: commandArgs,
    cfg: runtimeCfg,
    // ⚠️ no provider, no model
}) : null;

---

function resolveCommandArgMenu(params) {
    const { command, args, cfg } = params;   // ⚠️ provider/model not destructured
    ...
    const choices = resolveCommandArgChoices({
        command, arg, cfg,
        // ⚠️ no provider, no model passed through
    });
    ...
}

---

const choices = resolveCommandArgChoices({
    command,
    arg,
    cfg,
    provider: context?.provider,   // ✓ from interaction context
    model: context?.model,         // ✓ from interaction context
});

---

function resolveCommandArgMenu(params) {
    const { command, args, cfg, provider, model } = params;
    ...
    const choices = resolveCommandArgChoices({
        command, arg, cfg, provider, model,
    });
    ...
}

---

/think xhigh
/think max
RAW_BUFFERClick to expand / collapse

Summary

On [email protected], the Telegram /think inline-button menu is generated from agents.defaults.model instead of the current session's model, so the menu never reflects per-session /model overrides. The hardcoded argument description string ("off, minimal, low, medium, high, xhigh") is also displayed verbatim in the menu title regardless of which levels the provider actually supports, producing a visible mismatch between the title text and the offered buttons.

The Discord side of the same /think command was fixed in 2026.4.20 (changelog: "Discord/think: only show adaptive in /think autocomplete for provider/model pairs that actually support provider-managed adaptive thinking") because Discord's slash-command autocomplete resolver does pass provider/model. Telegram's inline-button path was not updated.

Affected

  • Channel: telegram
  • Gateway: [email protected] (115f05d) (and earlier)
  • Command: /think (also /thinking, /t)
  • File: dist/extensions/telegram/bot-Dm2NPcQu.js (the call site)
  • File: dist/commands-registry-CUdwdf0_.js (the resolver design)

Steps to reproduce

  1. Configure Gateway with:
    • agents.defaults.model.primary: "minimax/MiniMax-M2.7"
    • A model like anthropic/claude-opus-4-7 available via /model switching
  2. In a Telegram chat: run /model opus47 (or /model anthropic/claude-opus-4-7).
  3. Wait for model switch to take effect (session_status now reports anthropic/claude-opus-4-7).
  4. Run /think (no argument) to open the inline-button menu.

Expected

Menu should offer the thinking levels supported by the current session model (claude-opus-4-7): off, minimal, low, medium, high, xhigh, adaptive, max.

Actual

Menu offers the thinking levels supported by agents.defaults.model (minimax/MiniMax-M2.7): off, minimal, low, medium, high, adaptive.

Additionally, the menu title text is "Choose off, minimal, low, medium, high, xhigh for /think." — it comes from the hardcoded arg.description string and mentions xhigh, while the buttons don't include xhigh at all and include adaptive instead. Users see contradictory info.

telegram /think buttons showing 6 options while title mentions xhigh

Root cause

1. Telegram caller doesn't pass provider/model

dist/extensions/telegram/bot-Dm2NPcQu.js around line 1128:

const menu = commandDefinition ? resolveCommandArgMenu({
    command: commandDefinition,
    args: commandArgs,
    cfg: runtimeCfg,
    // ⚠️ no provider, no model
}) : null;

2. resolveCommandArgMenu doesn't accept them either

dist/commands-registry-CUdwdf0_.js around line 126:

function resolveCommandArgMenu(params) {
    const { command, args, cfg } = params;   // ⚠️ provider/model not destructured
    ...
    const choices = resolveCommandArgChoices({
        command, arg, cfg,
        // ⚠️ no provider, no model passed through
    });
    ...
}

3. Fallback resolves from agents.defaults.model

resolveCommandArgChoices (same file) then falls back to resolveDefaultCommandContext(cfg), which reads agents.defaults.model via resolveConfiguredModelRef(...). So for every Telegram user, regardless of their per-session /model choice, listThinkingLevels(provider, model) is always evaluated against the default agent model.

Contrast: Discord path works

dist/extensions/discord/provider-CraktAkD.js builds the same menu but explicitly resolves the context and threads provider/model through:

const choices = resolveCommandArgChoices({
    command,
    arg,
    cfg,
    provider: context?.provider,   // ✓ from interaction context
    model: context?.model,         // ✓ from interaction context
});

Suggested fix

  1. Extend resolveCommandArgMenu to accept and forward provider/model:
function resolveCommandArgMenu(params) {
    const { command, args, cfg, provider, model } = params;
    ...
    const choices = resolveCommandArgChoices({
        command, arg, cfg, provider, model,
    });
    ...
}
  1. In dist/extensions/telegram/bot-Dm2NPcQu.js, resolve the current session's model (the same way resolveSessionModelRef(...) is used elsewhere) and pass it in. A reasonable source is the already-loaded session entry for baseSessionKey, or — since resolveCommandRuntimeContext already has threadSpec/route — the same ref used by the subsequent chat dispatch in the non-menu branch.

  2. Consider making the /think arg.description dynamic rather than a hardcoded "off, minimal, low, medium, high, xhigh" string in commands-registry.data-*.js:723, or at minimum omit it from the menu title when a dynamic choice list is available, so the title can't contradict the buttons.

Workaround for users

Users can bypass the button menu by typing the argument inline:

/think xhigh
/think max

These text-form commands are dispatched through the normal command handler which does resolve against the session model, so they work correctly on Opus 4.7 even though the buttons don't offer them.

Related

  • #67888 (Opus 4.7 adaptive-thinking detection — fixed in 2026.4.20)
  • Changelog 2026.4.20: "Discord/think: only show adaptive in /think autocomplete for provider/model pairs that actually support provider-managed adaptive thinking" — same class of fix, Discord only.
  • Changelog 2026.4.20: "Thinking: only expose max for models that explicitly support provider max reasoning, and remap stored max settings to the largest supported thinking mode when users switch to another model." — this remapping kicks in at execute time, but the button menu is still misleading at discovery time.

extent analysis

TL;DR

Update the resolveCommandArgMenu function to accept and forward provider and model parameters to fix the Telegram /think inline-button menu generation.

Guidance

  • Extend the resolveCommandArgMenu function to accept provider and model in its parameters.
  • In dist/extensions/telegram/bot-Dm2NPcQu.js, resolve the current session's model and pass it to resolveCommandArgMenu.
  • Consider making the /think argument description dynamic to avoid contradictions between the menu title and buttons.
  • As a temporary workaround, users can bypass the button menu by typing the argument inline, e.g., /think xhigh or /think max.

Example

function resolveCommandArgMenu(params) {
    const { command, args, cfg, provider, model } = params;
    // ...
    const choices = resolveCommandArgChoices({
        command, arg, cfg, provider, model,
    });
    // ...
}

Notes

The provided fix assumes that the provider and model can be resolved and passed to resolveCommandArgMenu. Additional changes might be necessary to handle cases where these values are not available.

Recommendation

Apply the suggested fix to update the resolveCommandArgMenu function and pass the current session's model to it, as this will ensure that the Telegram /think inline-button menu reflects the correct thinking levels for the user's chosen model.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING