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

推荐订阅源

F
Fortinet All Blogs
爱范儿
爱范儿
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog
WordPress大学
WordPress大学
Jina AI
Jina AI
GbyAI
GbyAI
aimingoo的专栏
aimingoo的专栏
N
Netflix TechBlog - Medium
腾讯CDC
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
阮一峰的网络日志
阮一峰的网络日志
The GitHub Blog
The GitHub Blog
V
Visual Studio Blog
Google DeepMind News
Google DeepMind News
月光博客
月光博客
博客园 - Franky
Y
Y Combinator Blog
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
Martin Fowler
Martin Fowler
雷峰网
雷峰网
小众软件
小众软件
H
Hackread – Cybersecurity News, Data Breaches, AI and 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
refactor: dedupe channel approval forwarding · openclaw/o...
vincentkoc · 2026-05-29 · via Recent Commits to openclaw:main
11

import {

2+

buildChannelApprovalExpiredText,

3+

buildChannelApprovalResolvedText,

24

createChannelApprovalNativeRuntimeAdapter,

3-

type ExpiredApprovalView,

45

type PendingApprovalView,

5-

type ResolvedApprovalView,

6+

resolvePreparedApprovalAccountId,

67

} from "openclaw/plugin-sdk/approval-handler-runtime";

78

import { buildChannelApprovalNativeTargetKey } from "openclaw/plugin-sdk/approval-native-runtime";

89

import { buildApprovalReactionPendingContent } from "openclaw/plugin-sdk/approval-reaction-runtime";

910

import type { ExecApprovalReplyDecision } from "openclaw/plugin-sdk/approval-reply-runtime";

1011

import {

11-

buildApprovalResolvedReplyPayload,

12-

buildPluginApprovalExpiredMessage,

13-

buildPluginApprovalResolvedMessage,

1412

type ExecApprovalRequest,

15-

type ExecApprovalResolved,

1613

type PluginApprovalRequest,

17-

type PluginApprovalResolved,

1814

} from "openclaw/plugin-sdk/approval-runtime";

1915

import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";

20-

import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";

2116

import {

2217

registerIMessageApprovalReactionTarget,

2318

unregisterIMessageApprovalReactionTarget,

@@ -30,7 +25,6 @@ import { normalizeIMessageHandle, parseIMessageTarget } from "./targets.js";

3025

const log = createSubsystemLogger("imessage/approvals");

31263227

type ApprovalRequest = ExecApprovalRequest | PluginApprovalRequest;

33-

type ApprovalResolved = ExecApprovalResolved | PluginApprovalResolved;

3428

type IMessagePendingDelivery = {

3529

text: string;

3630

allowedDecisions: readonly ExecApprovalReplyDecision[];

@@ -66,42 +60,6 @@ function buildPendingPayload(params: {

6660

};

6761

}

686269-

function buildResolvedText(params: {

70-

request: ApprovalRequest;

71-

resolved: ApprovalResolved;

72-

view: ResolvedApprovalView;

73-

}): string {

74-

if (params.view.approvalKind === "plugin") {

75-

return buildPluginApprovalResolvedMessage(params.resolved as PluginApprovalResolved);

76-

}

77-

const resolvedByText = params.resolved.resolvedBy

78-

? ` Resolved by ${params.resolved.resolvedBy}.`

79-

: "";

80-

const payload = buildApprovalResolvedReplyPayload({

81-

approvalId: params.request.id,

82-

approvalSlug: params.request.id.slice(0, 8),

83-

text: `✅ Exec approval ${params.resolved.decision}.${resolvedByText} ID: ${params.request.id}`,

84-

});

85-

return payload.text ?? "";

86-

}

87-88-

function buildExpiredText(params: { request: ApprovalRequest; view: ExpiredApprovalView }): string {

89-

if (params.view.approvalKind === "plugin") {

90-

return buildPluginApprovalExpiredMessage(params.request as PluginApprovalRequest);

91-

}

92-

return `⏱️ Exec approval expired. ID: ${params.request.id}`;

93-

}

94-95-

function resolvePreparedAccountId(params: {

96-

plannedAccountId?: string | null;

97-

contextAccountId?: string | null;

98-

}): string | undefined {

99-

return (

100-

normalizeOptionalString(params.plannedAccountId) ??

101-

normalizeOptionalString(params.contextAccountId)

102-

);

103-

}

104-10563

function buildConversationKeyForTarget(to: string): IMessageApprovalConversationKey | null {

10664

try {

10765

const parsed = parseIMessageTarget(to);

@@ -138,11 +96,11 @@ export const imessageApprovalNativeRuntime = createChannelApprovalNativeRuntimeA

13896

buildPendingPayload({ request, approvalKind, nowMs, view }),

13997

buildResolvedResult: ({ request, resolved, view }) => ({

14098

kind: "update",

141-

payload: { text: buildResolvedText({ request, resolved, view }) },

99+

payload: { text: buildChannelApprovalResolvedText({ request, resolved, view }) },

142100

}),

143101

buildExpiredResult: ({ request, view }) => ({

144102

kind: "update",

145-

payload: { text: buildExpiredText({ request, view }) },

103+

payload: { text: buildChannelApprovalExpiredText({ request, view }) },

146104

}),

147105

},

148106

transport: {

@@ -153,7 +111,7 @@ export const imessageApprovalNativeRuntime = createChannelApprovalNativeRuntimeA

153111

}

154112

const prepared: PreparedIMessageApprovalTarget = {

155113

to,

156-

accountId: resolvePreparedAccountId({

114+

accountId: resolvePreparedApprovalAccountId({

157115

plannedAccountId: (plannedTarget.target as { accountId?: string | null }).accountId,

158116

contextAccountId: accountId,

159117

}),