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

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
有赞技术团队
有赞技术团队
IT之家
IT之家
博客园 - 聂微东
Jina AI
Jina AI
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
Apple Machine Learning Research
Apple Machine Learning Research
WordPress大学
WordPress大学
小众软件
小众软件
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
Visual Studio Blog
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
阮一峰的网络日志
阮一峰的网络日志
宝玉的分享
宝玉的分享
博客园 - 三生石上(FineUI控件)
大猫的无限游戏
大猫的无限游戏
博客园 - Franky
量子位
月光博客
月光博客
博客园 - 【当耐特】
博客园 - 叶小钗

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

@@ -1,3 +1,5 @@

1+

// web_fetch visibility tests cover hidden HTML and invisible Unicode stripping

2+

// before extracted content reaches the model.

13

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

24

import { sanitizeHtml, stripInvisibleUnicode } from "./web-fetch-visibility.js";

35

@@ -196,6 +198,8 @@ describe("sanitizeHtml", () => {

196198

});

197199
198200

it("drops nested hidden same-name elements without leaking trailing hidden text", async () => {

201+

// Malformed hidden regions are prompt-injection territory; nested tags must

202+

// not leak trailing hidden text after the inner close tag.

199203

const html = "<p>Visible</p><div hidden><div>Nested hidden</div>Still hidden</div><p>Shown</p>";

200204

const result = await sanitizeHtml(html);

201205

expect(result).toContain("Visible");

@@ -237,6 +241,8 @@ describe("stripInvisibleUnicode", () => {

237241

});

238242
239243

it("strips directional overrides (LRO, RLO, PDF, etc.)", () => {

244+

// Directional controls can make visible text render differently from the

245+

// byte sequence the model sees.

240246

const text = "\u202AHello\u202E";

241247

expect(stripInvisibleUnicode(text)).toBe("Hello");

242248

});

Original file line numberDiff line numberDiff line change

@@ -1,3 +1,5 @@

1+

// web_fetch SSRF tests cover URL, DNS, redirect, and proxy policy enforcement

2+

// before network requests reach fetch or provider fallbacks.

13

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

24

import * as ssrf from "../../infra/net/ssrf.js";

35

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

@@ -139,6 +141,8 @@ describe("web_fetch SSRF protection", () => {

139141

});

140142
141143

it("blocks redirects to private hosts", async () => {

144+

// Redirect targets are new network destinations and must be re-checked

145+

// against the same SSRF policy as the original URL.

142146

lookupMock.mockResolvedValue([{ address: "93.184.216.34", family: 4 }]);

143147
144148

const fetchSpy = setMockFetch().mockResolvedValueOnce(

@@ -163,6 +167,8 @@ describe("web_fetch SSRF protection", () => {

163167

});

164168
165169

it("allows RFC2544 benchmark-range URLs only when web_fetch ssrfPolicy opts in", async () => {

170+

// Benchmark ranges are fake-IP infrastructure in some deployments, but

171+

// remain denied unless the web_fetch config opts in.

166172

const url = "http://198.18.0.153/file";

167173

lookupMock.mockResolvedValue([{ address: "198.18.0.153", family: 4 }]);

168174
Original file line numberDiff line numberDiff line change

@@ -1,3 +1,5 @@

1+

// Web search credential tests cover precedence between configured credentials,

2+

// SecretRefs, and ambient environment fallbacks.

13

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

24

import { withEnv } from "../../test-utils/env.js";

35

import { resolveWebSearchProviderCredential } from "./web-search-provider-credentials.js";

@@ -32,6 +34,8 @@ describe("resolveWebSearchProviderCredential", () => {

3234

});

3335
3436

it("does not override missing env SecretRefs with ambient env fallback", () => {

37+

// An explicit SecretRef means "use this credential"; falling back to a

38+

// different env var can silently route requests through the wrong account.

3539

withEnv(

3640

{ TEST_WEB_SEARCH_REF_KEY: undefined, TEST_WEB_SEARCH_KEY: "ambient-test-value" },

3741

() => {

Original file line numberDiff line numberDiff line change

@@ -1,3 +1,5 @@

1+

// web_search late-binding tests cover runtime config and provider metadata

2+

// selection at execution time.

13

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

24

import { createWebSearchTool } from "./web-search.js";

35

@@ -136,6 +138,8 @@ describe("web_search late-bound runtime fallback", () => {

136138

});

137139
138140

it("prefers active runtime metadata over options.runtimeWebSearch when present", async () => {

141+

// Active runtime metadata reflects the newest credential snapshot; fallback

142+

// options only cover tools created before that state exists.

139143

mocks.getActiveRuntimeWebToolsMetadata.mockReturnValue({

140144

search: {

141145

selectedProvider: "perplexity",

@@ -161,6 +165,8 @@ describe("web_search late-bound runtime fallback", () => {

161165

});

162166
163167

it("honors late-bound disabled search config at execute time", async () => {

168+

// A long-lived tool must still observe an operator disabling web_search

169+

// before the next call is dispatched.

164170

mocks.getActiveSecretsRuntimeConfigSnapshot.mockReturnValue({

165171

config: { tools: { web: { search: { enabled: false } } } },

166172

});