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

推荐订阅源

M
MIT News - Artificial intelligence
WordPress大学
WordPress大学
GbyAI
GbyAI
S
SegmentFault 最新的问题
量子位
爱范儿
爱范儿
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
MyScale Blog
MyScale Blog
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
aimingoo的专栏
aimingoo的专栏
V
Visual Studio Blog
U
Unit 42
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The Cloudflare Blog
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
J
Java Code Geeks
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
IT之家
IT之家
Martin Fowler
Martin Fowler
宝玉的分享
宝玉的分享
雷峰网
雷峰网

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(agents): report approval resolutions in bridge mode ·...
vincentkoc · 2026-05-27 · via Recent Commits to openclaw:main

@@ -360,6 +360,23 @@ function emitSkillUsedDiagnostic(params: {

360360

});

361361

}

362362363+

function notifyPluginApprovalResolution(

364+

approval: PluginApprovalRequest,

365+

resolution: PluginApprovalResolution,

366+

): void {

367+

const onResolution = approval.onResolution;

368+

if (typeof onResolution !== "function") {

369+

return;

370+

}

371+

try {

372+

void Promise.resolve(onResolution(resolution)).catch((err) => {

373+

log.warn(`plugin onResolution callback failed: ${String(err)}`);

374+

});

375+

} catch (err) {

376+

log.warn(`plugin onResolution callback failed: ${String(err)}`);

377+

}

378+

}

379+363380

async function requestPluginToolApproval(params: {

364381

approval: PluginApprovalRequest;

365382

toolName: string;

@@ -370,19 +387,6 @@ async function requestPluginToolApproval(params: {

370387

overrideParams?: unknown;

371388

}): Promise<HookOutcome> {

372389

const approval = params.approval;

373-

const safeOnResolution = (resolution: PluginApprovalResolution): void => {

374-

const onResolution = approval.onResolution;

375-

if (typeof onResolution !== "function") {

376-

return;

377-

}

378-

try {

379-

void Promise.resolve(onResolution(resolution)).catch((err) => {

380-

log.warn(`plugin onResolution callback failed: ${String(err)}`);

381-

});

382-

} catch (err) {

383-

log.warn(`plugin onResolution callback failed: ${String(err)}`);

384-

}

385-

};

386390

try {

387391

const requestResult: {

388392

id?: string;

@@ -412,7 +416,7 @@ async function requestPluginToolApproval(params: {

412416

);

413417

const id = requestResult?.id;

414418

if (!id) {

415-

safeOnResolution(PluginApprovalResolutions.CANCELLED);

419+

notifyPluginApprovalResolution(approval, PluginApprovalResolutions.CANCELLED);

416420

return {

417421

blocked: true,

418422

kind: "failure",

@@ -429,7 +433,7 @@ async function requestPluginToolApproval(params: {

429433

if (hasImmediateDecision) {

430434

decision = requestResult?.decision;

431435

if (decision === null) {

432-

safeOnResolution(PluginApprovalResolutions.CANCELLED);

436+

notifyPluginApprovalResolution(approval, PluginApprovalResolutions.CANCELLED);

433437

return {

434438

blocked: true,

435439

kind: "failure",

@@ -480,7 +484,7 @@ async function requestPluginToolApproval(params: {

480484

decision === PluginApprovalResolutions.DENY

481485

? decision

482486

: PluginApprovalResolutions.TIMEOUT;

483-

safeOnResolution(resolution);

487+

notifyPluginApprovalResolution(approval, resolution);

484488

if (

485489

decision === PluginApprovalResolutions.ALLOW_ONCE ||

486490

decision === PluginApprovalResolutions.ALLOW_ALWAYS

@@ -514,7 +518,7 @@ async function requestPluginToolApproval(params: {

514518

params: params.baseParams,

515519

};

516520

} catch (err) {

517-

safeOnResolution(PluginApprovalResolutions.CANCELLED);

521+

notifyPluginApprovalResolution(approval, PluginApprovalResolutions.CANCELLED);

518522

if (isAbortSignalCancellation(err, params.signal)) {

519523

log.warn(`plugin approval wait cancelled by run abort: ${String(err)}`);

520524

return {

@@ -803,6 +807,10 @@ export async function runBeforeToolCallHook(args: {

803807

}

804808

if (trustedPolicyResult?.requireApproval) {

805809

if (args.approvalMode === "report") {

810+

notifyPluginApprovalResolution(

811+

trustedPolicyResult.requireApproval,

812+

PluginApprovalResolutions.CANCELLED,

813+

);

806814

return {

807815

blocked: true,

808816

kind: "failure",

@@ -869,6 +877,10 @@ export async function runBeforeToolCallHook(args: {

869877870878

if (hookResult?.requireApproval) {

871879

if (args.approvalMode === "report") {

880+

notifyPluginApprovalResolution(

881+

hookResult.requireApproval,

882+

PluginApprovalResolutions.CANCELLED,

883+

);

872884

return {

873885

blocked: true,

874886

kind: "failure",