

























@@ -1,5 +1,8 @@
11import { DEFAULT_MODEL, DEFAULT_PROVIDER } from "../agents/defaults.js";
2-import { resolveConfiguredModelRef } from "../agents/model-selection.js";
2+import {
3+buildConfiguredModelCatalog,
4+resolveConfiguredModelRef,
5+} from "../agents/model-selection.js";
36import type { SkillCommandSpec } from "../agents/skills.js";
47import { getChannelPlugin, getLoadedChannelPlugin } from "../channels/plugins/index.js";
58import type { OpenClawConfig } from "../config/types.js";
@@ -26,6 +29,7 @@ import type {
2629NativeCommandSpec,
2730ShouldHandleTextCommandsParams,
2831} from "./commands-registry.types.js";
32+import type { ThinkingCatalogEntry } from "./thinking.shared.js";
29333034export {
3135isCommandEnabled,
@@ -257,6 +261,7 @@ export function resolveCommandArgChoices(params: {
257261cfg?: OpenClawConfig;
258262provider?: string;
259263model?: string;
264+catalog?: ThinkingCatalogEntry[];
260265}): ResolvedCommandArgChoice[] {
261266const { command, arg, cfg } = params;
262267if (!arg.choices) {
@@ -271,6 +276,7 @@ export function resolveCommandArgChoices(params: {
271276 cfg,
272277provider: params.provider ?? defaults.provider,
273278model: params.model ?? defaults.model,
279+catalog: params.catalog ?? (cfg ? buildConfiguredModelCatalog({ cfg }) : undefined),
274280 command,
275281 arg,
276282};
@@ -287,19 +293,29 @@ export function resolveCommandArgMenu(params: {
287293cfg?: OpenClawConfig;
288294provider?: string;
289295model?: string;
296+catalog?: ThinkingCatalogEntry[];
290297}): { arg: CommandArgDefinition; choices: ResolvedCommandArgChoice[]; title?: string } | null {
291-const { command, args, cfg, provider, model } = params;
298+const { command, args, cfg, provider, model, catalog } = params;
292299if (!command.args || !command.argsMenu) {
293300return null;
294301}
295302if (command.argsParsing === "none") {
296303return null;
297304}
305+const resolvedCatalog = catalog ?? (cfg ? buildConfiguredModelCatalog({ cfg }) : undefined);
298306const argSpec = command.argsMenu;
299307const argName =
300308argSpec === "auto"
301309 ? command.args.find(
302-(arg) => resolveCommandArgChoices({ command, arg, cfg, provider, model }).length > 0,
310+(arg) =>
311+resolveCommandArgChoices({
312+ command,
313+ arg,
314+ cfg,
315+ provider,
316+ model,
317+catalog: resolvedCatalog,
318+}).length > 0,
303319)?.name
304320 : argSpec.arg;
305321if (!argName) {
@@ -315,7 +331,14 @@ export function resolveCommandArgMenu(params: {
315331if (!arg) {
316332return null;
317333}
318-const choices = resolveCommandArgChoices({ command, arg, cfg, provider, model });
334+const choices = resolveCommandArgChoices({
335+ command,
336+ arg,
337+ cfg,
338+ provider,
339+ model,
340+catalog: resolvedCatalog,
341+});
319342if (choices.length === 0) {
320343return null;
321344}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。