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

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
GbyAI
GbyAI
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
Recent Announcements
Recent Announcements
L
LangChain Blog
B
Blog
阮一峰的网络日志
阮一峰的网络日志
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
M
MIT News - Artificial intelligence
D
Docker
WordPress大学
WordPress大学
J
Java Code Geeks
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The GitHub Blog
The GitHub Blog
博客园 - 叶小钗
Last Week in AI
Last Week in AI
Stack Overflow Blog
Stack Overflow Blog
有赞技术团队
有赞技术团队
MyScale Blog
MyScale Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
MongoDB | Blog
MongoDB | Blog
博客园 - 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 subagent registry persistence tests · open...
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 persistence tests cover JSON registry restore, child

2+

// session timing writes, and restart cleanup behavior.

13

import fsSync from "node:fs";

24

import fs from "node:fs/promises";

35

import os from "node:os";

@@ -123,6 +125,8 @@ describe("subagent registry persistence", () => {

123125

persisted: Record<string, unknown>,

124126

opts?: { seedChildSessions?: boolean },

125127

) => {

128+

// Each persisted-registry fixture gets its own state dir so session stores

129+

// and registry files are tested through the same paths production resolves.

126130

tempStateDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-subagent-"));

127131

process.env.OPENCLAW_STATE_DIR = tempStateDir;

128132

const registryPath = path.join(tempStateDir, "subagents", "runs.json");

@@ -187,6 +191,8 @@ describe("subagent registry persistence", () => {

187191

};

188192
189193

const fastPersistSubagentRunsToDisk = (runs: Map<string, SubagentRunRecord>) => {

194+

// Most tests assert restore semantics, not async writer behavior, so this

195+

// synchronous writer keeps registry state immediately observable.

190196

const registryPath = tempStateDir

191197

? path.join(tempStateDir, "subagents", "runs.json")

192198

: resolveSubagentRegistryPath();

Original file line numberDiff line numberDiff line change

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

1+

// Subagent registry steer-restart tests cover replacing child runs after steer

2+

// commands while preserving lifecycle hooks and completion delivery.

13

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

24

import type { ContextEngine } from "../context-engine/types.js";

35

@@ -195,6 +197,8 @@ describe("subagent registry steer restarts", () => {

195197

};

196198
197199

const createDeferredAnnounceResolver = (): ((value: boolean) => void) => {

200+

// Deferred announce lets tests observe registry state while delivery is

201+

// still in flight, then release the promise deterministically.

198202

let resolveAnnounce: ((value: boolean) => void) | undefined;

199203

announceSpy.mockImplementationOnce(

200204

() =>

Original file line numberDiff line numberDiff line change

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

1+

// Subagent registry SQLite store tests cover whole-snapshot persistence and

2+

// one-time import from the legacy JSON registry file.

13

import fs from "node:fs/promises";

24

import os from "node:os";

35

import path from "node:path";

@@ -107,6 +109,8 @@ describe("subagent registry sqlite store", () => {

107109

});

108110
109111

it("imports the legacy json registry when sqlite has no runs", async () => {

112+

// Import deletes the JSON source after the first successful migration so

113+

// later loads treat SQLite as canonical state.

110114

const legacyRun = createRun({

111115

runId: "legacy-run",

112116

childSessionKey: "agent:main:subagent:legacy",

Original file line numberDiff line numberDiff line change

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

1+

// Subagent registry test helpers expose the in-memory run map for small unit

2+

// tests that do not need persistence, lifecycle hooks, or gateway mocks.

13

import { subagentRuns } from "./subagent-registry-memory.js";

24

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

35
Original file line numberDiff line numberDiff line change

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

1+

// Subagent run liveness tests cover stale-unended detection and child-link

2+

// retention windows for registry list/read paths.

13

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

24

import {

35

isLiveUnendedSubagentRun,

@@ -54,6 +56,8 @@ describe("subagent run liveness", () => {

5456

});

5557
5658

it("ignores non-real fixture timestamps as unknown instead of stale", () => {

59+

// Small fixture timestamps appear in tests and old synthetic records; they

60+

// should not be interpreted as Unix epoch production runs.

5761

const entry = {

5862

createdAt: 100,

5963

};

Original file line numberDiff line numberDiff line change

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

1+

// Subagent spawn context tests cover isolated, forked, lightweight, and

2+

// thread-bound bootstrap context preparation for child sessions.

13

import path from "node:path";

24

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

35

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

@@ -42,6 +44,8 @@ describe("sessions_spawn context modes", () => {

4244

});

4345
4446

function usePersistentStoreMock(store: SessionStore) {

47+

// The spawn path mutates the session store in-place; this mock keeps that

48+

// contract visible without touching disk.

4549

updateSessionStoreMock.mockImplementation(async (_storePath: unknown, mutator: unknown) => {

4650

if (typeof mutator !== "function") {

4751

throw new Error("missing session store mutator");

@@ -198,6 +202,8 @@ describe("sessions_spawn context modes", () => {

198202

});

199203
200204

it("falls back to isolated context when requested fork is too large", async () => {

205+

// Forking very large transcripts would create expensive child context, so

206+

// the accepted run records the downgrade in its note.

201207

const store: SessionStore = {

202208

main: {

203209

sessionId: "parent-session-id",