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

推荐订阅源

人人都是产品经理
人人都是产品经理
Apple Machine Learning Research
Apple Machine Learning Research
云风的 BLOG
云风的 BLOG
罗磊的独立博客
博客园 - 三生石上(FineUI控件)
量子位
GbyAI
GbyAI
腾讯CDC
T
Tailwind CSS Blog
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
D
Docker
G
Google Developers Blog
aimingoo的专栏
aimingoo的专栏
The GitHub Blog
The GitHub Blog
Microsoft Security Blog
Microsoft Security Blog
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
N
Netflix TechBlog - Medium
Jina AI
Jina AI
IT之家
IT之家
Y
Y Combinator 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
docs: document models config serialization tests · opencl...
steipete · 2026-06-05 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

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

1+

// Verifies StepFun standard and Step Plan catalog pairing across regions.

12

import { mkdtempSync } from "node:fs";

23

import { tmpdir } from "node:os";

34

import { join } from "node:path";

@@ -37,6 +38,7 @@ function buildStepFunCatalog(params: {

3738

profileId?: string;

3839

env?: NodeJS.ProcessEnv;

3940

}): ModelProviderConfig | null {

41+

// Region can be explicit, profile-tagged, or env-inferred; catalog ids stay paired.

4042

if (!params.apiKey) {

4143

return null;

4244

}

@@ -75,6 +77,7 @@ function inferRegionFromBaseUrl(baseUrl: string | undefined): StepFunRegion | un

7577

}

7678
7779

function inferRegionFromProfileId(profileId: string | undefined): StepFunRegion | undefined {

80+

// Auth profile suffixes are the lightweight region signal for paired providers.

7881

if (!profileId) {

7982

return undefined;

8083

}

@@ -183,6 +186,7 @@ describe("StepFun provider catalog", () => {

183186

}),

184187

};

185188

const pairedStandard = buildStepFunCatalog({

189+

// Paired surfaces should converge on the same regional host family.

186190

surface: "standard",

187191

apiKey: "test-stepfun-key",

188192

explicitBaseUrl: resolveDefaultBaseUrl(

Original file line numberDiff line numberDiff line change

@@ -1,9 +1,11 @@

1+

// Verifies Vercel AI Gateway auth marker resolution from env and profiles.

12

import { beforeAll, describe, expect, it, vi } from "vitest";

23
34

let NON_ENV_SECRETREF_MARKER: typeof import("./model-auth-markers.js").NON_ENV_SECRETREF_MARKER;

45

let createProviderAuthResolver: typeof import("./models-config.providers.secrets.js").createProviderAuthResolver;

56
67

async function loadModules() {

8+

// This file needs the real auth resolver after other provider tests install mocks.

79

vi.doUnmock("../plugins/manifest-registry.js");

810

vi.doUnmock("../plugins/provider-runtime.js");

911

vi.doUnmock("../secrets/provider-env-vars.js");

@@ -47,6 +49,7 @@ describe("vercel-ai-gateway provider resolution", () => {

4749

});

4850
4951

const auth = resolveAuth("vercel-ai-gateway");

52+

// Persist the env marker, not the resolved plaintext profile key.

5053

expect(auth.apiKey).toBe("AI_GATEWAY_API_KEY");

5154

expect(auth.mode).toBe("api_key");

5255

expect(auth.source).toBe("profile");

Original file line numberDiff line numberDiff line change

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

1+

// Verifies generated models.json preserves source secret markers from runtime snapshots.

12

import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from "vitest";

23

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

34

import { createFixtureSuite } from "../test-utils/fixture-suite.js";

@@ -90,6 +91,7 @@ function createOpenAiApiKeySourceConfig(): OpenClawConfig {

9091

}

9192
9293

function createOpenAiApiKeyRuntimeConfig(): OpenClawConfig {

94+

// Runtime config simulates already-resolved secrets that must not be persisted.

9395

return {

9496

models: {

9597

providers: {

@@ -224,6 +226,7 @@ async function planGeneratedProviders(params: {

224226

config: OpenClawConfig;

225227

sourceConfigForSecrets: OpenClawConfig;

226228

}) {

229+

// Planner assertions avoid filesystem noise for marker-projection cases.

227230

const plan = await planOpenClawModelsJsonWithDeps(

228231

{

229232

cfg: params.config,

@@ -250,6 +253,7 @@ async function planGeneratedProviders(params: {

250253

function expectOpenAiHeaderMarkers(

251254

providers: Record<string, { headers?: Record<string, string> }>,

252255

) {

256+

// Env header refs keep their id; non-env refs collapse to the shared sentinel.

253257

expect(providers.openai?.headers?.Authorization).toBe(

254258

"secretref-env:OPENAI_HEADER_TOKEN", // pragma: allowlist secret

255259

);

Original file line numberDiff line numberDiff line change

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

1+

// Verifies models.json generation skips env-gated providers until auth exists.

12

import fs from "node:fs/promises";

23

import path from "node:path";

34

import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";

@@ -24,6 +25,7 @@ vi.mock("./auth-profiles/external-cli-sync.js", () => ({

2425
2526

vi.mock("./models-config.providers.js", async () => {

2627

function createImplicitProvider(baseUrl: string): ModelsProviderConfig {

28+

// Shared implicit-provider fixture keeps generated-provider expectations compact.

2729

return {

2830

baseUrl,

2931

api: "openai-completions",

@@ -106,6 +108,7 @@ type ParsedProviderConfig = {

106108

async function readGeneratedProviders(

107109

agentDir: string,

108110

): Promise<Record<string, ParsedProviderConfig>> {

111+

// Generated plugin catalogs are separate files but part of the effective provider set.

109112

const raw = await fs.readFile(path.join(agentDir, "models.json"), "utf8");

110113

const parsed = JSON.parse(raw) as { providers?: Record<string, ParsedProviderConfig> };

111114

const providers = { ...parsed.providers };

@@ -142,6 +145,7 @@ async function runEnvProviderCase(params: {

142145

providerKey: "minimax" | "synthetic";

143146

expectedApiKeyRef: string;

144147

}) {

148+

// Mutate one env var at a time so auth-gated provider generation stays isolated.

145149

const previousValue = process.env[params.envVar];

146150

process.env[params.envVar] = params.envValue;

147151

try {

Original file line numberDiff line numberDiff line change

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

1+

// Verifies GitHub Copilot profile token fallback and implicit provider planning.

12

import { describe, expect, it, vi } from "vitest";

23

import {

34

planOpenClawModelsJson,

@@ -251,6 +252,7 @@ describe("models-config", () => {

251252

function createCopilotImplicitResolver(

252253

provider: ProviderConfig,

253254

): ResolveImplicitProvidersForModelsJson {

255+

// Models planner receives implicit Copilot providers from the auth exchange layer.

254256

return async () => ({ "github-copilot": provider });

255257

}

256258

@@ -272,6 +274,7 @@ async function planCopilotWithImplicitProvider(params: { provider: ProviderConfi

272274

function expectCopilotProviderFromPlan(

273275

plan: Awaited<ReturnType<typeof planCopilotWithImplicitProvider>>,

274276

) {

277+

// Keep assertions on the emitted provider payload, not planner implementation details.

275278

expect(plan.action).toBe("write");

276279

const parsed =

277280

plan.action === "write"

Original file line numberDiff line numberDiff line change

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

1+

// Verifies models.json writes, plugin catalog writes, and ready-cache serialization.

12

import fs from "node:fs/promises";

23

import path from "node:path";

34

import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";

@@ -29,6 +30,7 @@ let clearCurrentPluginMetadataSnapshot: typeof import("../plugins/current-plugin

2930

let setCurrentPluginMetadataSnapshot: typeof import("../plugins/current-plugin-metadata-snapshot.js").setCurrentPluginMetadataSnapshot;

3031
3132

function createPluginMetadataSnapshot(workspaceDir: string): PluginMetadataSnapshot {

33+

// Minimal process snapshot used to prove when metadata may be reused.

3234

const policyHash = resolveInstalledPluginIndexPolicyHash({});

3335

return {

3436

policyHash,

@@ -72,6 +74,7 @@ function createPluginMetadataSnapshot(workspaceDir: string): PluginMetadataSnaps

7274

}

7375
7476

async function expectMissingPath(operation: Promise<unknown>) {

77+

// Filesystem deletion assertions should fail on the errno, not path text.

7578

let error: NodeJS.ErrnoException | undefined;

7679

try {

7780

await operation;

@@ -87,6 +90,7 @@ function planParamsAt(callIndex: number): {

8790

providerDiscoveryTimeoutMs?: number;

8891

workspaceDir?: string;

8992

} {

93+

// Planner call shape is the contract between ensureOpenClawModelsJson and planning.

9094

const call = planOpenClawModelsJsonMock.mock.calls[callIndex];

9195

if (!call) {

9296

throw new Error(`expected models planner call #${callIndex + 1}`);

@@ -397,6 +401,7 @@ describe("models-config write serialization", () => {

397401

let modelsWriteCount = 0;

398402

writePrivateStoreTextWriteMock.mockImplementation(

399403

async (params: { filePath: string; rootDir: string; content: string | Uint8Array }) => {

404+

// Hold both writes at the store boundary to prove the outer serializer works.

400405

const isModelsWrite = path.basename(params.filePath) === "models.json";

401406

if (isModelsWrite) {

402407

modelsWriteCount += 1;