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

推荐订阅源

N
Netflix TechBlog - Medium
I
InfoQ
Engineering at Meta
Engineering at Meta
Jina AI
Jina AI
Recent Announcements
Recent Announcements
T
The Blog of Author Tim Ferriss
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
D
Docker
Microsoft Security Blog
Microsoft Security Blog
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
博客园 - Franky
博客园 - 聂微东
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 叶小钗
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog RSS Feed
WordPress大学
WordPress大学
MyScale Blog
MyScale 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 model transport tests · openclaw/openclaw@...
steipete · 2026-06-05 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

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

1+

// Covers MCP HTTP transport redirects, SSRF guardrails, and auth/TLS handoff.

12

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

23

import { resolveMcpTransport } from "./mcp-transport.js";

34

@@ -48,6 +49,8 @@ function redirectWithoutLocationResponse(status = 302): Response {

4849

}

4950
5051

function latestStreamableTransportOptions(): StreamableTransportOptions {

52+

// The SDK transport is constructor-injected; tests inspect the most recent

53+

// options to exercise OpenClaw's wrapped fetch implementation directly.

5154

const latestCall = streamableTransportConstructorMock.mock.calls[

5255

streamableTransportConstructorMock.mock.calls.length - 1

5356

] as unknown[] | undefined;

@@ -85,6 +88,8 @@ describe("resolveMcpTransport", () => {

8588

});

8689
8790

it("scrubs custom headers when streamable HTTP follows a cross-origin redirect", async () => {

91+

// Cross-origin redirects keep safe protocol headers but drop operator

92+

// secrets such as API keys before following the Location target.

8893

runtimeFetchMock

8994

.mockResolvedValueOnce(redirectResponse("https://redirect.example/next"))

9095

.mockResolvedValueOnce(new Response("ok"));

@@ -142,6 +147,8 @@ describe("resolveMcpTransport", () => {

142147

});

143148
144149

it("preserves replayable request bodies for cross-origin streamable HTTP redirects", async () => {

150+

// 307/308 redirects preserve method/body, while custom auth headers are

151+

// still stripped when the destination origin changes.

145152

runtimeFetchMock

146153

.mockResolvedValueOnce(redirectResponse("https://redirect.example/mcp", 307))

147154

.mockResolvedValueOnce(new Response("ok"));

Original file line numberDiff line numberDiff line change

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

1+

// Verifies memory-search config resolution across providers, sync, and batching.

12

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

23

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

34

import {

@@ -10,6 +11,8 @@ import { resolveMemorySearchConfig, resolveMemorySearchSyncConfig } from "./memo

1011

const asConfig = (cfg: OpenClawConfig): OpenClawConfig => cfg;

1112
1213

function registerBaseMemoryEmbeddingProviders(options?: { includeGemini?: boolean }): void {

14+

// Register provider contracts locally so config tests do not depend on the

15+

// plugin loader or live embedding backends.

1316

registerMemoryEmbeddingProvider({

1417

id: "openai",

1518

defaultModel: "text-embedding-3-small",

@@ -84,6 +87,8 @@ describe("memory search config", () => {

8487

}

8588
8689

function expectDefaultRemoteBatch(resolved: ReturnType<typeof resolveMemorySearchConfig>): void {

90+

// Remote providers default to non-batch mode; explicit batch config must

91+

// opt in so memory search does not introduce hidden async polling.

8792

expect(resolved?.remote?.batch).toEqual({

8893

enabled: false,

8994

wait: true,

@@ -209,6 +214,8 @@ describe("memory search config", () => {

209214

});

210215
211216

it("resolves custom provider ids through their configured api owner", () => {

217+

// Workspace provider aliases inherit embedding defaults from their API

218+

// owner while keeping the configured provider id for auth/routing.

212219

const cfg = asConfig({

213220

models: {

214221

providers: {

Original file line numberDiff line numberDiff line change

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

1+

// Covers MiniMax VLM auth/header normalization and provider-specific routing.

12

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

23

import { withFetchPreconnect } from "../test-utils/fetch-mock.js";

34

import { isMinimaxVlmModel, minimaxUnderstandImage } from "./minimax-vlm.js";

@@ -21,6 +22,8 @@ describe("minimaxUnderstandImage apiKey normalization", () => {

2122

});

2223
2324

async function runNormalizationCase(apiKey: string) {

25+

// Headers must be Latin-1 and line-break free; normalize user/API-key

26+

// input before constructing the Authorization header.

2427

const fetchSpy = vi.fn(async (_input: RequestInfo | URL, init?: RequestInit) => {

2528

const auth = (init?.headers as Record<string, string> | undefined)?.Authorization;

2629

expect(auth).toBe("Bearer minimax-test-key");

@@ -155,6 +158,8 @@ describe("minimaxUnderstandImage apiKey normalization", () => {

155158

});

156159
157160

it("bounds large provider error response bodies", async () => {

161+

// Provider error bodies can be large. Read enough for diagnostics, then

162+

// cancel the stream so failures stay bounded.

158163

let canceled = false;

159164

const body = new ReadableStream<Uint8Array>({

160165

start(controller) {

Original file line numberDiff line numberDiff line change

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

1+

// Live-gated MiniMax text smoke probe.

12

import { completeSimple, type Model } from "openclaw/plugin-sdk/llm";

23

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

34

import {

@@ -14,6 +15,8 @@ const LIVE = isLiveTestEnabled(["MINIMAX_LIVE_TEST"]);

1415

const describeLive = LIVE && MINIMAX_KEY ? describe : describe.skip;

1516
1617

async function runMinimaxTextProbe(model: Model<"anthropic-messages">, maxTokens: number) {

18+

// MiniMax uses the Anthropic-compatible message surface, so the smoke probe

19+

// goes through completeSimple instead of provider-specific helpers.

1720

const res = await completeSimple(

1821

model,

1922

{

Original file line numberDiff line numberDiff line change

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

1+

// Verifies env API-key lookup through plugin provider-auth aliases.

12

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

23

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

34

@@ -62,6 +63,8 @@ describe("resolveEnvApiKey provider auth aliases", () => {

6263

});

6364
6465

it("reuses the current scoped metadata snapshot while resolving provider auth aliases", () => {

66+

// The active scoped snapshot already reflects workspace/plugin filtering;

67+

// reloading metadata here can accidentally see a broader plugin set.

6568

expect(

6669

resolveEnvApiKey(

6770

"cloud-alias",

@@ -89,6 +92,8 @@ describe("resolveEnvApiKey provider auth aliases", () => {

8992

});

9093
9194

it("passes config and workspace scope to setup-provider fallback", () => {

95+

// Setup providers can derive env/config keys from workspace context, so the

96+

// fallback must receive the same scope as metadata resolution.

9297

const config = {};

9398

const env = {} as NodeJS.ProcessEnv;

9499

setupRegistryMocks.resolvePluginSetupProvider.mockReturnValue({