mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 16:20:43 +00:00
fix(voice): reuse preflight transcripts across channels
This commit is contained in:
@@ -1512,6 +1512,7 @@ describe("handleFeishuMessage command authorization", () => {
|
||||
Transcript: "voice transcript",
|
||||
MediaPaths: ["/tmp/inbound-voice.ogg"],
|
||||
MediaTypes: ["audio/ogg"],
|
||||
MediaTranscribedIndexes: [0],
|
||||
}),
|
||||
);
|
||||
const finalized = mockFinalizeInboundContext.mock.calls[0]?.[0];
|
||||
|
||||
@@ -759,6 +759,10 @@ export async function handleFeishuMessage(params: {
|
||||
chatType: isGroup ? "group" : "direct",
|
||||
log,
|
||||
});
|
||||
const preflightAudioIndex =
|
||||
audioTranscript === undefined
|
||||
? -1
|
||||
: mediaList.findIndex((media) => media.contentType?.startsWith("audio/"));
|
||||
const agentFacingContent = audioTranscript ?? ctx.content;
|
||||
const agentFacingCtx =
|
||||
audioTranscript === undefined
|
||||
@@ -1078,6 +1082,7 @@ export async function handleFeishuMessage(params: {
|
||||
OriginatingTo: feishuTo,
|
||||
GroupSystemPrompt: isGroup ? normalizeOptionalString(groupConfig?.systemPrompt) : undefined,
|
||||
...mediaPayload,
|
||||
...(preflightAudioIndex >= 0 ? { MediaTranscribedIndexes: [preflightAudioIndex] } : {}),
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user