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

推荐订阅源

Y
Y Combinator Blog
博客园_首页
量子位
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
H
Help Net Security
The Cloudflare Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
A
About on SuperTechFans
腾讯CDC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
DataBreaches.Net
L
LangChain Blog
Stack Overflow Blog
Stack Overflow Blog
Jina AI
Jina AI
月光博客
月光博客
云风的 BLOG
云风的 BLOG
博客园 - 聂微东
Hugging Face - Blog
Hugging Face - Blog
雷峰网
雷峰网
C
Check Point Blog
V
V2EX
T
Tailwind CSS Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Security Blog
Microsoft Security 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
feat: expose active model plugin context · openclaw/openc...
steipete · 2026-05-10 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -12,6 +12,7 @@ Docs: https://docs.openclaw.ai

1212

- Plugin SDK: deprecate public subpaths currently used by only one or two bundled plugin owners, keeping them importable while steering new plugin code to focused shared SDK seams or plugin-owned APIs.

1313

- Plugin SDK: remove the owner-specific `provider-auth-login` public subpath after moving Chutes, GitHub Copilot, and OpenAI Codex auth flows back to provider-owned modules.

1414

- Plugin SDK: remove provider-specific model, stream, and xAI compatibility helpers from public exports after moving bundled callers to provider-owned modules.

15+

- Plugin SDK: expose runtime-supplied active model metadata to native plugin tool factories for diagnostics and plugin-owned policy decisions. Fixes #77857. Thanks @jamiezigelbaum.

1516

- QA/Mantis: add Telegram live PR evidence automation with Convex-leased credentials, Crabbox transcript capture, motion GIF previews, and inline PR comments.

1617

- QA/Mantis: add a Telegram desktop scenario builder that leases Crabbox, installs native Telegram Desktop, configures an OpenClaw Telegram gateway with leased bot credentials, and records VNC screenshot/video artifacts.

1718

- Discord/voice: add realtime voice diagnostics for speaker turns, playback resets, barge-in detection, and audio cutoff analysis.

Original file line numberDiff line numberDiff line change

@@ -248,6 +248,14 @@ register(api) {

248248

}

249249

```

250250
251+

Tool factories receive a runtime-supplied context object. Use

252+

`ctx.activeModel` when a tool needs to log, display, or adapt to the active

253+

model for the current turn. The object can include `provider`, `modelId`, and

254+

`modelRef`. Treat it as informational runtime metadata, not as a security

255+

boundary against the local operator, installed plugin code, or a modified

256+

OpenClaw runtime. For sensitive local tools, keep an explicit plugin or operator

257+

opt-in and fail closed when the active model metadata is missing or unsuitable.

258+
251259

Every tool registered with `api.registerTool(...)` must also be declared in the

252260

plugin manifest:

253261
Original file line numberDiff line numberDiff line change

@@ -24,6 +24,7 @@ type ResolveOpenClawPluginToolsOptions = OpenClawPluginToolOptions & {

2424

sandboxRoot?: string;

2525

modelHasVision?: boolean;

2626

modelProvider?: string;

27+

modelId?: string;

2728

allowMediaInvokeCommands?: boolean;

2829

requesterAgentIdOverride?: string;

2930

requireExplicitMessageTarget?: boolean;

Original file line numberDiff line numberDiff line change

@@ -42,6 +42,22 @@ describe("openclaw plugin tool context", () => {

4242

expect(result.context.sessionId).toBe("a1b2c3d4-e5f6-7890-abcd-ef1234567890");

4343

});

4444
45+

it("forwards runtime-owned active model metadata", () => {

46+

const result = resolveOpenClawPluginToolInputs({

47+

options: {

48+

config: {} as never,

49+

modelProvider: " local-provider ",

50+

modelId: " local-model ",

51+

},

52+

});

53+
54+

expect(result.context.activeModel).toStrictEqual({

55+

provider: "local-provider",

56+

modelId: "local-model",

57+

modelRef: "local-provider/local-model",

58+

});

59+

});

60+
4561

it("infers the default agent workspace when workspaceDir is omitted", () => {

4662

const workspaceDir = path.join(process.cwd(), "tmp-main-workspace");

4763

const result = resolveOpenClawPluginToolInputs({

Original file line numberDiff line numberDiff line change

@@ -15,6 +15,8 @@ export type OpenClawPluginToolOptions = {

1515

workspaceDir?: string;

1616

config?: OpenClawConfig;

1717

fsPolicy?: ToolFsPolicy;

18+

modelProvider?: string;

19+

modelId?: string;

1820

requesterSenderId?: string | null;

1921

requesterAgentIdOverride?: string;

2022

senderIsOwner?: boolean;

@@ -42,6 +44,16 @@ export function resolveOpenClawPluginToolInputs(params: {

4244

? undefined

4345

: resolveAgentWorkspaceDir(resolvedConfig, sessionAgentId);

4446

const workspaceDir = resolveWorkspaceRoot(options?.workspaceDir ?? inferredWorkspaceDir);

47+

const modelProvider = options?.modelProvider?.trim();

48+

const modelId = options?.modelId?.trim();

49+

const activeModel =

50+

modelProvider || modelId

51+

? {

52+

...(modelProvider ? { provider: modelProvider } : {}),

53+

...(modelId ? { modelId } : {}),

54+

...(modelProvider && modelId ? { modelRef: `${modelProvider}/${modelId}` } : {}),

55+

}

56+

: undefined;

4557

const deliveryContext = normalizeDeliveryContext({

4658

channel: options?.agentChannel,

4759

to: options?.agentTo,

@@ -60,6 +72,7 @@ export function resolveOpenClawPluginToolInputs(params: {

6072

agentId: sessionAgentId,

6173

sessionKey: options?.agentSessionKey,

6274

sessionId: options?.sessionId,

75+

activeModel,

6376

browser: {

6477

sandboxBridgeUrl: options?.sandboxBrowserBridgeUrl,

6578

allowHostControl: options?.allowHostBrowserControl,

Original file line numberDiff line numberDiff line change

@@ -121,7 +121,11 @@ export type {

121121

UnifiedModelCatalogSource,

122122

} from "../model-catalog/types.js";

123123

export type { ProviderRuntimeModel } from "../plugins/provider-runtime-model.types.js";

124-

export type { OpenClawPluginToolContext, OpenClawPluginToolFactory } from "../plugins/types.js";

124+

export type {

125+

OpenClawPluginActiveModelContext,

126+

OpenClawPluginToolContext,

127+

OpenClawPluginToolFactory,

128+

} from "../plugins/types.js";

125129

export type {

126130

MemoryPluginCapability,

127131

MemoryPluginPublicArtifact,

Original file line numberDiff line numberDiff line change

@@ -4,6 +4,12 @@ import type { OpenClawConfig } from "../config/types.openclaw.js";

44

import type { HookEntry } from "../hooks/types.js";

55

import type { DeliveryContext } from "../utils/delivery-context.types.js";

66
7+

export type OpenClawPluginActiveModelContext = {

8+

provider?: string;

9+

modelId?: string;

10+

modelRef?: string;

11+

};

12+
713

/** Trusted execution context passed to plugin-owned agent tool factories. */

814

export type OpenClawPluginToolContext = {

915

config?: OpenClawConfig;

@@ -19,6 +25,12 @@ export type OpenClawPluginToolContext = {

1925

sessionKey?: string;

2026

/** Ephemeral session UUID - regenerated on /new and /reset. Use for per-conversation isolation. */

2127

sessionId?: string;

28+

/**

29+

* Runtime-supplied active model metadata for informational use, diagnostics,

30+

* and plugin-owned policy decisions. This is not a security boundary against

31+

* the local operator, installed plugin code, or a modified OpenClaw runtime.

32+

*/

33+

activeModel?: OpenClawPluginActiveModelContext;

2234

browser?: {

2335

sandboxBridgeUrl?: string;

2436

allowHostControl?: boolean;

Original file line numberDiff line numberDiff line change

@@ -151,6 +151,7 @@ export type {

151151

PluginFormat,

152152

} from "./manifest-types.js";

153153

export type {

154+

OpenClawPluginActiveModelContext,

154155

OpenClawPluginHookOptions,

155156

OpenClawPluginToolContext,

156157

OpenClawPluginToolFactory,