mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 14:58:26 +00:00
fix: preserve inter-session input provenance (thanks @anbecker)
This commit is contained in:
@@ -24,6 +24,9 @@ export async function runAgentStep(params: {
|
||||
timeoutMs: number;
|
||||
channel?: string;
|
||||
lane?: string;
|
||||
sourceSessionKey?: string;
|
||||
sourceChannel?: string;
|
||||
sourceTool?: string;
|
||||
}): Promise<string | undefined> {
|
||||
const stepIdem = crypto.randomUUID();
|
||||
const response = await callGateway<{ runId?: string }>({
|
||||
@@ -36,6 +39,12 @@ export async function runAgentStep(params: {
|
||||
channel: params.channel ?? INTERNAL_MESSAGE_CHANNEL,
|
||||
lane: params.lane ?? AGENT_LANE_NESTED,
|
||||
extraSystemPrompt: params.extraSystemPrompt,
|
||||
inputProvenance: {
|
||||
kind: "inter_session",
|
||||
sourceSessionKey: params.sourceSessionKey,
|
||||
sourceChannel: params.sourceChannel,
|
||||
sourceTool: params.sourceTool ?? "sessions_send",
|
||||
},
|
||||
},
|
||||
timeoutMs: 10_000,
|
||||
});
|
||||
|
||||
@@ -83,6 +83,10 @@ export async function runSessionsSendA2AFlow(params: {
|
||||
extraSystemPrompt: replyPrompt,
|
||||
timeoutMs: params.announceTimeoutMs,
|
||||
lane: AGENT_LANE_NESTED,
|
||||
sourceSessionKey: nextSessionKey,
|
||||
sourceChannel:
|
||||
nextSessionKey === params.requesterSessionKey ? params.requesterChannel : targetChannel,
|
||||
sourceTool: "sessions_send",
|
||||
});
|
||||
if (!replyText || isReplySkip(replyText)) {
|
||||
break;
|
||||
@@ -110,6 +114,9 @@ export async function runSessionsSendA2AFlow(params: {
|
||||
extraSystemPrompt: announcePrompt,
|
||||
timeoutMs: params.announceTimeoutMs,
|
||||
lane: AGENT_LANE_NESTED,
|
||||
sourceSessionKey: params.requesterSessionKey,
|
||||
sourceChannel: params.requesterChannel,
|
||||
sourceTool: "sessions_send",
|
||||
});
|
||||
if (announceTarget && announceReply && announceReply.trim() && !isAnnounceSkip(announceReply)) {
|
||||
try {
|
||||
|
||||
@@ -260,6 +260,12 @@ export function createSessionsSendTool(opts?: {
|
||||
channel: INTERNAL_MESSAGE_CHANNEL,
|
||||
lane: AGENT_LANE_NESTED,
|
||||
extraSystemPrompt: agentMessageContext,
|
||||
inputProvenance: {
|
||||
kind: "inter_session",
|
||||
sourceSessionKey: opts?.agentSessionKey,
|
||||
sourceChannel: opts?.agentChannel,
|
||||
sourceTool: "sessions_send",
|
||||
},
|
||||
};
|
||||
const requesterSessionKey = opts?.agentSessionKey;
|
||||
const requesterChannel = opts?.agentChannel;
|
||||
|
||||
Reference in New Issue
Block a user