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

推荐订阅源

V
V2EX
P
Proofpoint News Feed
D
DataBreaches.Net
C
Check Point Blog
L
LangChain Blog
量子位
美团技术团队
Vercel News
Vercel News
人人都是产品经理
人人都是产品经理
N
Netflix TechBlog - Medium
V
Visual Studio Blog
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
MongoDB | Blog
MongoDB | Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Last Week in AI
Last Week in AI
The GitHub Blog
The GitHub Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
U
Unit 42
腾讯CDC
M
MIT News - Artificial intelligence
Microsoft Azure Blog
Microsoft Azure Blog
Blog — PlanetScale
Blog — PlanetScale

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

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

1+

// Verifies OpenClaw-owned tool hooks preserve adjusted params and telemetry.

12

import type { AgentTool } from "openclaw/plugin-sdk/agent-core";

23

import {

34

installOpenClawOwnedToolHooks,

@@ -33,6 +34,7 @@ type ToolExecutionStartEvent = Parameters<typeof handleToolExecutionStart>[1];

3334

type ToolExecutionEndEvent = Parameters<typeof handleToolExecutionEnd>[1];

3435
3536

function createToolHandlerCtx(): ToolHandlerContext {

37+

// Minimal embedded-agent tool handler context used to drive start/end events.

3638

return {

3739

params: {

3840

runId: "run-contract",

@@ -92,6 +94,7 @@ function createToolExtensionContext(): ExtensionContext {

9294

async function waitForAfterToolCall(hooks: {

9395

afterToolCall: { mock: { calls: unknown[][] } };

9496

}): Promise<[Record<string, unknown>, Record<string, unknown>]> {

97+

// after_tool_call fires asynchronously after the execution-end event is processed.

9598

await vi.waitFor(() => {

9699

expect(hooks.afterToolCall).toHaveBeenCalledTimes(1);

97100

});

Original file line numberDiff line numberDiff line change

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

1+

// Verifies agents_list reports only subagents visible to the requester.

12

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

23

import { createPerSenderSessionConfig } from "./test-helpers/session-config.js";

34

import { createAgentsListTool } from "./tools/agents-list-tool.js";

@@ -19,6 +20,7 @@ describe("agents_list", () => {

1920

type AgentConfig = NonNullable<NonNullable<typeof configOverride.agents>["list"]>[number];

2021
2122

function setConfigWithAgentList(agentList: AgentConfig[]) {

23+

// Each test gets a fresh per-sender session config plus its agent list.

2224

configOverride = {

2325

session: createPerSenderSessionConfig(),

2426

agents: {

@@ -34,6 +36,7 @@ describe("agents_list", () => {

3436

}

3537
3638

function readAgentList(result: unknown) {

39+

// Tool results expose the machine-readable agent list in details.

3740

return (result as { details?: { agents?: Array<{ id: string; configured?: boolean }> } })

3841

.details?.agents;

3942

}

Original file line numberDiff line numberDiff line change

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

1+

// Verifies OpenClaw plugin tools are resolved with browser/runtime context.

12

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

23

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

34

import { resetConfigRuntimeState, setRuntimeConfigSnapshot } from "../config/config.js";

@@ -13,6 +14,7 @@ vi.mock("../plugins/tools.js", () => ({

1314

}));

1415
1516

function firstResolvePluginToolsParams(): Record<string, unknown> {

17+

// Captures the plugin runtime contract passed from OpenClaw tool resolution.

1618

const call = hoisted.resolvePluginTools.mock.calls[0];

1719

if (!call) {

1820

throw new Error("Expected plugin tool resolution");

@@ -224,6 +226,7 @@ describe("createOpenClawTools browser plugin integration", () => {

224226

});

225227
226228

it("does not pass a stale active snapshot as plugin runtime config for a resolved run config", () => {

229+

// Resolved run config must win over any process-global runtime snapshot.

227230

const staleSourceConfig = {

228231

plugins: {

229232

allow: ["old-plugin"],

Original file line numberDiff line numberDiff line change

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

1+

// Verifies node camera/photo tool payloads, media URLs, and vision gating.

12

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

23

import {

34

readFileUtf8AndCleanup,

@@ -47,6 +48,7 @@ function unexpectedGatewayMethod(method: unknown): never {

4748

}

4849
4950

function getNodesTool(options?: { modelHasVision?: boolean; allowMediaInvokeCommands?: boolean }) {

51+

// Tests vary only model vision capability and media invoke permission.

5052

return createNodesTool({

5153

...(options?.modelHasVision !== undefined ? { modelHasVision: options.modelHasVision } : {}),

5254

...(options?.allowMediaInvokeCommands !== undefined

@@ -80,6 +82,7 @@ function expectInvokeParams(

8082

params?: Record<string, unknown>;

8183

},

8284

) {

85+

// Node command payloads are nested under the gateway node.invoke params object.

8386

const record = requireRecord(invokeParams, "node.invoke params");

8487

expect(record.command).toBe(expected.command);

8588

if (expected.nodeId !== undefined) {

@@ -146,6 +149,7 @@ function setupNodeInvokeMock(params: {

146149

onInvoke?: (invokeParams: unknown) => GatewayMockResult | Promise<GatewayMockResult>;

147150

invokePayload?: unknown;

148151

}) {

152+

// Most camera tests need node.list followed by one node.invoke command.

149153

callGateway.mockImplementation(async ({ method, params: invokeParams }: GatewayCall) => {

150154

if (method === "node.list") {

151155

return mockNodeList({ commands: params.commands, remoteIp: params.remoteIp });

Original file line numberDiff line numberDiff line change

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

1+

// Shared registration assertions for optional media-generation OpenClaw tools.

12

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

23

import { collectPresentOpenClawTools } from "./openclaw-tools.registration.js";

34

import { textResult, type AnyAgentTool } from "./tools/common.js";

45
56

function stubAgentTool(name: string): AnyAgentTool {

7+

// Registration tests only need a structurally valid tool.

68

return {

79

label: name,

810

name,

Original file line numberDiff line numberDiff line change

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

1+

// Verifies image-generation tool registration through the shared generation harness.

12

import { describeOpenClawGenerationToolRegistration } from "./openclaw-tools.generation.test-support.js";

23
34

describeOpenClawGenerationToolRegistration({