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

推荐订阅源

Stack Overflow Blog
Stack Overflow Blog
L
LangChain Blog
人人都是产品经理
人人都是产品经理
酷 壳 – CoolShell
酷 壳 – CoolShell
T
Tailwind CSS Blog
N
Netflix TechBlog - Medium
Microsoft Security Blog
Microsoft Security Blog
J
Java Code Geeks
博客园 - 【当耐特】
量子位
有赞技术团队
有赞技术团队
Jina AI
Jina AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园_首页
C
Check Point Blog
B
Blog RSS Feed
M
MIT News - Artificial intelligence
H
Help Net Security
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 聂微东
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
A
About on SuperTechFans
腾讯CDC

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(approvals): release Matrix reaction target on mid-fli...
Feelw00 · 2026-05-16 · via Recent Commits to openclaw:main

@@ -389,11 +389,11 @@ describe("createLazyChannelApprovalNativeRuntimeAdapter", () => {

389389

const request = makeExecApprovalRequest("exec:in-flight");

390390391391

const inflight = approvalRuntime.handleRequested(request);

392-

// microtasks 흘려 deliverPending 완료 + bindPending await 진입.

392+

// Flush microtasks so deliverPending resolves and bindPending parks at the gate.

393393

await new Promise((r) => setTimeout(r, 0));

394394

await new Promise((r) => setTimeout(r, 0));

395395396-

// stop() — onStopped 가 stopped flag set. bindPending 은 park.

396+

// stop() flips the stopped flag while bindPending is parked.

397397

await approvalRuntime.stop();

398398

bindGate.resolve();

399399

await inflight;

@@ -406,4 +406,96 @@ describe("createLazyChannelApprovalNativeRuntimeAdapter", () => {

406406

expect(unbind?.binding).toEqual({ bindingId: "bound-in-flight" });

407407

expect(unbind?.request).toBe(request);

408408

});

409+410+

it("invokes cancelDelivered when stop() fires between deliverPending and bindPending", async () => {

411+

const deliverGate = { resolve: () => {}, promise: Promise.resolve() };

412+

const deliverPromise = new Promise<void>((resolve) => {

413+

deliverGate.resolve = resolve;

414+

});

415+

deliverGate.promise = deliverPromise;

416+

const deliveredEntry = { messageId: "pre-bind" };

417+

const deliverPending = vi.fn(async () => {

418+

await deliverPromise;

419+

return deliveredEntry;

420+

});

421+

const bindPending = vi.fn().mockResolvedValue({ bindingId: "should-not-bind" });

422+

const unbindPending = vi.fn();

423+

const cancelDelivered = vi.fn();

424+425+

const runtime = await createTestApprovalHandler(

426+

makeNativeApprovalCapability({

427+

deliverPending,

428+

bindPending,

429+

unbindPending,

430+

cancelDelivered,

431+

}),

432+

);

433+

const approvalRuntime = expectApprovalRuntime(runtime);

434+

const request = makeExecApprovalRequest("exec:pre-bind");

435+436+

const inflight = approvalRuntime.handleRequested(request);

437+

// Flush microtasks so deliverPending is awaited and parked at the gate.

438+

await new Promise((r) => setTimeout(r, 0));

439+

await new Promise((r) => setTimeout(r, 0));

440+441+

// stop() flips the stopped flag while deliverPending is still pending.

442+

await approvalRuntime.stop();

443+

deliverGate.resolve();

444+

await inflight;

445+446+

expect(bindPending).not.toHaveBeenCalled();

447+

expect(unbindPending).not.toHaveBeenCalled();

448+

expect(cancelDelivered).toHaveBeenCalledTimes(1);

449+

const cancel = firstCallArg(cancelDelivered) as

450+

| { entry?: unknown; request?: unknown; approvalKind?: string }

451+

| undefined;

452+

expect(cancel?.entry).toBe(deliveredEntry);

453+

expect(cancel?.request).toBe(request);

454+

expect(cancel?.approvalKind).toBe("exec");

455+

});

456+457+

it("invokes cancelDelivered when stop() fires after bindPending returned null", async () => {

458+

const bindGate = { resolve: () => {}, promise: Promise.resolve() };

459+

const bindPromise = new Promise<void>((resolve) => {

460+

bindGate.resolve = resolve;

461+

});

462+

bindGate.promise = bindPromise;

463+

const deliveredEntry = { messageId: "post-bind-null" };

464+

const deliverPending = vi.fn().mockResolvedValue(deliveredEntry);

465+

const bindPending = vi.fn(async () => {

466+

await bindPromise;

467+

return null;

468+

});

469+

const unbindPending = vi.fn();

470+

const cancelDelivered = vi.fn();

471+472+

const runtime = await createTestApprovalHandler(

473+

makeNativeApprovalCapability({

474+

deliverPending,

475+

bindPending,

476+

unbindPending,

477+

cancelDelivered,

478+

}),

479+

);

480+

const approvalRuntime = expectApprovalRuntime(runtime);

481+

const request = makeExecApprovalRequest("exec:post-bind-null");

482+483+

const inflight = approvalRuntime.handleRequested(request);

484+

// Flush microtasks so deliverPending resolves and bindPending awaits the gate.

485+

await new Promise((r) => setTimeout(r, 0));

486+

await new Promise((r) => setTimeout(r, 0));

487+488+

// stop() flips the stopped flag while bindPending is parked; it then resolves to null.

489+

await approvalRuntime.stop();

490+

bindGate.resolve();

491+

await inflight;

492+493+

expect(unbindPending).not.toHaveBeenCalled();

494+

expect(cancelDelivered).toHaveBeenCalledTimes(1);

495+

const cancel = firstCallArg(cancelDelivered) as

496+

| { entry?: unknown; request?: unknown }

497+

| undefined;

498+

expect(cancel?.entry).toBe(deliveredEntry);

499+

expect(cancel?.request).toBe(request);

500+

});

409501

});