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

推荐订阅源

V
Visual Studio Blog
Recent Announcements
Recent Announcements
有赞技术团队
有赞技术团队
The GitHub Blog
The GitHub Blog
N
Netflix TechBlog - Medium
腾讯CDC
A
About on SuperTechFans
博客园 - 叶小钗
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
D
DataBreaches.Net
D
Docker
宝玉的分享
宝玉的分享
量子位
Microsoft Azure Blog
Microsoft Azure Blog
Martin Fowler
Martin Fowler
博客园 - 三生石上(FineUI控件)
Jina AI
Jina AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
V2EX
Last Week in AI
Last Week in AI
H
Help Net Security
Hugging Face - Blog
Hugging Face - Blog
M
MIT News - Artificial intelligence

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
test: route subagent registry state env · openclaw/opencl...
shakkernerd · 2026-06-19 · via Recent Commits to openclaw:main

@@ -12,7 +12,7 @@ import {

1212

} from "../config/sessions/store.js";

1313

import { callGateway } from "../gateway/call.js";

1414

import { onAgentEvent } from "../infra/agent-events.js";

15-

import { captureEnv, withEnv } from "../test-utils/env.js";

15+

import { captureEnv, deleteTestEnvValue, setTestEnvValue, withEnv } from "../test-utils/env.js";

1616

import { persistSubagentSessionTiming } from "./subagent-registry-helpers.js";

1717

import { getSubagentRunsSnapshotForRead } from "./subagent-registry-state.js";

1818

import {

@@ -128,7 +128,7 @@ describe("subagent registry persistence", () => {

128128

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

129129

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

130130

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

131-

process.env.OPENCLAW_STATE_DIR = tempStateDir;

131+

setTestEnvValue("OPENCLAW_STATE_DIR", tempStateDir);

132132

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

133133

await fs.mkdir(path.dirname(registryPath), { recursive: true });

134134

await fs.writeFile(registryPath, `${JSON.stringify(persisted)}\n`, "utf8");

@@ -236,7 +236,7 @@ describe("subagent registry persistence", () => {

236236237237

it("persists completed subagent timing into the child session entry", async () => {

238238

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

239-

process.env.OPENCLAW_STATE_DIR = tempStateDir;

239+

setTestEnvValue("OPENCLAW_STATE_DIR", tempStateDir);

240240241241

const now = Date.now();

242242

const startedAt = now;

@@ -273,7 +273,7 @@ describe("subagent registry persistence", () => {

273273274274

it("skips cleanup when cleanupHandled was persisted", async () => {

275275

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

276-

process.env.OPENCLAW_STATE_DIR = tempStateDir;

276+

setTestEnvValue("OPENCLAW_STATE_DIR", tempStateDir);

277277278278

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

279279

const persisted = {

@@ -454,7 +454,7 @@ describe("subagent registry persistence", () => {

454454455455

it("returns empty maps for unchanged invalid persisted registry snapshots", async () => {

456456

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

457-

process.env.OPENCLAW_STATE_DIR = tempStateDir;

457+

setTestEnvValue("OPENCLAW_STATE_DIR", tempStateDir);

458458

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

459459

await fs.mkdir(path.dirname(registryPath), { recursive: true });

460460

await fs.writeFile(registryPath, "{invalid", "utf8");

@@ -501,7 +501,7 @@ describe("subagent registry persistence", () => {

501501502502

resetSubagentRegistryForTests({ persist: false });

503503

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

504-

process.env.OPENCLAW_STATE_DIR = tempStateDir;

504+

setTestEnvValue("OPENCLAW_STATE_DIR", tempStateDir);

505505506506

vi.mocked(callGateway).mockResolvedValueOnce({

507507

status: "pending",

@@ -778,7 +778,7 @@ describe("subagent registry persistence", () => {

778778779779

it("removes attachments when pruning orphaned restored runs", async () => {

780780

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

781-

process.env.OPENCLAW_STATE_DIR = tempStateDir;

781+

setTestEnvValue("OPENCLAW_STATE_DIR", tempStateDir);

782782

const attachmentsRootDir = path.join(tempStateDir, "attachments");

783783

const attachmentsDir = path.join(attachmentsRootDir, "ghost");

784784

await fs.mkdir(attachmentsDir, { recursive: true });

@@ -910,7 +910,7 @@ describe("subagent registry persistence", () => {

910910911911

it("resume guard prunes orphan runs before announce retry", async () => {

912912

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

913-

process.env.OPENCLAW_STATE_DIR = tempStateDir;

913+

setTestEnvValue("OPENCLAW_STATE_DIR", tempStateDir);

914914

const runId = "run-orphan-resume-guard";

915915

const childSessionKey = "agent:main:subagent:ghost-resume";

916916

const now = Date.now();

@@ -946,7 +946,7 @@ describe("subagent registry persistence", () => {

946946

});

947947948948

it("uses isolated temp state when OPENCLAW_STATE_DIR is unset in tests", () => {

949-

delete process.env.OPENCLAW_STATE_DIR;

949+

deleteTestEnvValue("OPENCLAW_STATE_DIR");

950950

const registryPath = resolveSubagentRegistryPath();

951951

expect(registryPath).toContain(path.join(os.tmpdir(), "openclaw-test-state"));

952952

});