fix(telegram): clarify model picker runtime scope

This commit is contained in:
Vincent Koc
2026-05-04 15:14:20 -07:00
parent e091d912ce
commit 57ca91ff38
3 changed files with 6 additions and 6 deletions

View File

@@ -1764,8 +1764,8 @@ export const registerTelegramHandlers = ({
? "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.";
? "Session selection cleared. Runtime unchanged. New replies use the agent's configured default."
: `Session-only model selection. Runtime unchanged. Use /model ${escapeHtml(selection.provider)}/${escapeHtml(selection.model)} --runtime &lt;runtime&gt; to switch harnesses. The agent default in openclaw.json is unchanged; /reset or a new session may return to that default.`;
await editMessageWithButtons(
`✅ Model ${actionText}\n\n${scopeText}`,
[], // Empty buttons = remove inline keyboard

View File

@@ -3768,7 +3768,7 @@ describe("createTelegramBot", () => {
expect(editMessageTextSpy).toHaveBeenCalledTimes(1);
expect(String(editMessageTextSpy.mock.calls.at(-1)?.[2] ?? "")).toContain(
"Session-only selection. The agent default in openclaw.json is unchanged",
"Session-only model selection. Runtime unchanged.",
);
expect(
editMessageTextSpy.mock.calls.some((call) =>

View File

@@ -1062,7 +1062,7 @@ describe("createTelegramBot", () => {
`${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.",
"Session selection cleared. Runtime unchanged. New replies use the agent's configured default.",
);
const entry = Object.values(loadSessionStore(storePath, { skipCache: true }))[0];
@@ -1209,7 +1209,7 @@ describe("createTelegramBot", () => {
`${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.",
"Session selection cleared. Runtime unchanged. New replies use the agent's configured default.",
);
const entry = Object.values(loadSessionStore(storePath, { skipCache: true }))[0];
@@ -1281,7 +1281,7 @@ describe("createTelegramBot", () => {
expect(editMessageTextSpy).toHaveBeenCalledWith(
1234,
17,
`${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.`,
`${CHECK_MARK_EMOJI} Model changed to <b>openai/gpt-5.4</b>\n\nSession-only model selection. Runtime unchanged. Use /model openai/gpt-5.4 --runtime &lt;runtime&gt; to switch harnesses. The agent default in openclaw.json is unchanged; /reset or a new session may return to that default.`,
expect.objectContaining({ parse_mode: "HTML" }),
);