mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-25 03:45:46 -06:00
fix(telegram): preserve agent thinking scope
This commit is contained in:
@@ -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: {
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user