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

推荐订阅源

月光博客
月光博客
J
Java Code Geeks
F
Fortinet All Blogs
Blog — PlanetScale
Blog — PlanetScale
P
Proofpoint News Feed
U
Unit 42
B
Blog
宝玉的分享
宝玉的分享
腾讯CDC
Microsoft Azure Blog
Microsoft Azure Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Last Week in AI
Last Week in AI
博客园 - Franky
博客园 - 三生石上(FineUI控件)
人人都是产品经理
人人都是产品经理
Martin Fowler
Martin Fowler
博客园_首页
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
云风的 BLOG
云风的 BLOG
L
LangChain Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Y
Y Combinator Blog
The GitHub Blog
The GitHub 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
test: isolate broad unit state · openclaw/openclaw@a171600
vincentkoc · 2026-05-17 · via Recent Commits to openclaw:main

@@ -1,9 +1,18 @@

1+

import fsSync from "node:fs";

12

import fs from "node:fs/promises";

23

import os from "node:os";

34

import path from "node:path";

45

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

6+

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

57

import { resetLogger, setLoggerOverride } from "../logging/logger.js";

68

import { loggingState } from "../logging/state.js";

9+

import {

10+

clearCurrentPluginMetadataSnapshot,

11+

setCurrentPluginMetadataSnapshot,

12+

} from "../plugins/current-plugin-metadata-snapshot.js";

13+

import { resolveInstalledPluginIndexPolicyHash } from "../plugins/installed-plugin-index-policy.js";

14+

import type { PluginManifestRecord, PluginManifestRegistry } from "../plugins/manifest-registry.js";

15+

import type { PluginMetadataSnapshot } from "../plugins/plugin-metadata-snapshot.js";

716

import { writeSkill, writeWorkspaceSkills } from "./skills.e2e-test-helpers.js";

817

import {

918

restoreMockSkillsHomeEnv,

@@ -52,6 +61,103 @@ let envSnapshot: SkillsHomeEnvSnapshot;

5261

let tempRoot = "";

5362

let workspaceCaseIndex = 0;

546364+

function createWorkspacePluginRegistry(workspaceDir: string): PluginManifestRegistry {

65+

const extensionsRoot = path.join(workspaceDir, ".openclaw", "extensions");

66+

const plugins: PluginManifestRecord[] = [];

67+

for (const id of ["open-prose", "browser"]) {

68+

const rootDir = path.join(extensionsRoot, id);

69+

const manifestPath = path.join(rootDir, "openclaw.plugin.json");

70+

if (!fsSync.existsSync(manifestPath)) {

71+

continue;

72+

}

73+

const manifest = JSON.parse(fsSync.readFileSync(manifestPath, "utf8")) as {

74+

id?: string;

75+

enabledByDefault?: boolean;

76+

skills?: string[];

77+

configSchema?: Record<string, unknown>;

78+

};

79+

plugins.push({

80+

id: manifest.id ?? id,

81+

origin: id === "browser" ? "bundled" : "workspace",

82+

enabledByDefault: manifest.enabledByDefault,

83+

channels: [],

84+

providers: [],

85+

cliBackends: [],

86+

legacyPluginIds: [],

87+

kind: [],

88+

skills: manifest.skills ?? ["./skills"],

89+

hooks: [],

90+

rootDir,

91+

source: rootDir,

92+

manifestPath,

93+

configSchema: manifest.configSchema,

94+

});

95+

}

96+

return { plugins, diagnostics: [] };

97+

}

98+99+

function createWorkspacePluginMetadataSnapshot(params: {

100+

workspaceDir: string;

101+

config?: OpenClawConfig;

102+

manifestRegistry: PluginManifestRegistry;

103+

}): PluginMetadataSnapshot {

104+

const policyHash = resolveInstalledPluginIndexPolicyHash(params.config);

105+

return {

106+

policyHash,

107+

workspaceDir: params.workspaceDir,

108+

index: {

109+

version: 1,

110+

hostContractVersion: "test",

111+

compatRegistryVersion: "test",

112+

migrationVersion: 1,

113+

policyHash,

114+

generatedAtMs: 1,

115+

installRecords: {},

116+

plugins: [],

117+

diagnostics: [],

118+

},

119+

registryDiagnostics: [],

120+

manifestRegistry: params.manifestRegistry,

121+

plugins: params.manifestRegistry.plugins,

122+

diagnostics: params.manifestRegistry.diagnostics,

123+

byPluginId: new Map(params.manifestRegistry.plugins.map((plugin) => [plugin.id, plugin])),

124+

normalizePluginId: (pluginId) => pluginId,

125+

owners: {

126+

channels: new Map(),

127+

channelConfigs: new Map(),

128+

providers: new Map(),

129+

modelCatalogProviders: new Map(),

130+

cliBackends: new Map(),

131+

setupProviders: new Map(),

132+

commandAliases: new Map(),

133+

contracts: new Map(),

134+

},

135+

metrics: {

136+

registrySnapshotMs: 0,

137+

manifestRegistryMs: 0,

138+

ownerMapsMs: 0,

139+

totalMs: 0,

140+

indexPluginCount: 0,

141+

manifestPluginCount: params.manifestRegistry.plugins.length,

142+

},

143+

};

144+

}

145+146+

function setWorkspacePluginMetadataSnapshot(workspaceDir: string, config?: OpenClawConfig): void {

147+

const manifestRegistry = createWorkspacePluginRegistry(workspaceDir);

148+

setCurrentPluginMetadataSnapshot(

149+

createWorkspacePluginMetadataSnapshot({

150+

workspaceDir,

151+

manifestRegistry,

152+

...(config === undefined ? {} : { config }),

153+

}),

154+

{

155+

workspaceDir,

156+

...(config === undefined ? {} : { config }),

157+

},

158+

);

159+

}

160+55161

function collectMatching<T>(items: readonly T[], predicate: (item: T) => boolean): T[] {

56162

const matches: T[] = [];

57163

for (const item of items) {

@@ -99,6 +205,7 @@ function loadTestWorkspaceSkillEntries(

99205

workspaceDir: string,

100206

opts?: Parameters<typeof loadWorkspaceSkillEntries>[1],

101207

) {

208+

setWorkspacePluginMetadataSnapshot(workspaceDir, opts?.config);

102209

return loadWorkspaceSkillEntries(workspaceDir, {

103210

managedSkillsDir: path.join(workspaceDir, ".managed"),

104211

bundledSkillsDir: "",

@@ -115,6 +222,7 @@ beforeAll(async () => {

115222

});

116223117224

afterEach(async () => {

225+

clearCurrentPluginMetadataSnapshot();

118226

setLoggerOverride(null);

119227

loggingState.rawConsole = null;

120228

resetLogger();