mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-12 11:21:11 +00:00
fix(agents): remove synthetic done fallback reply
This commit is contained in:
@@ -4,7 +4,6 @@ import type { ReasoningLevel, VerboseLevel } from "../../../auto-reply/thinking.
|
||||
import { isSilentReplyText, SILENT_REPLY_TOKEN } from "../../../auto-reply/tokens.js";
|
||||
import { formatToolAggregate } from "../../../auto-reply/tool-meta.js";
|
||||
import type { OpenClawConfig } from "../../../config/config.js";
|
||||
import { deriveSessionChatType } from "../../../sessions/session-key-utils.js";
|
||||
import {
|
||||
BILLING_ERROR_USER_MESSAGE,
|
||||
formatAssistantErrorText,
|
||||
@@ -310,7 +309,7 @@ export function buildEmbeddedRunPayloads(params: {
|
||||
}
|
||||
|
||||
const hasAudioAsVoiceTag = replyItems.some((item) => item.audioAsVoice);
|
||||
const payloads = replyItems
|
||||
return replyItems
|
||||
.map((item) => ({
|
||||
text: item.text?.trim() ? item.text.trim() : undefined,
|
||||
mediaUrls: item.media?.length ? item.media : undefined,
|
||||
@@ -330,18 +329,4 @@ export function buildEmbeddedRunPayloads(params: {
|
||||
}
|
||||
return true;
|
||||
});
|
||||
if (
|
||||
payloads.length === 0 &&
|
||||
params.toolMetas.length > 0 &&
|
||||
!params.lastToolError &&
|
||||
!lastAssistantErrored &&
|
||||
!params.didSendViaMessagingTool
|
||||
) {
|
||||
const sessionChatType = deriveSessionChatType(params.sessionKey);
|
||||
if (sessionChatType === "channel" || sessionChatType === "group") {
|
||||
return [];
|
||||
}
|
||||
return [{ text: "✅ Done." }];
|
||||
}
|
||||
return payloads;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user