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

推荐订阅源

腾讯CDC
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog
S
SegmentFault 最新的问题
WordPress大学
WordPress大学
P
Proofpoint News Feed
Hugging Face - Blog
Hugging Face - Blog
MyScale Blog
MyScale Blog
A
About on SuperTechFans
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
The Blog of Author Tim Ferriss
MongoDB | Blog
MongoDB | Blog
博客园 - 【当耐特】
The Cloudflare Blog
F
Fortinet All Blogs
小众软件
小众软件
博客园 - 三生石上(FineUI控件)
宝玉的分享
宝玉的分享
罗磊的独立博客
量子位
有赞技术团队
有赞技术团队
V
V2EX
Engineering at Meta
Engineering at Meta

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: stabilize Matrix tool progress QA (#78179) · opencla...
Patrick-Eric · 2026-05-06 · via Recent Commits to openclaw:main

@@ -1,3 +1,4 @@

1+

import { setTimeout as sleep } from "node:timers/promises";

12

import type {

23

ChannelApprovalCapabilityHandlerContext,

34

PendingApprovalView,

@@ -123,6 +124,9 @@ type MatrixPrepareTargetParams = {

123124

rawTarget: MatrixRawApprovalTarget;

124125

};

125126127+

const MATRIX_APPROVAL_DELIVERY_ATTEMPTS = 3;

128+

const MATRIX_APPROVAL_DELIVERY_RETRY_DELAY_MS = 250;

129+126130

export type MatrixApprovalHandlerDeps = {

127131

nowMs?: () => number;

128132

sendMessage?: typeof sendMessageMatrix;

@@ -176,6 +180,25 @@ function isSingleMatrixMessageLimitError(error: unknown): boolean {

176180

);

177181

}

178182183+

async function retryMatrixApprovalDelivery<T>(

184+

operation: () => Promise<T>,

185+

params: { shouldRetry?: (error: unknown) => boolean } = {},

186+

): Promise<T> {

187+

let lastError: unknown;

188+

for (let attempt = 1; attempt <= MATRIX_APPROVAL_DELIVERY_ATTEMPTS; attempt += 1) {

189+

try {

190+

return await operation();

191+

} catch (error) {

192+

lastError = error;

193+

if (attempt === MATRIX_APPROVAL_DELIVERY_ATTEMPTS || params.shouldRetry?.(error) === false) {

194+

break;

195+

}

196+

await sleep(MATRIX_APPROVAL_DELIVERY_RETRY_DELAY_MS * attempt);

197+

}

198+

}

199+

throw lastError;

200+

}

201+179202

async function prepareTarget(

180203

params: MatrixPrepareTargetParams,

181204

): Promise<PreparedMatrixTarget | null> {

@@ -194,11 +217,14 @@ async function prepareTarget(

194217

accountId: resolved.accountId,

195218

});

196219

const repairDirectRooms = resolved.context.deps?.repairDirectRooms ?? repairMatrixDirectRooms;

197-

const repaired = await repairDirectRooms({

198-

client: resolved.context.client,

199-

remoteUserId: target.id,

200-

encrypted: account.config.encryption === true,

201-

});

220+

const repaired = await retryMatrixApprovalDelivery(

221+

async () =>

222+

await repairDirectRooms({

223+

client: resolved.context.client,

224+

remoteUserId: target.id,

225+

encrypted: account.config.encryption === true,

226+

}),

227+

);

202228

if (!repaired.activeRoomId) {

203229

return null;

204230

}

@@ -424,25 +450,32 @@ export const matrixApprovalNativeRuntime = createChannelApprovalNativeRuntimeAda

424450

const reactMessage = resolved.context.deps?.reactMessage ?? reactMatrixMessage;

425451

let result;

426452

try {

427-

result = await sendSingleTextMessage(preparedTarget.to, pendingPayload.text, {

428-

cfg: cfg as CoreConfig,

429-

accountId: resolved.accountId,

430-

client: resolved.context.client,

431-

threadId: preparedTarget.threadId,

432-

extraContent: pendingPayload.extraContent,

433-

});

453+

result = await retryMatrixApprovalDelivery(

454+

async () =>

455+

await sendSingleTextMessage(preparedTarget.to, pendingPayload.text, {

456+

cfg: cfg as CoreConfig,

457+

accountId: resolved.accountId,

458+

client: resolved.context.client,

459+

threadId: preparedTarget.threadId,

460+

extraContent: pendingPayload.extraContent,

461+

}),

462+

{ shouldRetry: (error) => !isSingleMatrixMessageLimitError(error) },

463+

);

434464

} catch (error) {

435465

if (!isSingleMatrixMessageLimitError(error)) {

436466

throw error;

437467

}

438468

const sendMessage = resolved.context.deps?.sendMessage ?? sendMessageMatrix;

439-

result = await sendMessage(preparedTarget.to, pendingPayload.text, {

440-

cfg: cfg as CoreConfig,

441-

accountId: resolved.accountId,

442-

client: resolved.context.client,

443-

threadId: preparedTarget.threadId,

444-

extraContent: pendingPayload.extraContent,

445-

});

469+

result = await retryMatrixApprovalDelivery(

470+

async () =>

471+

await sendMessage(preparedTarget.to, pendingPayload.text, {

472+

cfg: cfg as CoreConfig,

473+

accountId: resolved.accountId,

474+

client: resolved.context.client,

475+

threadId: preparedTarget.threadId,

476+

extraContent: pendingPayload.extraContent,

477+

}),

478+

);

446479

}

447480

const receiptMessageIds = listMessageReceiptPlatformIds(result.receipt);

448481

const platformMessageIds = receiptMessageIds.length