

























@@ -1,3 +1,4 @@
1+/** Row builders used by `openclaw models list` source orchestration. */
12import type { NormalizedModelCatalogRow } from "@openclaw/model-catalog-core/model-catalog-types";
23import { normalizeProviderId } from "@openclaw/model-catalog-core/provider-id";
34import { DEFAULT_CONTEXT_TOKENS } from "../../agents/defaults.js";
@@ -30,6 +31,7 @@ type RowFilter = {
3031local?: boolean;
3132};
323334+/** Context shared by every model-list row source builder. */
3335export type RowBuilderContext = {
3436cfg: OpenClawConfig;
3537agentDir: string;
@@ -186,6 +188,8 @@ async function appendVisibleRow(params: {
186188model: params.model,
187189context: params.context,
188190});
191+// Normalize provider-owned runtime model ids before suppression/filtering so
192+// list output matches the model ids users can actually select.
189193if (
190194!params.skipSuppression &&
191195shouldSuppressListModel({ model: normalizedModel, context: params.context })
@@ -294,6 +298,7 @@ function toFallbackConfiguredListModel(entry: ConfiguredEntry, cfg: OpenClawConf
294298);
295299}
296300301+/** Appends rows discovered from the loaded model registry. */
297302export async function appendDiscoveredRows(params: {
298303rows: ModelRow[];
299304models: Model[];
@@ -344,6 +349,7 @@ export async function appendDiscoveredRows(params: {
344349return seenKeys;
345350}
346351352+/** Appends models explicitly configured under models.providers. */
347353export async function appendConfiguredProviderRows(params: {
348354rows: ModelRow[];
349355context: RowBuilderContext;
@@ -374,6 +380,7 @@ export async function appendConfiguredProviderRows(params: {
374380}
375381}
376382383+/** Appends catalog models for providers that have configured auth. */
377384export async function appendAuthenticatedCatalogRows(params: {
378385rows: ModelRow[];
379386context: RowBuilderContext;
@@ -401,6 +408,7 @@ export async function appendAuthenticatedCatalogRows(params: {
401408}
402409}
403410411+/** Appends normalized model catalog rows into the shared row list. */
404412export async function appendModelCatalogRows(params: {
405413rows: ModelRow[];
406414context: RowBuilderContext;
@@ -426,6 +434,7 @@ export async function appendModelCatalogRows(params: {
426434return appended;
427435}
428436437+/** Appends manifest catalog rows through the generic catalog-row path. */
429438export function appendManifestCatalogRows(params: {
430439rows: ModelRow[];
431440context: RowBuilderContext;
@@ -438,6 +447,7 @@ export function appendManifestCatalogRows(params: {
438447});
439448}
440449450+/** Appends catalog rows that are resolvable by the registry but missing from registry output. */
441451export async function appendCatalogSupplementRows(params: {
442452rows: ModelRow[];
443453modelRegistry: ModelRegistry;
@@ -491,6 +501,7 @@ export async function appendCatalogSupplementRows(params: {
491501});
492502}
493503504+/** Appends model rows returned by provider catalog hooks. */
494505export async function appendProviderCatalogRows(params: {
495506rows: ModelRow[];
496507context: RowBuilderContext;
@@ -528,6 +539,7 @@ export async function appendProviderCatalogRows(params: {
528539return appended;
529540}
530541542+/** Appends rows from default/fallback/configured model references. */
531543export async function appendConfiguredRows(params: {
532544rows: ModelRow[];
533545entries: ConfiguredEntry[];
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。