mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 11:51:23 +00:00
Agents: surface tool failures without assistant output
This commit is contained in:
@@ -23,6 +23,7 @@ export function buildEmbeddedRunPayloads(params: {
|
||||
assistantTexts: string[];
|
||||
toolMetas: ToolMetaEntry[];
|
||||
lastAssistant: AssistantMessage | undefined;
|
||||
lastToolError?: { toolName: string; meta?: string; error?: string };
|
||||
config?: ClawdbotConfig;
|
||||
sessionKey: string;
|
||||
verboseLevel?: VerboseLevel;
|
||||
@@ -155,6 +156,19 @@ export function buildEmbeddedRunPayloads(params: {
|
||||
});
|
||||
}
|
||||
|
||||
if (replyItems.length === 0 && params.lastToolError) {
|
||||
const toolSummary = formatToolAggregate(
|
||||
params.lastToolError.toolName,
|
||||
params.lastToolError.meta ? [params.lastToolError.meta] : undefined,
|
||||
{ markdown: useMarkdown },
|
||||
);
|
||||
const errorSuffix = params.lastToolError.error ? `: ${params.lastToolError.error}` : "";
|
||||
replyItems.push({
|
||||
text: `⚠️ ${toolSummary} failed${errorSuffix}`,
|
||||
isError: true,
|
||||
});
|
||||
}
|
||||
|
||||
const hasAudioAsVoiceTag = replyItems.some((item) => item.audioAsVoice);
|
||||
return replyItems
|
||||
.map((item) => ({
|
||||
|
||||
Reference in New Issue
Block a user