mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 05:47:39 +00:00
Embedded runner: suppress raw API error payloads (#919)
This commit is contained in:
committed by
Peter Steinberger
parent
c2a4f256c8
commit
2d54efe851
@@ -48,6 +48,10 @@ export function buildEmbeddedRunPayloads(params: {
|
||||
sessionKey: params.sessionKey,
|
||||
})
|
||||
: undefined;
|
||||
const rawErrorMessage =
|
||||
params.lastAssistant?.stopReason === "error"
|
||||
? params.lastAssistant.errorMessage?.trim() || undefined
|
||||
: undefined;
|
||||
if (errorText) replyItems.push({ text: errorText, isError: true });
|
||||
|
||||
const inlineToolResults =
|
||||
@@ -83,11 +87,13 @@ export function buildEmbeddedRunPayloads(params: {
|
||||
if (reasoningText) replyItems.push({ text: reasoningText });
|
||||
|
||||
const fallbackAnswerText = params.lastAssistant ? extractAssistantText(params.lastAssistant) : "";
|
||||
const answerTexts = params.assistantTexts.length
|
||||
? params.assistantTexts
|
||||
: fallbackAnswerText
|
||||
? [fallbackAnswerText]
|
||||
: [];
|
||||
const answerTexts = (
|
||||
params.assistantTexts.length
|
||||
? params.assistantTexts
|
||||
: fallbackAnswerText
|
||||
? [fallbackAnswerText]
|
||||
: []
|
||||
).filter((text) => (rawErrorMessage ? text.trim() !== rawErrorMessage : true));
|
||||
|
||||
for (const text of answerTexts) {
|
||||
const {
|
||||
|
||||
Reference in New Issue
Block a user