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

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
MyScale Blog
MyScale Blog
U
Unit 42
M
MIT News - Artificial intelligence
小众软件
小众软件
P
Proofpoint News Feed
雷峰网
雷峰网
L
LangChain Blog
S
SegmentFault 最新的问题
腾讯CDC
F
Fortinet All Blogs
A
About on SuperTechFans
WordPress大学
WordPress大学
Vercel News
Vercel News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
D
Docker
N
Netflix TechBlog - Medium
Apple Machine Learning Research
Apple Machine Learning Research
Recent Announcements
Recent Announcements
D
DataBreaches.Net
Stack Overflow Blog
Stack Overflow 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 tool guard tests · openclaw/openclaw@2d3b378
steipete · 2026-06-05 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

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

1+

// Subagent spawn test helpers install mocked runtime seams so sessions_spawn

2+

// tests can exercise orchestration without real gateway/session-store effects.

13

import os from "node:os";

24

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

35

import { expect, vi } from "vitest";

46

import type { SubagentLifecycleHookRunner } from "../plugins/hooks.js";

57
6-

// Test helpers for sessions_spawn. They install a mocked runtime barrel so

7-

// spawn tests can exercise orchestration without touching the real gateway or

8-

// session stores.

98

type MockFn = (...args: unknown[]) => unknown;

109

type MockImplementationTarget = {

1110

mockImplementation: (implementation: (opts: { method?: string }) => Promise<unknown>) => unknown;

@@ -197,8 +196,8 @@ export async function loadSubagentSpawnModuleForTest(params: {

197196

resetModules?: boolean;

198197

}): Promise<SubagentSpawnModuleForTest> {

199198

if (params.resetModules ?? true) {

200-

// The helper rewires module imports with vi.doMock, so each test starts from

201-

// a fresh module graph unless explicitly sharing mocks.

199+

// The helper rewires imports with vi.doMock, so each test starts from a

200+

// fresh module graph unless explicitly sharing mocks.

202201

vi.resetModules();

203202

}

204203
Original file line numberDiff line numberDiff line change

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

1+

// Tool allowlist guard tests cover fail-closed behavior when explicit

2+

// allowlists leave no callable tools for the selected runtime/model.

13

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

24

import {

35

buildEmptyExplicitToolAllowlistError,

@@ -32,6 +34,8 @@ describe("tool allowlist guard", () => {

3234

});

3335
3436

it("allows inherited config allowlists when a run intentionally disables tools", () => {

37+

// Explicit runtime allowlists are command-time intent, while inherited

38+

// config allowlists should not block a deliberately text-only run.

3539

expect(

3640

buildEmptyExplicitToolAllowlistError({

3741

sources: [{ label: "tools.allow", entries: ["lobster", "llm-task"] }],

Original file line numberDiff line numberDiff line change

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

1+

// Tool loop detection tests cover repeated-call hashing, ping-pong detection,

2+

// unknown-tool thresholds, and circuit-breaker escalation.

13

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

24

import type { ToolLoopDetectionConfig } from "../config/types.tools.js";

35

import type { SessionState } from "../logging/diagnostic-session-state.js";

@@ -142,6 +144,8 @@ function recordSuccessfulPingPongCalls(params: {

142144

count: number;

143145

textAtIndex: (toolName: "read" | "list", index: number) => string;

144146

}) {

147+

// Alternating successful calls with unchanged output exercise the ping-pong

148+

// detector independently from same-tool repetition.

145149

for (let i = 0; i < params.count; i += 1) {

146150

if (i % 2 === 0) {

147151

recordSuccessfulCall(

Original file line numberDiff line numberDiff line change

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

1+

// sessions_spawn tool tests cover model-visible schema gating, ACP/subagent

2+

// dispatch, and result details for spawned child sessions.

13

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

24
35

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

@@ -108,6 +110,8 @@ describe("sessions_spawn tool", () => {

108110

}

109111
110112

it("hides ACP runtime affordances when no ACP backend is loaded", () => {

113+

// The tool schema is generated from live runtime availability; stale ACP

114+

// fields should not be advertised when no backend can handle them.

111115

const tool = createSessionsSpawnTool();

112116

const schema = tool.parameters as {

113117

properties?: {