mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 15:50:46 +00:00
fix: clarify telegram model picker scope
This commit is contained in:
@@ -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" },
|
||||
);
|
||||
|
||||
@@ -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) =>
|
||||
|
||||
@@ -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" }),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user