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

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
A
About on SuperTechFans
Y
Y Combinator Blog
V
V2EX
Engineering at Meta
Engineering at Meta
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Visual Studio Blog
博客园 - 叶小钗
博客园 - 聂微东
阮一峰的网络日志
阮一峰的网络日志
H
Help Net Security
小众软件
小众软件
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The GitHub Blog
The GitHub Blog
WordPress大学
WordPress大学
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
MongoDB | Blog
MongoDB | Blog
B
Blog
G
Google Developers Blog
J
Java Code Geeks
博客园 - 三生石上(FineUI控件)
IT之家
IT之家
N
Netflix TechBlog - Medium
腾讯CDC

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 registry lifecycle tests · opencl...
steipete · 2026-06-05 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

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

1+

// Subagent registry lifecycle tests cover completion, cleanup, announce retry,

2+

// detached task status, and resource retirement around child-run endings.

13

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

24

import type { CallGatewayOptions } from "../gateway/call.js";

35

import {

@@ -203,6 +205,8 @@ async function runNoReplyMirrorScenario(params: {

203205

idempotencyKey?: string;

204206

idempotencyKeyForEntry?: (entry: SubagentRunRecord) => string;

205207

}): Promise<SubagentRunRecord> {

208+

// A failed direct announce can still be mirrored from the requester history;

209+

// the idempotency key prevents stale or unrelated assistant text from winning.

206210

const entry = createRunEntry({

207211

endedAt: 4_000,

208212

expectsCompletionMessage: true,

Original file line numberDiff line numberDiff line change

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

1+

// Subagent registry query tests cover liveness, descendant counting, requester

2+

// lookup, and stale-row handling for in-memory run snapshots.

13

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

24

import {

35

countActiveRunsForSessionFromRuns,

@@ -223,7 +225,7 @@ describe("subagent registry query regressions", () => {

223225

});

224226
225227

it("regression nested parallel counting, traversal includes child and grandchildren pending states", () => {

226-

// Regression guard: nested fan-out once under-counted grandchildren and announced too early.

228+

// Nested fan-out once under-counted grandchildren and announced too early.

227229

const parentSessionKey = "agent:main:subagent:parent-nested";

228230

const middleSessionKey = `${parentSessionKey}:subagent:middle`;

229231

const runs = toRunMap([

Original file line numberDiff line numberDiff line change

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

1+

// Subagent registry read-context tests cover the indexed snapshot used by hot

2+

// prompt/control paths instead of repeatedly scanning the run map.

13

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

24

import {

35

buildSubagentRunReadIndexFromRuns,

@@ -160,6 +162,8 @@ describe("subagent registry read index", () => {

160162

});

161163
162164

it("keeps one snapshot stable for the lifetime of the context", () => {

165+

// Read indexes are process-local snapshots; callers can reuse them through

166+

// one prompt assembly without observing later registry mutations.

163167

const root = "agent:main:main";

164168

const runs = toRunMap([

165169

makeRun({

Original file line numberDiff line numberDiff line change

@@ -1,14 +1,8 @@

1+

// Announce loop-guard tests prove deferred subagent delivery eventually gives

2+

// up instead of retrying forever after gateway delivery keeps returning false.

13

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

24

import type { SubagentRunRecord } from "./subagent-registry.types.js";

35
4-

/**

5-

* Regression test for #18264: Gateway announcement delivery loop.

6-

*

7-

* When `runSubagentAnnounceFlow` repeatedly returns `false` (deferred),

8-

* `finalizeSubagentCleanup` must eventually give up rather than retrying

9-

* forever via the max-retry and expiration guards.

10-

*/

11-
126

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

137

getRuntimeConfig: vi.fn(() => ({

148

session: { store: "/tmp/test-store", mainKey: "main" },

@@ -200,7 +194,8 @@ describe("announce loop guard (#18264)", () => {

200194

const entry = createEntry(Date.now());

201195

mocks.loadSubagentRegistryFromSqlite.mockReturnValue(new Map([[entry.runId, entry]]));

202196
203-

// Initialization attempts resume once, then gives up for exhausted entries.

197+

// Initialization attempts one resume, then relies on expiry/retry-budget

198+

// guards so old pending rows do not loop after restart.

204199

const beforeInit = Date.now();

205200

registry.initSubagentRegistry();

206201

await flushAsync();

Original file line numberDiff line numberDiff line change

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

1+

// Lifecycle retry-grace e2e tests cover completion delivery retry behavior when

2+

// lifecycle events race gateway waits or transient announce failures.

13

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

24

import { testing as subagentAnnounceDeliveryTesting } from "./subagent-announce-delivery.js";

35

import { testing as subagentAnnounceOutputTesting } from "./subagent-announce-output.js";

@@ -220,6 +222,8 @@ describe("subagent registry lifecycle error grace", () => {

220222

};

221223
222224

const waitForCleanupHandledFalse = async (runId: string) => {

225+

// Cleanup can be released asynchronously after announce failure; poll fake

226+

// time until the retry-grace state is observable.

223227

for (let attempt = 0; attempt < 40; attempt += 1) {

224228

const run = mod

225229

.listSubagentRunsForRequester(MAIN_REQUESTER_SESSION_KEY)

Original file line numberDiff line numberDiff line change

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

1+

// Nested subagent registry e2e tests cover requester/controller relationships

2+

// across orchestrator and leaf child sessions.

13

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

24

import "./subagent-registry.mocks.shared.js";

35

@@ -76,7 +78,7 @@ describe("subagent registry nested agent tracking", () => {

7678
7779

it("announce uses requesterSessionKey to route to the correct parent", () => {

7880

const { registerSubagentRun } = subagentRegistry;

79-

// Register a sub-sub-agent whose parent is a sub-agent

81+

// Register a sub-sub-agent whose parent is a sub-agent.

8082

registerSubagentRun({

8183

runId: "run-subsub",

8284

childSessionKey: "agent:main:subagent:orch:subagent:child",

@@ -87,9 +89,8 @@ describe("subagent registry nested agent tracking", () => {

8789

label: "nested-leaf",

8890

});

8991
90-

// When announce fires for the sub-sub-agent, it should target the sub-agent (depth-1),

91-

// NOT the main session. The registry entry's requesterSessionKey ensures this.

92-

// We verify the registry entry has the correct requesterSessionKey.

92+

// Announce should target the depth-1 parent, not the main session. The

93+

// registry entry's requesterSessionKey carries that routing boundary.

9394

const { listSubagentRunsForRequester } = subagentRegistry;

9495

const orchRuns = listSubagentRunsForRequester("agent:main:subagent:orch");

9596

expect(orchRuns).toHaveLength(1);