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

推荐订阅源

Google DeepMind News
Google DeepMind News
D
Docker
Last Week in AI
Last Week in AI
WordPress大学
WordPress大学
月光博客
月光博客
小众软件
小众软件
量子位
V
Visual Studio Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
Tailwind CSS Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
罗磊的独立博客
博客园 - 叶小钗
美团技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 三生石上(FineUI控件)
博客园 - 聂微东
博客园 - 司徒正美
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - Franky
Hugging Face - Blog
Hugging Face - Blog
GbyAI
GbyAI
C
Check Point 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 subagent control tests · openclaw/openclaw...
steipete · 2026-06-05 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

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

1+

// Subagent announce format e2e tests exercise the full announce flow with

2+

// channel fixtures, session stores, hooks, and gateway calls wired together.

13

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

24

import { SILENT_REPLY_TOKEN } from "../auto-reply/tokens.js";

35

import {

@@ -80,6 +82,8 @@ function expectInputProvenance(

8082

params: Record<string, unknown> | undefined,

8183

sourceSessionKey: string,

8284

) {

85+

// Announce handoffs are inter-session messages; provenance lets the receiver

86+

// distinguish child-output delivery from ordinary user input.

8387

const inputProvenance = params?.inputProvenance;

8488

if (!inputProvenance || typeof inputProvenance !== "object") {

8589

throw new Error("Expected input provenance");

@@ -218,6 +222,8 @@ const defaultOutcomeAnnounce = {

218222

};

219223
220224

const announceFormatChannelPlugins = [

225+

// Channel fixtures intentionally mix plain channels with Slack-style thread

226+

// target resolution so formatting covers direct and threaded destinations.

221227

{

222228

pluginId: "discord",

223229

plugin: createChannelTestPluginBase({ id: "discord", label: "Discord" }),

Original file line numberDiff line numberDiff line change

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

1+

// Subagent announce flow tests cover the seam-level orchestration between wait

2+

// outcomes, requester lookup, delivery, and cleanup.

13

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

24

import type { EmbeddedAgentQueueMessageOutcome } from "./embedded-agent-runner/runs.js";

35

import { createSubagentAnnounceDeliveryRuntimeMock } from "./subagent-announce.test-support.js";

@@ -108,6 +110,8 @@ vi.mock("./subagent-announce-delivery.js", () => ({

108110

requesterSessionOrigin?: { provider?: string; channel?: string };

109111

bestEffortDeliver?: boolean;

110112

}) => {

113+

// The delivery mock preserves the key branch: active Discord requester

114+

// sessions are steered in-process, while inactive/direct paths call agent.

111115

const store = loadSessionStoreMock("/tmp/sessions.json") as Record<string, unknown>;

112116

const requesterEntry = (store?.[params.targetRequesterSessionKey] ?? {}) as

113117

| { sessionId?: string; origin?: { provider?: string; channel?: string } }

Original file line numberDiff line numberDiff line change

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

1+

// Subagent announce timeout tests cover retry timing and fallback requester

2+

// resolution when completion delivery cannot finish immediately.

13

import { clampTimerTimeoutMs } from "@openclaw/normalization-core/number-coercion";

24

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

35

import { createSubagentAnnounceDeliveryRuntimeMock } from "./subagent-announce.test-support.js";

@@ -110,6 +112,8 @@ vi.mock("./subagent-announce-delivery.js", () => ({

110112

directIdempotencyKey?: string;

111113

internalEvents?: unknown;

112114

}) => {

115+

// Retry behavior is modeled here because the outer announce flow only sees

116+

// whether direct delivery eventually succeeded or failed.

113117

const buildRequest = () => ({

114118

method: "agent",

115119

expectFinal: true,

Original file line numberDiff line numberDiff line change

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

1+

// Subagent control tests cover sending, steering, killing, and admin cleanup of

2+

// child runs recorded in the subagent registry and session store.

13

import fs from "node:fs";

24

import os from "node:os";

35

import path from "node:path";

@@ -30,6 +32,8 @@ vi.mock("./run-wait.js", () => {

3032

limit?: number;

3133

callGateway?: (request: CallGatewayOptions) => Promise<{ messages?: unknown[] }>;

3234

}) => {

35+

// The real helper snapshots assistant fingerprints so a steer command only

36+

// reports new replies, not the baseline text that existed before steering.

3337

const history = await params.callGateway?.({

3438

method: "chat.history",

3539

params: { sessionKey: params.sessionKey, limit: params.limit ?? 50 },

@@ -111,6 +115,8 @@ vi.mock("./run-wait.js", () => {

111115

function setSubagentControlDepsForTest(

112116

overrides: Parameters<typeof testing.setDepsForTest>[0] = {},

113117

) {

118+

// Tests use real JSON store mutation to catch persisted cleanup/kill state,

119+

// while swapping process-owned queues and embedded-run aborts for fakes.

114120

testing.setDepsForTest({

115121

abortEmbeddedAgentRun: () => false,

116122

clearSessionQueues: () => ({ followupCleared: 0, laneCleared: 0, keys: [] }),

Original file line numberDiff line numberDiff line change

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

1+

// Subagent delivery-state tests cover migration of legacy run fields into the

2+

// nested completion/delivery shape used by current registry records.

13

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

24

import { normalizeSubagentRunState } from "./subagent-delivery-state.js";

35

import type { LegacySubagentRunRecord } from "./subagent-delivery-state.js";

@@ -22,6 +24,8 @@ function baseRun(overrides: Partial<LegacySubagentRunRecord> = {}): LegacySubage

2224
2325

describe("normalizeSubagentRunState", () => {

2426

it("migrates legacy pending delivery fields into nested completion and delivery state", () => {

27+

// Restored runs may still carry flat pendingFinalDelivery fields from older

28+

// builds; normalization must preserve retry payloads before stripping them.

2529

const entry = normalizeSubagentRunState(

2630

baseRun({

2731

frozenResultText: "child output",

Original file line numberDiff line numberDiff line change

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

1+

// Subagent depth tests cover depth recovery from persisted session metadata and

2+

// timer-safe timeout normalization for spawned agent runs.

13

import fs from "node:fs";

24

import os from "node:os";

35

import path from "node:path";

@@ -40,6 +42,8 @@ describe("getSubagentDepthFromSessionStore", () => {

4042

});

4143
4244

it("derives depth from spawnedBy ancestry when spawnDepth is missing", () => {

45+

// Ancestry fallback keeps restored sessions useful when old stores predate

46+

// the explicit spawnDepth field.

4347

const key1 = "agent:main:subagent:one";

4448

const key2 = "agent:main:subagent:two";

4549

const key3 = "agent:main:subagent:three";