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

推荐订阅源

D
Docker
Apple Machine Learning Research
Apple Machine Learning Research
宝玉的分享
宝玉的分享
博客园 - 叶小钗
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 司徒正美
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - Franky
爱范儿
爱范儿
罗磊的独立博客
IT之家
IT之家
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
N
Netflix TechBlog - Medium
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
U
Unit 42
Engineering at Meta
Engineering at Meta
WordPress大学
WordPress大学
博客园 - 三生石上(FineUI控件)
T
Tailwind CSS Blog
H
Help Net Security
博客园_首页
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
人人都是产品经理
人人都是产品经理

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: derive plugin media trust from metadata (#86410) · o...
steipete · 2026-05-25 · via Recent Commits to openclaw:main

@@ -124,6 +124,7 @@ import {

124124

} from "../../pi-embedded-helpers.js";

125125

import { countActiveToolExecutions } from "../../pi-embedded-subscribe.handlers.tools.js";

126126

import { subscribeEmbeddedPiSession } from "../../pi-embedded-subscribe.js";

127+

import { isCoreToolResultMediaTrustedName } from "../../pi-embedded-subscribe.tools.js";

127128

import { createPreparedEmbeddedPiSettingsManager } from "../../pi-project-settings.js";

128129

import {

129130

applyPiAutoCompactionGuard,

@@ -448,6 +449,35 @@ export {

448449

resolveEmbeddedAgentStreamFn,

449450

};

450451452+

function collectTrustedPluginLocalMediaToolNames(params: {

453+

tools: Array<{ name?: string }>;

454+

}): Set<string> {

455+

const trusted = new Set<string>();

456+

for (const tool of params.tools) {

457+

const toolName = tool.name?.trim();

458+

if (!toolName) {

459+

continue;

460+

}

461+

const meta = getPluginToolMeta(tool as Parameters<typeof getPluginToolMeta>[0]);

462+

if (meta?.trustedLocalMedia === true) {

463+

trusted.add(toolName);

464+

}

465+

}

466+

return trusted;

467+

}

468+469+

function collectTrustedLocalMediaToolNames(params: {

470+

coreBuiltinToolNames: ReadonlySet<string>;

471+

trustedPluginToolNames: ReadonlySet<string>;

472+

}): Set<string> {

473+

return new Set([

474+

...[...params.coreBuiltinToolNames].filter((toolName) =>

475+

isCoreToolResultMediaTrustedName(toolName),

476+

),

477+

...params.trustedPluginToolNames,

478+

]);

479+

}

480+451481

const MAX_BTW_SNAPSHOT_MESSAGES = 100;

452482

const TOOL_SEARCH_CONTROL_ALLOWLIST_NAMES = [

453483

TOOL_SEARCH_CODE_MODE_TOOL_NAME,

@@ -1651,6 +1681,11 @@ export async function runEmbeddedAttempt(

16511681

modelApi: params.model.api,

16521682

model: params.model,

16531683

};

1684+

const pluginMetadataSnapshot = getCurrentPluginMetadataSnapshot({

1685+

config: params.config,

1686+

env: process.env,

1687+

workspaceDir: effectiveWorkspace,

1688+

});

16541689

const tools = normalizeAgentRuntimeTools({

16551690

runtimePlan: params.runtimePlan,

16561691

tools: toolsEnabled ? toolsRaw : [],

@@ -1721,6 +1756,9 @@ export async function runEmbeddedAttempt(

17211756

senderE164: params.senderE164,

17221757

warn: (message) => log.warn(message),

17231758

});

1759+

const trustedPluginLocalMediaToolNames = collectTrustedPluginLocalMediaToolNames({

1760+

tools: toolsEnabled ? [...toolsRaw, ...filteredBundledTools] : [],

1761+

});

17241762

const normalizedBundledTools =

17251763

filteredBundledTools.length > 0

17261764

? normalizeAgentRuntimeTools({

@@ -2202,11 +2240,7 @@ export async function runEmbeddedAttempt(

22022240

cwd: effectiveWorkspace,

22032241

agentDir,

22042242

cfg: params.config,

2205-

pluginMetadataSnapshot: getCurrentPluginMetadataSnapshot({

2206-

config: params.config,

2207-

env: process.env,

2208-

workspaceDir: effectiveWorkspace,

2209-

}),

2243+

pluginMetadataSnapshot,

22102244

contextTokenBudget: params.contextTokenBudget,

22112245

});

22122246

const piAutoCompactionGuardArgs = {

@@ -2285,10 +2319,8 @@ export async function runEmbeddedAttempt(

22852319

cfg: params.config,

22862320

agentId: sessionAgentId,

22872321

});

2288-

// Exact raw names of every tool registered for this run, including

2289-

// bundled/plugin tools. Used as the raw-name set for the trusted local

2290-

// MEDIA: passthrough gate: a normalized alias is not sufficient — the

2291-

// emitted tool name must match an exact registration of this run.

2322+

// Exact raw names of every tool registered for this run. This remains

2323+

// available for diagnostics; local MEDIA: trust is narrower below.

22922324

const builtinToolNames = new Set(

22932325

uncompactedEffectiveTools.flatMap((tool) => {

22942326

const name = (tool.name ?? "").trim();

@@ -2304,6 +2336,10 @@ export async function runEmbeddedAttempt(

23042336

isPluginTool: (tool) =>

23052337

Boolean(getPluginToolMeta(tool as Parameters<typeof getPluginToolMeta>[0])),

23062338

});

2339+

const trustedLocalMediaToolNames = collectTrustedLocalMediaToolNames({

2340+

coreBuiltinToolNames,

2341+

trustedPluginToolNames: trustedPluginLocalMediaToolNames,

2342+

});

23072343

const clientToolNameConflicts = findClientToolNameConflicts({

23082344

tools: clientTools ?? [],

23092345

existingToolNames: [...coreBuiltinToolNames, ...PI_RESERVED_TOOL_NAMES],

@@ -3303,6 +3339,7 @@ export async function runEmbeddedAttempt(

33033339

sessionId: params.sessionId,

33043340

agentId: sessionAgentId,

33053341

builtinToolNames,

3342+

trustedLocalMediaToolNames,

33063343

internalEvents: params.internalEvents,

33073344

}),

33083345

);