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

推荐订阅源

美团技术团队
Microsoft Azure Blog
Microsoft Azure Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog
Y
Y Combinator Blog
博客园_首页
有赞技术团队
有赞技术团队
博客园 - Franky
腾讯CDC
G
Google Developers Blog
Recent Announcements
Recent Announcements
博客园 - 【当耐特】
D
Docker
The GitHub Blog
The GitHub Blog
MyScale Blog
MyScale Blog
H
Help Net Security
Apple Machine Learning Research
Apple Machine Learning Research
A
About on SuperTechFans
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss
V
V2EX
U
Unit 42
aimingoo的专栏
aimingoo的专栏
WordPress大学
WordPress大学

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
docs: document model list comments · openclaw/openclaw@fe...
steipete · 2026-06-05 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -1,3 +1,4 @@

1+

/** Auth availability index for `openclaw models list` rows. */

12

import { normalizeProviderIdForAuth } from "@openclaw/model-catalog-core/provider-id";

23

import type { AuthProfileStore } from "../../agents/auth-profiles/types.js";

34

import type { AuthProfileCredential } from "../../agents/auth-profiles/types.js";

@@ -26,6 +27,7 @@ export type ModelListAuthIndex = {

2627

allowsProviderAuthAvailabilityFallback(provider: string): boolean;

2728

};

2829
30+

/** Inputs used to build the auth index without re-reading process-wide state. */

2931

export type CreateModelListAuthIndexParams = {

3032

cfg: OpenClawConfig;

3133

authStore: AuthProfileStore;

@@ -77,6 +79,7 @@ function listValidatedSyntheticAuthProviderRefs(params: {

7779

.flatMap((plugin) => plugin.syntheticAuthRefs ?? []);

7880

}

7981
82+

/** Builds a provider-auth lookup from profiles, env, config, and synthetic plugin refs. */

8083

export function createModelListAuthIndex(

8184

params: CreateModelListAuthIndexParams,

8285

): ModelListAuthIndex {

@@ -104,6 +107,8 @@ export function createModelListAuthIndex(

104107

if (credential.type !== "oauth" && credential.type !== "token") {

105108

return false;

106109

}

110+

// OpenAI OAuth/token profiles only authenticate provider rows when config

111+

// routes OpenAI through Codex runtime semantics.

107112

return openAIProviderUsesCodexRuntimeByDefault({

108113

provider: normalizedProvider,

109114

config: params.cfg,

@@ -160,6 +165,8 @@ export function createModelListAuthIndex(

160165

params.cfg.agents?.defaults?.model,

161166

)?.split("/", 1)[0];

162167

if (primaryModelProvider === "codex") {

168+

// A Codex primary model is a synthetic provider auth signal even when no

169+

// normal provider key exists in the profile store.

163170

addSyntheticProvider("codex");

164171

}

165172
Original file line numberDiff line numberDiff line change

@@ -1,3 +1,4 @@

1+

/** Builds provider auth summaries for model-list/status output. */

12

import { normalizeProviderIdForAuth } from "@openclaw/model-catalog-core/provider-id";

23

import {

34

normalizeLowercaseStringOrEmpty,

@@ -62,6 +63,7 @@ function resolveProfileSourceAgentDir(params: {

6263

: params.agentDir;

6364

}

6465
66+

/** Resolves the effective auth source and profile counts for a provider. */

6567

export function resolveProviderAuthOverview(params: {

6668

provider: string;

6769

cfg: OpenClawConfig;

@@ -150,6 +152,8 @@ export function resolveProviderAuthOverview(params: {

150152
151153

const effective: ProviderAuthOverview["effective"] = (() => {

152154

if (profiles.length > 0) {

155+

// Profiles win over env/config markers because runtime auth selection uses

156+

// the profile store before provider-wide fallback material.

153157

return {

154158

kind: "profiles",

155159

detail: shortenHomePath(

Original file line numberDiff line numberDiff line change

@@ -1,3 +1,4 @@

1+

/** Resolves configured model refs and tags for model-list rows. */

12

import {

23

buildModelAliasIndex,

34

resolveConfiguredModelRef,

@@ -15,6 +16,7 @@ import { DEFAULT_MODEL, DEFAULT_PROVIDER, modelKey } from "./shared.js";

1516
1617

const DISPLAY_MODEL_PARSE_OPTIONS = { allowPluginNormalization: false } as const;

1718
19+

/** Returns canonical configured model entries with default/fallback/image/configured tags. */

1820

export function resolveConfiguredEntries(

1921

cfg: OpenClawConfig,

2022

metadataSnapshot?: Pick<PluginMetadataSnapshot, "manifestRegistry">,

@@ -47,6 +49,8 @@ export function resolveConfiguredEntries(

4749

const key = modelKey(canonicalRef.provider, canonicalRef.model);

4850

const originalKey = modelKey(ref.provider, ref.model);

4951

if (originalKey !== key) {

52+

// Preserve aliases attached to pre-canonical provider keys so display rows

53+

// still show user-facing aliases after catalog provider canonicalization.

5054

const aliases = aliasesByKey.get(originalKey);

5155

if (aliases) {

5256

aliasesByKey.set(key, [...new Set([...(aliasesByKey.get(key) ?? []), ...aliases])]);

Original file line numberDiff line numberDiff line change

@@ -1,12 +1,16 @@

1+

// Shared error helpers for model-list availability fallback behavior.

2+

/** Error code used when model availability lookup is unavailable but auth heuristics can continue. */

13

export const MODEL_AVAILABILITY_UNAVAILABLE_CODE = "MODEL_AVAILABILITY_UNAVAILABLE";

24
5+

/** Formats an unknown error with stack detail when available. */

36

export function formatErrorWithStack(err: unknown): string {

47

if (err instanceof Error) {

58

return err.stack ?? `${err.name}: ${err.message}`;

69

}

710

return String(err);

811

}

912
13+

/** Returns true when model list should continue with auth heuristics. */

1014

export function shouldFallbackToAuthHeuristics(err: unknown): boolean {

1115

if (!(err instanceof Error)) {

1216

return false;

Original file line numberDiff line numberDiff line change

@@ -1,11 +1,15 @@

1+

/** Formatting helpers for model-list terminal tables. */

12

import { isRich as isRichTerminal, theme } from "../../../packages/terminal-core/src/theme.js";

23

export { maskApiKey } from "../../utils/mask-api-key.js";

34
5+

/** Enables rich formatting only for non-machine-readable output. */

46

export const isRich = (opts?: { json?: boolean; plain?: boolean }) =>

57

isRichTerminal() && !opts?.json && !opts?.plain;

68
9+

/** Pads a table cell to a fixed width. */

710

export const pad = (value: string, size: number) => value.padEnd(size);

811
12+

/** Applies terminal color based on a model-list tag. */

913

export const formatTag = (tag: string, rich: boolean) => {

1014

if (!rich) {

1115

return tag;

@@ -34,6 +38,7 @@ export const formatTag = (tag: string, rich: boolean) => {

3438

return theme.muted(tag);

3539

};

3640
41+

/** Truncates model-list cells with an ASCII ellipsis. */

3742

export const truncate = (value: string, max: number) => {

3843

if (value.length <= max) {

3944

return value;

Original file line numberDiff line numberDiff line change

@@ -1,3 +1,4 @@

1+

/** Implementation of `openclaw models list`. */

12

import { normalizeLowercaseStringOrEmpty } from "@openclaw/normalization-core/string-coerce";

23

import { parseModelRef } from "../../agents/model-selection.js";

34

import type { ModelRegistry } from "../../llm/model-registry.js";

@@ -42,6 +43,7 @@ function loadSourcePlanModule(): Promise<SourcePlanModule> {

4243

return sourcePlanModuleLoader.load();

4344

}

4445
46+

/** Lists configured, catalog, and runtime-discovered models as text, plain, or JSON. */

4547

export async function modelsListCommand(

4648

opts: {

4749

all?: boolean;

@@ -114,6 +116,8 @@ export async function modelsListCommand(

114116

const { entries } = resolveConfiguredEntries(cfg, metadataSnapshot);

115117

const configuredByKey = new Map(entries.map((entry) => [entry.key, entry]));

116118

const enableSourcePlanCascade = Boolean(opts.all) || Boolean(providerFilter);

119+

// Full/provider-filtered lists may need runtime, manifest, and registry rows.

120+

// Defer that planning so default configured-only output stays cheap.

117121

const sourcePlanModule = enableSourcePlanCascade ? await loadSourcePlanModule() : undefined;

118122

const sourcePlan = sourcePlanModule

119123

? await sourcePlanModule.planAllModelListSources({

@@ -193,6 +197,8 @@ export async function modelsListCommand(

193197

});

194198

if (initialAppend.requiresRegistryFallback) {

195199

const useScopedRegistryFallback = sourcePlan.kind === "provider-runtime-scoped";

200+

// Runtime-scoped providers can fail catalog availability while still being

201+

// useful for a provider-filtered list; retry through the registry fallback.

196202

try {

197203

await loadRegistryState(

198204

useScopedRegistryFallback

Original file line numberDiff line numberDiff line change

@@ -1,5 +1,7 @@

1+

/** Local URL classifier for model provider status/list output. */

12

import { normalizeLowercaseStringOrEmpty } from "@openclaw/normalization-core/string-coerce";

23
4+

/** Returns true for loopback, wildcard, and mDNS local base URLs. */

35

export const isLocalBaseUrl = (baseUrl: string) => {

46

try {

57

const url = new URL(baseUrl);

Original file line numberDiff line numberDiff line change

@@ -1,3 +1,4 @@

1+

/** Manifest-backed model catalog row loaders for `openclaw models list`. */

12

import { normalizeModelCatalogProviderId } from "@openclaw/model-catalog-core/model-catalog-refs";

23

import type { NormalizedModelCatalogRow } from "@openclaw/model-catalog-core/model-catalog-types";

34

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

@@ -145,6 +146,7 @@ function loadManifestCatalogRowsForList(params: {

145146

});

146147

}

147148
149+

/** Loads authoritative static manifest catalog rows for model-list output. */

148150

export function loadStaticManifestCatalogRowsForList(params: {

149151

cfg: OpenClawConfig;

150152

providerFilter?: string;

@@ -157,6 +159,7 @@ export function loadStaticManifestCatalogRowsForList(params: {

157159

});

158160

}

159161
162+

/** Loads supplemental non-runtime manifest catalog rows for fallback list sources. */

160163

export function loadSupplementalManifestCatalogRowsForList(params: {

161164

cfg: OpenClawConfig;

162165

providerFilter?: string;