惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
雷峰网
雷峰网
J
Java Code Geeks
G
Google Developers Blog
博客园 - 司徒正美
The GitHub Blog
The GitHub Blog
L
LangChain Blog
人人都是产品经理
人人都是产品经理
GbyAI
GbyAI
Vercel News
Vercel News
S
SegmentFault 最新的问题
Engineering at Meta
Engineering at Meta
H
Hackread – Cybersecurity News, Data Breaches, AI and More
云风的 BLOG
云风的 BLOG
F
Fortinet All Blogs
Y
Y Combinator Blog
博客园_首页
Last Week in AI
Last Week in AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
罗磊的独立博客
A
About on SuperTechFans
B
Blog
Microsoft Security Blog
Microsoft Security Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
refactor: split models list row sources · openclaw/opencl...
shakkernerd · 2026-04-24 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -4,14 +4,8 @@ import type { RuntimeEnv } from "../../runtime.js";

44

import { normalizeLowercaseStringOrEmpty } from "../../shared/string-coerce.js";

55

import { resolveConfiguredEntries } from "./list.configured.js";

66

import { formatErrorWithStack } from "./list.errors.js";

7-

import {

8-

appendCatalogSupplementRows,

9-

appendConfiguredProviderRows,

10-

appendConfiguredRows,

11-

appendDiscoveredRows,

12-

appendProviderCatalogRows,

13-

loadListModelRegistry,

14-

} from "./list.rows.js";

7+

import { loadListModelRegistry } from "./list.registry-load.js";

8+

import { appendAllModelRowSources, appendConfiguredModelRowSources } from "./list.row-sources.js";

159

import { printModelTable } from "./list.table.js";

1610

import type { ModelRow } from "./list.types.js";

1711

import { loadModelsConfigWithSource } from "./load-config.js";

@@ -98,40 +92,20 @@ export async function modelsListCommand(

9892

};

9993
10094

if (opts.all) {

101-

const seenKeys = appendDiscoveredRows({

95+

await appendAllModelRowSources({

10296

rows,

103-

models: modelRegistry?.getAll() ?? [],

10497

context: rowContext,

98+

modelRegistry,

99+

useProviderCatalogFastPath,

105100

});

106-
107-

appendConfiguredProviderRows({

108-

rows,

109-

context: rowContext,

110-

seenKeys,

111-

});

112-
113-

if (modelRegistry) {

114-

await appendCatalogSupplementRows({

115-

rows,

116-

modelRegistry,

117-

context: rowContext,

118-

seenKeys,

119-

});

120-

} else if (useProviderCatalogFastPath) {

121-

await appendProviderCatalogRows({

122-

rows,

123-

context: rowContext,

124-

seenKeys,

125-

});

126-

}

127101

} else {

128102

const registry = modelRegistry;

129103

if (!registry) {

130104

runtime.error("Model registry unavailable.");

131105

process.exitCode = 1;

132106

return;

133107

}

134-

appendConfiguredRows({

108+

appendConfiguredModelRowSources({

135109

rows,

136110

entries,

137111

modelRegistry: registry,

Original file line numberDiff line numberDiff line change

@@ -0,0 +1,14 @@

1+

import type { OpenClawConfig } from "../../config/types.openclaw.js";

2+

import { loadModelRegistry } from "./list.registry.js";

3+

import { modelKey } from "./shared.js";

4+
5+

export async function loadListModelRegistry(

6+

cfg: OpenClawConfig,

7+

opts?: { providerFilter?: string },

8+

) {

9+

const loaded = await loadModelRegistry(cfg, opts);

10+

return {

11+

...loaded,

12+

discoveredKeys: new Set(loaded.models.map((model) => modelKey(model.provider, model.id))),

13+

};

14+

}

Original file line numberDiff line numberDiff line change

@@ -0,0 +1,58 @@

1+

import type { ModelRegistry } from "@mariozechner/pi-coding-agent";

2+

import {

3+

appendCatalogSupplementRows,

4+

appendConfiguredProviderRows,

5+

appendConfiguredRows,

6+

appendDiscoveredRows,

7+

appendProviderCatalogRows,

8+

type RowBuilderContext,

9+

} from "./list.rows.js";

10+

import type { ConfiguredEntry, ModelRow } from "./list.types.js";

11+
12+

type AllModelRowSources = {

13+

rows: ModelRow[];

14+

context: RowBuilderContext;

15+

modelRegistry?: ModelRegistry;

16+

useProviderCatalogFastPath: boolean;

17+

};

18+
19+

export async function appendAllModelRowSources(params: AllModelRowSources): Promise<void> {

20+

const seenKeys = appendDiscoveredRows({

21+

rows: params.rows,

22+

models: params.modelRegistry?.getAll() ?? [],

23+

context: params.context,

24+

});

25+
26+

appendConfiguredProviderRows({

27+

rows: params.rows,

28+

context: params.context,

29+

seenKeys,

30+

});

31+
32+

if (params.modelRegistry) {

33+

await appendCatalogSupplementRows({

34+

rows: params.rows,

35+

modelRegistry: params.modelRegistry,

36+

context: params.context,

37+

seenKeys,

38+

});

39+

return;

40+

}

41+
42+

if (params.useProviderCatalogFastPath) {

43+

await appendProviderCatalogRows({

44+

rows: params.rows,

45+

context: params.context,

46+

seenKeys,

47+

});

48+

}

49+

}

50+
51+

export function appendConfiguredModelRowSources(params: {

52+

rows: ModelRow[];

53+

entries: ConfiguredEntry[];

54+

modelRegistry: ModelRegistry;

55+

context: RowBuilderContext;

56+

}): void {

57+

appendConfiguredRows(params);

58+

}

Original file line numberDiff line numberDiff line change

@@ -7,7 +7,7 @@ import { normalizeProviderId } from "../../agents/provider-id.js";

77

import type { ModelDefinitionConfig, ModelProviderConfig } from "../../config/types.models.js";

88

import type { OpenClawConfig } from "../../config/types.openclaw.js";

99

import type { ListRowModel } from "./list.model-row.js";

10-

import { loadModelRegistry, toModelRow } from "./list.registry.js";

10+

import { toModelRow } from "./list.registry.js";

1111

import {

1212

loadModelCatalog,

1313

loadProviderCatalogModelsForList,

@@ -23,7 +23,7 @@ type RowFilter = {

2323

local?: boolean;

2424

};

2525
26-

type RowBuilderContext = {

26+

export type RowBuilderContext = {

2727

cfg: OpenClawConfig;

2828

agentDir: string;

2929

authStore: AuthProfileStore;

@@ -114,17 +114,6 @@ function shouldListConfiguredProviderModel(params: {

114114

);

115115

}

116116
117-

export async function loadListModelRegistry(

118-

cfg: OpenClawConfig,

119-

opts?: { providerFilter?: string },

120-

) {

121-

const loaded = await loadModelRegistry(cfg, opts);

122-

return {

123-

...loaded,

124-

discoveredKeys: new Set(loaded.models.map((model) => modelKey(model.provider, model.id))),

125-

};

126-

}

127-
128117

export function appendDiscoveredRows(params: {

129118

rows: ModelRow[];

130119

models: Model<Api>[];