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

推荐订阅源

GbyAI
GbyAI
B
Blog
Stack Overflow Blog
Stack Overflow Blog
量子位
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Tailwind CSS Blog
MongoDB | Blog
MongoDB | Blog
小众软件
小众软件
博客园 - 三生石上(FineUI控件)
Recent Announcements
Recent Announcements
U
Unit 42
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
腾讯CDC
D
DataBreaches.Net
Microsoft Azure Blog
Microsoft Azure Blog
G
Google Developers Blog
M
MIT News - Artificial intelligence
P
Proofpoint News Feed
罗磊的独立博客
L
LangChain Blog
V
Visual Studio Blog
雷峰网
雷峰网
aimingoo的专栏
aimingoo的专栏
宝玉的分享
宝玉的分享

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
fix(plugins): keep tool discovery request-local (#93276) ...
medns · 2026-06-19 · via Recent Commits to openclaw:main

@@ -3,7 +3,13 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";

33

import { clearPluginLoaderCache, testing } from "../loader.js";

44

import { createEmptyPluginRegistry } from "../registry-empty.js";

55

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

6-

import { resetPluginRuntimeStateForTest, setActivePluginRegistry } from "../runtime.js";

6+

import {

7+

getActivePluginChannelRegistry,

8+

getActivePluginRegistry,

9+

pinActivePluginChannelRegistry,

10+

resetPluginRuntimeStateForTest,

11+

setActivePluginRegistry,

12+

} from "../runtime.js";

713814

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

915

loadOpenClawPlugins: vi.fn<typeof import("../loader.js").loadOpenClawPlugins>(),

@@ -115,3 +121,93 @@ describe("ensureStandaloneRuntimePluginRegistryLoaded", () => {

115121

expect(loaderMocks.loadOpenClawPlugins).toHaveBeenCalledOnce();

116122

});

117123

});

124+125+

describe("ensureStandaloneRuntimePluginRegistryLoaded tool-discovery installs", () => {

126+

it("does not replace active or pinned channel registries during tool discovery", () => {

127+

const activeRegistry = createRegistryWithPlugin("provider-only");

128+

setActivePluginRegistry(activeRegistry, "active-key", "default", "/tmp/ws");

129+

const channelRegistry = createRegistryWithPlugin("channel-plugin");

130+

pinActivePluginChannelRegistry(channelRegistry);

131+

const toolRegistry = createRegistryWithPlugin("tool-plugin");

132+

loaderMocks.loadOpenClawPlugins.mockReturnValue(toolRegistry);

133+134+

ensureStandaloneRuntimePluginRegistryLoaded({

135+

surface: "channel",

136+

forceLoad: true,

137+

loadOptions: {

138+

onlyPluginIds: ["tool-plugin"],

139+

activate: false,

140+

toolDiscovery: true,

141+

workspaceDir: "/tmp/ws",

142+

},

143+

});

144+145+

expect(getActivePluginRegistry()).toBe(activeRegistry);

146+

expect(getActivePluginChannelRegistry()).toBe(channelRegistry);

147+

});

148+149+

it("does not replace the active registry for a tool-discovery active load", () => {

150+

const activeRegistry = createRegistryWithPlugin("provider-only");

151+

setActivePluginRegistry(activeRegistry, "active-key", "default", "/tmp/ws");

152+

const toolRegistry = createRegistryWithPlugin("tool-plugin");

153+

loaderMocks.loadOpenClawPlugins.mockReturnValue(toolRegistry);

154+155+

const result = ensureStandaloneRuntimePluginRegistryLoaded({

156+

surface: "active",

157+

forceLoad: true,

158+

installRegistry: true,

159+

loadOptions: {

160+

onlyPluginIds: ["tool-plugin"],

161+

activate: false,

162+

toolDiscovery: true,

163+

workspaceDir: "/tmp/ws",

164+

},

165+

});

166+167+

expect(result).toBe(toolRegistry);

168+

expect(getActivePluginRegistry()).toBe(activeRegistry);

169+

});

170+171+

it("still installs a non-tool-discovery active load (migration provider path)", () => {

172+

const activeRegistry = createRegistryWithPlugin("provider-only");

173+

setActivePluginRegistry(activeRegistry, "active-key", "default", "/tmp/ws");

174+

const migrationRegistry = createRegistryWithPlugin("migration-plugin");

175+

loaderMocks.loadOpenClawPlugins.mockReturnValue(migrationRegistry);

176+177+

ensureStandaloneRuntimePluginRegistryLoaded({

178+

surface: "active",

179+

forceLoad: true,

180+

installRegistry: true,

181+

loadOptions: {

182+

onlyPluginIds: ["migration-plugin"],

183+

activate: false,

184+

workspaceDir: "/tmp/ws",

185+

},

186+

});

187+188+

// Without toolDiscovery the load must still become the active registry, since the migration

189+

// provider resolver reads migrationProviders off the active registry.

190+

expect(getActivePluginRegistry()).toBe(migrationRegistry);

191+

});

192+193+

it("keeps runtime surfaces empty for a cold tool-discovery load", () => {

194+

// Establish the cold-start precondition deterministically (no active registry).

195+

resetPluginRuntimeStateForTest();

196+

const toolRegistry = createRegistryWithPlugin("tool-plugin");

197+

loaderMocks.loadOpenClawPlugins.mockReturnValue(toolRegistry);

198+199+

const result = ensureStandaloneRuntimePluginRegistryLoaded({

200+

surface: "channel",

201+

forceLoad: true,

202+

loadOptions: {

203+

onlyPluginIds: ["tool-plugin"],

204+

activate: false,

205+

toolDiscovery: true,

206+

workspaceDir: "/tmp/ws",

207+

},

208+

});

209+210+

expect(result).toBe(toolRegistry);

211+

expect(getActivePluginRegistry()).toBeNull();

212+

});

213+

});