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

推荐订阅源

Blog — PlanetScale
Blog — PlanetScale
Vercel News
Vercel News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
量子位
Y
Y Combinator Blog
IT之家
IT之家
博客园 - 聂微东
L
LangChain Blog
爱范儿
爱范儿
H
Help Net Security
GbyAI
GbyAI
F
Fortinet All Blogs
B
Blog
Microsoft Security Blog
Microsoft Security Blog
罗磊的独立博客
C
Check Point Blog
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
D
DataBreaches.Net
Last Week in AI
Last Week in AI
WordPress大学
WordPress大学
B
Blog RSS Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
宝玉的分享
宝玉的分享

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(subagents): explain browser tool profile filtering · ...
steipete · 2026-04-26 · via Recent Commits to openclaw:main

@@ -12,7 +12,9 @@ import { createOpenClawCodingTools } from "./pi-tools.js";

1212

import { resolveEffectiveToolPolicy } from "./pi-tools.policy.js";

1313

import { summarizeToolDescriptionText } from "./tool-description-summary.js";

1414

import { resolveToolDisplay } from "./tool-display.js";

15+

import { normalizeToolName } from "./tool-policy.js";

1516

import type {

17+

EffectiveToolInventoryNotice,

1618

EffectiveToolInventoryEntry,

1719

EffectiveToolInventoryGroup,

1820

EffectiveToolInventoryResult,

@@ -70,6 +72,82 @@ function groupLabel(source: EffectiveToolSource): string {

7072

}

7173

}

727475+

function listIncludesTool(list: string[] | undefined, toolName: string): boolean {

76+

if (!Array.isArray(list)) {

77+

return false;

78+

}

79+

const normalizedToolName = normalizeToolName(toolName);

80+

return list.some((entry) => normalizeToolName(entry) === normalizedToolName);

81+

}

82+83+

function policyDeniesTool(policy: { deny?: string[] } | undefined, toolName: string): boolean {

84+

return (

85+

listIncludesTool(policy?.deny, toolName) ||

86+

listIncludesTool(policy?.deny, "group:ui") ||

87+

listIncludesTool(policy?.deny, "group:openclaw")

88+

);

89+

}

90+91+

function hasExplicitBrowserIntent(cfg: OpenClawConfig): boolean {

92+

return cfg.browser?.enabled !== false && Boolean(cfg.browser || cfg.plugins?.entries?.browser);

93+

}

94+95+

function buildToolInventoryNotices(params: {

96+

cfg: OpenClawConfig;

97+

profile: string;

98+

entries: EffectiveToolInventoryEntry[];

99+

effectivePolicy: ReturnType<typeof resolveEffectiveToolPolicy>;

100+

}): EffectiveToolInventoryNotice[] | undefined {

101+

const hasBrowserTool = params.entries.some((entry) => normalizeToolName(entry.id) === "browser");

102+

if (hasBrowserTool || !hasExplicitBrowserIntent(params.cfg)) {

103+

return undefined;

104+

}

105+106+

const browserDenied = [

107+

params.effectivePolicy.globalPolicy,

108+

params.effectivePolicy.globalProviderPolicy,

109+

params.effectivePolicy.agentPolicy,

110+

params.effectivePolicy.agentProviderPolicy,

111+

].some((policy) => policyDeniesTool(policy, "browser"));

112+

if (browserDenied) {

113+

return [

114+

{

115+

id: "browser-denied-by-policy",

116+

severity: "info",

117+

message:

118+

"Browser is configured, but this session does not expose the browser tool because tool policy denies it. Remove the browser deny entry to use browser automation.",

119+

},

120+

];

121+

}

122+123+

if (params.profile !== "full") {

124+

return [

125+

{

126+

id: "browser-filtered-by-profile",

127+

severity: "info",

128+

message:

129+

'Browser is configured, but the current tool profile does not include the browser tool. Add tools.alsoAllow: ["browser"] or agents.list[].tools.alsoAllow: ["browser"]; tools.subagents.tools.allow alone cannot add it back after profile filtering.',

130+

},

131+

];

132+

}

133+134+

if (

135+

Array.isArray(params.cfg.plugins?.allow) &&

136+

!listIncludesTool(params.cfg.plugins.allow, "browser")

137+

) {

138+

return [

139+

{

140+

id: "browser-plugin-not-allowed",

141+

severity: "warning",

142+

message:

143+

'Browser is configured, but plugins.allow does not include browser. Add "browser" to plugins.allow or remove the restrictive plugin allowlist.',

144+

},

145+

];

146+

}

147+148+

return undefined;

149+

}

150+73151

function disambiguateLabels(entries: EffectiveToolInventoryEntry[]): EffectiveToolInventoryEntry[] {

74152

const counts = new Map<string, number>();

75153

for (const entry of entries) {

@@ -170,6 +248,7 @@ export function resolveEffectiveToolInventory(

170248

})

171249

.toSorted((a, b) => a.label.localeCompare(b.label)),

172250

);

251+

const notices = buildToolInventoryNotices({ cfg: params.cfg, profile, entries, effectivePolicy });

173252

const groupsBySource = new Map<EffectiveToolSource, EffectiveToolInventoryEntry[]>();

174253

for (const entry of entries) {

175254

const tools = groupsBySource.get(entry.source) ?? [];

@@ -192,5 +271,5 @@ export function resolveEffectiveToolInventory(

192271

})

193272

.filter((group): group is EffectiveToolInventoryGroup => group !== null);

194273195-

return { agentId, profile, groups };

274+

return { agentId, profile, groups, ...(notices ? { notices } : {}) };

196275

}