fix: clarify telegram model picker scope

This commit is contained in:
Peter Steinberger
2026-05-02 08:40:11 +01:00
parent bd511be53d
commit 09d193c592
5 changed files with 14 additions and 3 deletions

View File

@@ -31,6 +31,7 @@ Docs: https://docs.openclaw.ai
- Providers/OpenAI: resolve `keychain:<service>:<account>` `OPENAI_API_KEY` refs before creating OpenAI Realtime browser sessions or voice bridges, with a bounded cached Keychain lookup. Fixes #72120. Thanks @ctbritt.
- Discord/gateway: reconnect when the gateway socket closes while waiting for the shared IDENTIFY concurrency window, instead of silently skipping IDENTIFY and leaving the bot online but unresponsive. Fixes #74617. Thanks @zeeskdr-ai.
- Telegram/startup: use the existing `getMe` request guard for the gateway bot probe instead of a fixed 2.5-second budget, and honor higher `timeoutSeconds` configs for slow Telegram API paths. Fixes #75783. Thanks @tankotan.
- Telegram/models: make model picker confirmations say selections are session-scoped and do not change the agent's persistent default. Fixes #75965. Thanks @sd1114820.
- Control UI/slash commands: keep fallback command metadata on a browser-safe registry path, so provider thinking runtime imports cannot blank the Web UI with `process is not defined`. Fixes #75987. Thanks @novkien.
- Infer/media: report missing image-understanding and audio-transcription provider configuration for `image describe`, `image describe-many`, and `audio transcribe` instead of blaming the input path when no provider is available. Fixes #73569 and supersedes #73593, #74288, and #74495. Thanks @bittoby, @tmimmanuel, @Linux2010, and @vyctorbrzezowski.
- Docs/health: clarify that session listing surfaces stored conversation rows rather than Discord/channel socket liveness, and point connectivity checks at channel status and health probes. Fixes #70420. Thanks @ashersoutherncities-art and @martingarramon.

View File

@@ -167,6 +167,7 @@ You can switch models for the current session without restarting:
<Accordion title="Picker behavior">
- `/model` (and `/model list`) is a compact, numbered picker (model family + available providers).
- On Discord, `/model` and `/models` open an interactive picker with provider and model dropdowns plus a Submit step.
- On Telegram, `/models` picker selections are session-scoped; they do not change the agent's persistent default in `openclaw.json`.
- `/models add` is deprecated and now returns a deprecation message instead of registering models from chat.
- `/model <#>` selects from that picker.

View File

@@ -1745,8 +1745,11 @@ export const registerTelegramHandlers = ({
const actionText = isDefaultSelection
? "reset to default"
: `changed to <b>${escapeHtml(selection.provider)}/${escapeHtml(selection.model)}</b>`;
const scopeText = isDefaultSelection
? "Session selection cleared. New replies use the agent's configured default."
: "Session-only selection. The agent default in openclaw.json is unchanged; /reset or a new session may return to that default.";
await editMessageWithButtons(
`✅ Model ${actionText}\n\nThis model will be used for your next message.`,
`✅ Model ${actionText}\n\n${scopeText}`,
[], // Empty buttons = remove inline keyboard
{ parse_mode: "HTML" },
);

View File

@@ -3739,7 +3739,7 @@ describe("createTelegramBot", () => {
expect(editMessageTextSpy).toHaveBeenCalledTimes(1);
expect(String(editMessageTextSpy.mock.calls.at(-1)?.[2] ?? "")).toContain(
"This model will be used for your next message.",
"Session-only selection. The agent default in openclaw.json is unchanged",
);
expect(
editMessageTextSpy.mock.calls.some((call) =>

View File

@@ -1061,6 +1061,9 @@ describe("createTelegramBot", () => {
expect(editMessageTextSpy.mock.calls[0]?.[2]).toContain(
`${CHECK_MARK_EMOJI} Model reset to default`,
);
expect(editMessageTextSpy.mock.calls[0]?.[2]).toContain(
"Session selection cleared. New replies use the agent's configured default.",
);
const entry = Object.values(loadSessionStore(storePath, { skipCache: true }))[0];
expect(entry?.providerOverride).toBeUndefined();
@@ -1205,6 +1208,9 @@ describe("createTelegramBot", () => {
expect(editMessageTextSpy.mock.calls[0]?.[2]).toContain(
`${CHECK_MARK_EMOJI} Model reset to default`,
);
expect(editMessageTextSpy.mock.calls[0]?.[2]).toContain(
"Session selection cleared. New replies use the agent's configured default.",
);
const entry = Object.values(loadSessionStore(storePath, { skipCache: true }))[0];
expect(entry?.providerOverride).toBeUndefined();
@@ -1275,7 +1281,7 @@ describe("createTelegramBot", () => {
expect(editMessageTextSpy).toHaveBeenCalledWith(
1234,
17,
`${CHECK_MARK_EMOJI} Model changed to <b>openai/gpt-5.4</b>\n\nThis model will be used for your next message.`,
`${CHECK_MARK_EMOJI} Model changed to <b>openai/gpt-5.4</b>\n\nSession-only selection. The agent default in openclaw.json is unchanged; /reset or a new session may return to that default.`,
expect.objectContaining({ parse_mode: "HTML" }),
);