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

推荐订阅源

P
Proofpoint News Feed
V
V2EX
WordPress大学
WordPress大学
Google DeepMind News
Google DeepMind News
Martin Fowler
Martin Fowler
小众软件
小众软件
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
The Cloudflare Blog
T
Tailwind CSS Blog
H
Help Net Security
腾讯CDC
爱范儿
爱范儿
人人都是产品经理
人人都是产品经理
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The GitHub Blog
The GitHub Blog
Microsoft Security Blog
Microsoft Security Blog
Stack Overflow Blog
Stack Overflow Blog
D
DataBreaches.Net
C
Check Point Blog
量子位
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

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 provider policy tests · openclaw/openclaw@...
steipete · 2026-06-05 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -1,8 +1,8 @@

1+

// Exercises startup provider discovery scoping without loading real plugin manifests.

12

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

23

import type { PluginMetadataSnapshotOwnerMaps } from "../plugins/plugin-metadata-snapshot.js";

34

import type { ProviderPlugin } from "../plugins/types.js";

45
5-

// Exercises startup provider discovery scoping without loading real plugin manifests.

66

const mocks = vi.hoisted(() => ({

77

resolveRuntimePluginDiscoveryProviders: vi.fn(),

88

runProviderCatalog: vi.fn(),

Original file line numberDiff line numberDiff line change

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

1+

// Covers live-test provider filters before they reach runtime plugin discovery.

12

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

23

import type { PluginMetadataSnapshotOwnerMaps } from "../plugins/plugin-metadata-snapshot.js";

34

import {

45

resolvePluginMetadataProviderOwnersForTest,

56

resolveProviderDiscoveryFilterForTest,

67

} from "./models-config.providers.implicit.js";

78
8-

// Covers live-test provider filters before they reach runtime plugin discovery.

99

function liveFilterEnv(overrides: NodeJS.ProcessEnv): NodeJS.ProcessEnv {

1010

// VITEST enables the live-filter parsing path without requiring real live creds.

1111

return {

Original file line numberDiff line numberDiff line change

@@ -1,6 +1,6 @@

1+

// Mirrors the implicit API-key and OAuth MiniMax catalogs that must stay in lockstep.

12

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

23
3-

// Mirrors the implicit API-key and OAuth MiniMax catalogs that must stay in lockstep.

44

function buildMinimaxCatalog() {

55

return [

66

{

Original file line numberDiff line numberDiff line change

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

1+

// Isolates Moonshot implicit-provider auth and streaming compat decisions.

12

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

23

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

34

import { applyProviderNativeStreamingUsageCompat } from "../plugin-sdk/provider-catalog-shared.js";

45

import { resolveMissingProviderApiKey } from "./models-config.providers.secret-helpers.js";

56
6-

// Isolates Moonshot implicit-provider auth and streaming compat decisions.

77

vi.mock("../plugins/setup-registry.js", () => ({

88

resolvePluginSetupProvider: () => undefined,

99

}));

Original file line numberDiff line numberDiff line change

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

1+

// Covers provider-key canonicalization plus secret marker persistence safeguards.

12

import fs from "node:fs/promises";

23

import os from "node:os";

34

import path from "node:path";

@@ -8,7 +9,6 @@ import { normalizeProviders } from "./models-config.providers.normalize.js";

89

import { resolveApiKeyFromProfiles } from "./models-config.providers.secret-helpers.js";

910

import { enforceSourceManagedProviderSecrets } from "./models-config.providers.source-managed.js";

1011
11-

// Covers provider-key canonicalization plus secret marker persistence safeguards.

1212

function normalizeLmstudioBaseUrl(baseUrl: string): string {

1313

const trimmed = baseUrl.trim().replace(/\/+$/, "");

1414

return trimmed.replace(/\/api\/v1$/, "").replace(/\/v1$/, "") + "/v1";

Original file line numberDiff line numberDiff line change

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

1+

// Verifies implicit provider secret wiring for NVIDIA, MiniMax portal, and vLLM.

12

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

23

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

34

import { resolveEnvApiKey } from "./model-auth-env.js";

@@ -6,7 +7,6 @@ import {

67

resolveMissingProviderApiKey,

78

} from "./models-config.providers.secret-helpers.js";

89
9-

// Verifies implicit provider secret wiring for NVIDIA, MiniMax portal, and vLLM.

1010

vi.mock("../plugins/setup-registry.js", () => ({

1111

resolvePluginSetupProvider: () => undefined,

1212

}));

Original file line numberDiff line numberDiff line change

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

1+

// Verifies custom providers route to the correct provider-policy plugin key.

12

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

23

import { resolveProviderPluginLookupKey } from "./models-config.providers.policy.lookup.js";

34

@@ -51,6 +52,7 @@ describe("resolveProviderPluginLookupKey", () => {

5152

});

5253
5354

it("falls through when runtime provider models is an object map", () => {

55+

// Runtime object maps are not catalog arrays, so model-level API sniffing must not run.

5456

expect(

5557

resolveProviderPluginLookupKey("openrouter", {

5658

baseUrl: "https://openrouter.ai/api/v1",

Original file line numberDiff line numberDiff line change

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

1+

// Verifies provider policy hooks without loading real provider plugins.

12

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

23
34

vi.mock("../plugins/provider-runtime.js", () => ({

@@ -6,6 +7,7 @@ vi.mock("../plugins/provider-runtime.js", () => ({

67

provider: string;

78

context: { providerConfig?: { baseUrl?: string } };

89

}) => {

10+

// Google URL normalization is representative of plugin-owned policy hooks.

911

if (params.provider !== "google") {

1012

return undefined;

1113

}

@@ -25,6 +27,7 @@ vi.mock("../plugins/provider-runtime.js", () => ({

2527

provider: string;

2628

context: { env: NodeJS.ProcessEnv };

2729

}) => {

30+

// API key markers can come from provider-specific non-key auth state.

2831

if (params.provider === "amazon-bedrock") {

2932

return params.context.env.AWS_PROFILE?.trim() ? "AWS_PROFILE" : undefined;

3033

}

@@ -81,6 +84,7 @@ describe("models-config.providers.policy", () => {

8184

});

8285
8386

it("does not treat generic transport APIs as provider plugin ids", () => {

87+

// Transport ids like openai-completions are not provider-policy namespaces.

8488

const provider = {

8589

api: "openai-completions" as const,

8690

baseUrl: "https://example.invalid/v1",

Original file line numberDiff line numberDiff line change

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

1+

// Covers Bedrock AWS SDK auth markers and marker-backed discovery secret guardrails.

12

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

23

import { NON_ENV_SECRETREF_MARKER } from "./model-auth-markers.js";

34

import type { ProviderConfig } from "./models-config.providers.secret-helpers.js";

@@ -44,7 +45,7 @@ describe("resolveMissingProviderApiKey — aws-sdk auth", () => {

4445

profileApiKey: undefined,

4546

});

4647
47-

// Provider should be returned unchanged — no apiKey field added

48+

// Provider stays unchanged; instance-role auth must not become a fake apiKey marker.

4849

expect(result).toBe(baseProvider);

4950

expect(result.apiKey).toBeUndefined();

5051

});

@@ -121,7 +122,7 @@ describe("resolveMissingProviderApiKey — aws-sdk auth", () => {

121122

profileApiKey: undefined,

122123

});

123124
124-

// Should return unchanged — already has apiKey

125+

// Existing apiKey config wins over inferred AWS environment markers.

125126

expect(result).toBe(providerWithKey);

126127

expect(result.apiKey).toBe("existing-key");

127128

});