diff --git a/extensions/telegram/src/bot-native-command-builtins.test.ts b/extensions/telegram/src/bot-native-command-builtins.test.ts index ff59db837da4..46d15845afdc 100644 --- a/extensions/telegram/src/bot-native-command-builtins.test.ts +++ b/extensions/telegram/src/bot-native-command-builtins.test.ts @@ -403,6 +403,42 @@ describe("Telegram native command built-ins", () => { expect(replyMocks.dispatchReplyWithBufferedBlockDispatcher).not.toHaveBeenCalled(); }); + it("uses the selected agent-model thinking default", async () => { + const cfg = { + agents: { + defaults: { + model: { primary: "anthropic/claude-opus-4-7" }, + models: { + "anthropic/claude-opus-4-7": { params: { thinking: "low" } }, + }, + }, + entries: { + main: { + models: { + "anthropic/claude-opus-4-7": { params: { thinking: "high" } }, + }, + }, + }, + }, + } as OpenClawConfig; + sessionMocks.sessionStoreEntries.mockReturnValue({}); + + const { handler, sendMessage } = registerAndResolveCommandHandler({ + commandName: "think", + cfg, + allowFrom: ["*"], + }); + await handler(createTelegramPrivateCommandContext()); + + expectSendMessageCall({ + sendMessage, + chatId: 100, + textIncludes: "Current thinking level: high.\nChoose level for /think.", + requireReplyMarkup: true, + label: "agent-model thinking menu", + }); + }); + it("uses per-agent thinking defaults before target model and global thinking defaults", async () => { const cfg = { agents: { diff --git a/extensions/telegram/src/bot-native-command-builtins.ts b/extensions/telegram/src/bot-native-command-builtins.ts index 4782f51219a5..dbf3b533cc58 100644 --- a/extensions/telegram/src/bot-native-command-builtins.ts +++ b/extensions/telegram/src/bot-native-command-builtins.ts @@ -220,6 +220,7 @@ async function resolveTelegramThinkMenuCurrentLevel(params: { provider: params.provider ?? defaultModel.provider, model: params.model ?? defaultModel.model, agentRuntime: params.agentRuntime, + agentId: params.agentId, loadRuntimeCatalog: async () => params.catalog, }); }