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

推荐订阅源

人人都是产品经理
人人都是产品经理
Apple Machine Learning Research
Apple Machine Learning Research
云风的 BLOG
云风的 BLOG
罗磊的独立博客
博客园 - 三生石上(FineUI控件)
量子位
GbyAI
GbyAI
腾讯CDC
T
Tailwind CSS Blog
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
D
Docker
G
Google Developers Blog
aimingoo的专栏
aimingoo的专栏
The GitHub Blog
The GitHub Blog
Microsoft Security Blog
Microsoft Security Blog
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
N
Netflix TechBlog - Medium
Jina AI
Jina AI
IT之家
IT之家
Y
Y Combinator Blog

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: use in-process subagent announce handoff · openclaw/...
steipete · 2026-05-13 · via Recent Commits to openclaw:main

@@ -31,6 +31,7 @@ import type { EmbeddedPiQueueMessageOutcome } from "./pi-embedded-runner/runs.js

3131

import {

3232

callGateway,

3333

createBoundDeliveryRouter,

34+

dispatchGatewayMethodInProcess,

3435

getGlobalHookRunner,

3536

isEmbeddedPiRunActive,

3637

getRuntimeConfig,

@@ -58,7 +59,7 @@ const MAX_TIMER_SAFE_TIMEOUT_MS = 2_147_000_000;

5859

const AGENT_MEDIATED_COMPLETION_TOOLS = new Set(["music_generate", "video_generate"]);

59606061

type SubagentAnnounceDeliveryDeps = {

61-

callGateway: typeof callGateway;

62+

dispatchGatewayMethodInProcess: typeof dispatchGatewayMethodInProcess;

6263

getRuntimeConfig: typeof getRuntimeConfig;

6364

getRequesterSessionActivity: (requesterSessionKey: string) => {

6465

sessionId?: string;

@@ -72,7 +73,7 @@ type SubagentAnnounceDeliveryDeps = {

7273

};

73747475

const defaultSubagentAnnounceDeliveryDeps: SubagentAnnounceDeliveryDeps = {

75-

callGateway,

76+

dispatchGatewayMethodInProcess,

7677

getRuntimeConfig,

7778

getRequesterSessionActivity: (requesterSessionKey: string) => {

7879

const sessionId =

@@ -101,6 +102,21 @@ async function resolveQueueEmbeddedPiMessageOutcome(

101102

);

102103

}

103104105+

async function runAnnounceAgentCall(params: {

106+

agentParams: Record<string, unknown>;

107+

expectFinal?: boolean;

108+

timeoutMs?: number;

109+

}): Promise<unknown> {

110+

return await subagentAnnounceDeliveryDeps.dispatchGatewayMethodInProcess(

111+

"agent",

112+

params.agentParams,

113+

{

114+

expectFinal: params.expectFinal,

115+

timeoutMs: params.timeoutMs,

116+

},

117+

);

118+

}

119+104120

function formatQueueWakeFailureError(

105121

fallback: string,

106122

outcome: EmbeddedPiQueueMessageOutcome,

@@ -638,6 +654,36 @@ async function sendSubagentAnnounceDirectly(params: {

638654

path: "none",

639655

};

640656

}

657+

const directAgentParams: Record<string, unknown> = {

658+

sessionKey: canonicalRequesterSessionKey,

659+

message: params.triggerMessage,

660+

deliver: shouldDeliverAgentFinal,

661+

bestEffortDeliver: params.bestEffortDeliver,

662+

internalEvents: params.internalEvents,

663+

channel: shouldDeliverAgentFinal ? deliveryTarget.channel : sessionOnlyOriginChannel,

664+

accountId: shouldDeliverAgentFinal

665+

? deliveryTarget.accountId

666+

: sessionOnlyOriginChannel

667+

? sessionOnlyOrigin?.accountId

668+

: undefined,

669+

to: shouldDeliverAgentFinal

670+

? deliveryTarget.to

671+

: sessionOnlyOriginChannel

672+

? sessionOnlyOrigin?.to

673+

: undefined,

674+

threadId: shouldDeliverAgentFinal

675+

? deliveryTarget.threadId

676+

: sessionOnlyOriginChannel

677+

? sessionOnlyOrigin?.threadId

678+

: undefined,

679+

inputProvenance: {

680+

kind: "inter_session",

681+

sourceSessionKey: params.sourceSessionKey,

682+

sourceChannel: params.sourceChannel ?? INTERNAL_MESSAGE_CHANNEL,

683+

sourceTool: params.sourceTool ?? "subagent_announce",

684+

},

685+

idempotencyKey: params.directIdempotencyKey,

686+

};

641687

let directAnnounceResponse: unknown;

642688

try {

643689

directAnnounceResponse = await runAnnounceDeliveryWithRetry({

@@ -646,38 +692,8 @@ async function sendSubagentAnnounceDirectly(params: {

646692

: "direct announce agent call",

647693

signal: params.signal,

648694

run: async () =>

649-

await subagentAnnounceDeliveryDeps.callGateway({

650-

method: "agent",

651-

params: {

652-

sessionKey: canonicalRequesterSessionKey,

653-

message: params.triggerMessage,

654-

deliver: shouldDeliverAgentFinal,

655-

bestEffortDeliver: params.bestEffortDeliver,

656-

internalEvents: params.internalEvents,

657-

channel: shouldDeliverAgentFinal ? deliveryTarget.channel : sessionOnlyOriginChannel,

658-

accountId: shouldDeliverAgentFinal

659-

? deliveryTarget.accountId

660-

: sessionOnlyOriginChannel

661-

? sessionOnlyOrigin?.accountId

662-

: undefined,

663-

to: shouldDeliverAgentFinal

664-

? deliveryTarget.to

665-

: sessionOnlyOriginChannel

666-

? sessionOnlyOrigin?.to

667-

: undefined,

668-

threadId: shouldDeliverAgentFinal

669-

? deliveryTarget.threadId

670-

: sessionOnlyOriginChannel

671-

? sessionOnlyOrigin?.threadId

672-

: undefined,

673-

inputProvenance: {

674-

kind: "inter_session",

675-

sourceSessionKey: params.sourceSessionKey,

676-

sourceChannel: params.sourceChannel ?? INTERNAL_MESSAGE_CHANNEL,

677-

sourceTool: params.sourceTool ?? "subagent_announce",

678-

},

679-

idempotencyKey: params.directIdempotencyKey,

680-

},

695+

await runAnnounceAgentCall({

696+

agentParams: directAgentParams,

681697

expectFinal: true,

682698

timeoutMs: announceTimeoutMs,

683699

}),

@@ -797,11 +813,30 @@ export async function deliverSubagentAnnouncement(params: {

797813

}

798814799815

export const __testing = {

800-

setDepsForTest(overrides?: Partial<SubagentAnnounceDeliveryDeps>) {

816+

setDepsForTest(

817+

overrides?: Partial<SubagentAnnounceDeliveryDeps> & {

818+

callGateway?: typeof callGateway;

819+

},

820+

) {

821+

const callGatewayOverride = overrides?.callGateway;

822+

const dispatchGatewayMethodInProcessOverride =

823+

overrides?.dispatchGatewayMethodInProcess ??

824+

(callGatewayOverride

825+

? ((async (method, agentParams, options) =>

826+

await callGatewayOverride({

827+

method,

828+

params: agentParams,

829+

expectFinal: options?.expectFinal,

830+

timeoutMs: options?.timeoutMs,

831+

})) satisfies typeof dispatchGatewayMethodInProcess)

832+

: undefined);

801833

subagentAnnounceDeliveryDeps = overrides

802834

? {

803835

...defaultSubagentAnnounceDeliveryDeps,

804836

...overrides,

837+

...(dispatchGatewayMethodInProcessOverride

838+

? { dispatchGatewayMethodInProcess: dispatchGatewayMethodInProcessOverride }

839+

: {}),

805840

}

806841

: defaultSubagentAnnounceDeliveryDeps;

807842

},