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

推荐订阅源

WordPress大学
WordPress大学
Stack Overflow Blog
Stack Overflow Blog
人人都是产品经理
人人都是产品经理
Y
Y Combinator Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
D
DataBreaches.Net
GbyAI
GbyAI
Microsoft Security Blog
Microsoft Security Blog
博客园_首页
大猫的无限游戏
大猫的无限游戏
Jina AI
Jina AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Engineering at Meta
Engineering at Meta
IT之家
IT之家
MongoDB | Blog
MongoDB | Blog
The GitHub Blog
The GitHub Blog
月光博客
月光博客
U
Unit 42
Hugging Face - Blog
Hugging Face - Blog
博客园 - 叶小钗
腾讯CDC
B
Blog RSS Feed
博客园 - Franky
爱范儿
爱范儿

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: reconcile subagent wait timeouts · openclaw/openclaw...
steipete · 2026-05-17 · via Recent Commits to openclaw:main

@@ -329,6 +329,177 @@ describe("subagent registry seam flow", () => {

329329

expect(run?.outcome).toBeUndefined();

330330

});

331331332+

it("keeps parent run active when agent.wait times out before child session settles", async () => {

333+

let waitAttempts = 0;

334+

let resolveSecondWait: (value: {

335+

status: "ok";

336+

startedAt: number;

337+

endedAt: number;

338+

}) => void = () => {};

339+

const secondWait = new Promise<{ status: "ok"; startedAt: number; endedAt: number }>(

340+

(resolve) => {

341+

resolveSecondWait = resolve;

342+

},

343+

);

344+

mocks.callGateway.mockImplementation(async (request: { method?: string }) => {

345+

if (request.method === "agent.wait") {

346+

waitAttempts += 1;

347+

if (waitAttempts === 1) {

348+

return { status: "timeout" };

349+

}

350+

return secondWait;

351+

}

352+

return {};

353+

});

354+

mocks.loadSessionStore.mockReturnValue({

355+

"agent:main:subagent:child": {

356+

sessionId: "sess-child",

357+

updatedAt: 1,

358+

status: "running",

359+

},

360+

});

361+362+

mod.registerSubagentRun({

363+

runId: "run-waiter-timeout",

364+

childSessionKey: "agent:main:subagent:child",

365+

requesterSessionKey: "agent:main:main",

366+

requesterDisplayKey: "main",

367+

task: "eventually complete",

368+

cleanup: "keep",

369+

});

370+371+

await waitForFast(() => {

372+

expect(waitAttempts).toBeGreaterThanOrEqual(1);

373+

});

374+

await waitForFast(() => {

375+

expect(waitAttempts).toBeGreaterThanOrEqual(2);

376+

});

377+

const activeRun = mod

378+

.listSubagentRunsForRequester("agent:main:main")

379+

.find((entry) => entry.runId === "run-waiter-timeout");

380+

expect(activeRun?.endedAt).toBeUndefined();

381+

expect(activeRun?.outcome).toBeUndefined();

382+383+

resolveSecondWait({

384+

status: "ok",

385+

startedAt: 111,

386+

endedAt: 222,

387+

});

388+

await waitForFast(() => {

389+

const completedRun = mod

390+

.listSubagentRunsForRequester("agent:main:main")

391+

.find((entry) => entry.runId === "run-waiter-timeout");

392+

expect(waitAttempts).toBeGreaterThanOrEqual(2);

393+

expect(completedRun?.endedAt).toBe(222);

394+

expectRecordFields(completedRun?.outcome, { status: "ok" }, "completed run outcome");

395+

});

396+

expect(mocks.runSubagentAnnounceFlow).toHaveBeenCalledTimes(1);

397+

});

398+399+

it("records terminal agent.wait timeouts even before session store timing is persisted", async () => {

400+

mocks.callGateway.mockImplementation(async (request: { method?: string }) => {

401+

if (request.method === "agent.wait") {

402+

return {

403+

status: "timeout",

404+

startedAt: 111,

405+

endedAt: 222,

406+

stopReason: "rpc",

407+

};

408+

}

409+

return {};

410+

});

411+

mocks.loadSessionStore.mockReturnValue({

412+

"agent:main:subagent:child": {

413+

sessionId: "sess-child",

414+

updatedAt: 1,

415+

status: "running",

416+

},

417+

});

418+419+

mod.registerSubagentRun({

420+

runId: "run-terminal-timeout",

421+

childSessionKey: "agent:main:subagent:child",

422+

requesterSessionKey: "agent:main:main",

423+

requesterDisplayKey: "main",

424+

task: "time out terminally",

425+

cleanup: "keep",

426+

});

427+428+

await waitForFast(() => {

429+

const run = mod

430+

.listSubagentRunsForRequester("agent:main:main")

431+

.find((entry) => entry.runId === "run-terminal-timeout");

432+

expect(run?.endedAt).toBe(222);

433+

expectRecordFields(run?.outcome, { status: "timeout" }, "terminal timeout outcome");

434+

});

435+

expect(mocks.runSubagentAnnounceFlow).toHaveBeenCalledTimes(1);

436+

});

437+438+

it("ignores stale terminal session-store rows from older child runs", async () => {

439+

let waitAttempts = 0;

440+

let resolveSecondWait: (value: {

441+

status: "ok";

442+

startedAt: number;

443+

endedAt: number;

444+

}) => void = () => {};

445+

const secondWait = new Promise<{ status: "ok"; startedAt: number; endedAt: number }>(

446+

(resolve) => {

447+

resolveSecondWait = resolve;

448+

},

449+

);

450+

mocks.callGateway.mockImplementation(async (request: { method?: string }) => {

451+

if (request.method === "agent.wait") {

452+

waitAttempts += 1;

453+

if (waitAttempts === 1) {

454+

return { status: "timeout" };

455+

}

456+

return secondWait;

457+

}

458+

return {};

459+

});

460+

const staleEndedAt = Date.parse("2026-03-24T11:59:00Z");

461+

mocks.loadSessionStore.mockReturnValue({

462+

"agent:main:subagent:child": {

463+

sessionId: "sess-child",

464+

updatedAt: staleEndedAt,

465+

status: "done",

466+

startedAt: staleEndedAt - 100,

467+

endedAt: staleEndedAt,

468+

},

469+

});

470+471+

mod.registerSubagentRun({

472+

runId: "run-reactivated-timeout",

473+

childSessionKey: "agent:main:subagent:child",

474+

requesterSessionKey: "agent:main:main",

475+

requesterDisplayKey: "main",

476+

task: "new run after stale terminal row",

477+

cleanup: "keep",

478+

});

479+480+

await waitForFast(() => {

481+

expect(waitAttempts).toBeGreaterThanOrEqual(2);

482+

});

483+

const activeRun = mod

484+

.listSubagentRunsForRequester("agent:main:main")

485+

.find((entry) => entry.runId === "run-reactivated-timeout");

486+

expect(activeRun?.endedAt).toBeUndefined();

487+

expect(activeRun?.outcome).toBeUndefined();

488+

expect(mocks.runSubagentAnnounceFlow).not.toHaveBeenCalled();

489+490+

resolveSecondWait({

491+

status: "ok",

492+

startedAt: Date.parse("2026-03-24T12:00:01Z"),

493+

endedAt: Date.parse("2026-03-24T12:00:02Z"),

494+

});

495+

await waitForFast(() => {

496+

const completedRun = mod

497+

.listSubagentRunsForRequester("agent:main:main")

498+

.find((entry) => entry.runId === "run-reactivated-timeout");

499+

expectRecordFields(completedRun?.outcome, { status: "ok" }, "reactivated run outcome");

500+

});

501+

});

502+332503

it("keeps sessions_yield-ended subagent runs paused instead of announcing no output", async () => {

333504

mocks.callGateway.mockImplementation(async (request: { method?: string }) => {

334505

if (request.method === "agent.wait") {

@@ -397,6 +568,7 @@ describe("subagent registry seam flow", () => {

397568

},

398569

});

399570571+

vi.setSystemTime(persistedStartedAt - 1);

400572

mod.registerSubagentRun({

401573

runId: "run-stale-terminal",

402574

childSessionKey: "agent:main:subagent:child",