mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 23:58:25 +00:00
Agents: scope sanitizeUserFacingText rewrites to errorContext
Squash-merge #12988. Refs: #12889 #12309 #3594 #7483 #10094 #10368 #11317 #11359 #11649 #12022 #12432 #12676 #12711
This commit is contained in:
@@ -75,6 +75,19 @@ describe("extractAssistantText", () => {
|
||||
expect(result).toBe("This is a normal response without any tool calls.");
|
||||
});
|
||||
|
||||
it("sanitizes HTTP-ish error text only when stopReason is error", () => {
|
||||
const msg: AssistantMessage = {
|
||||
role: "assistant",
|
||||
stopReason: "error",
|
||||
errorMessage: "500 Internal Server Error",
|
||||
content: [{ type: "text", text: "500 Internal Server Error" }],
|
||||
timestamp: Date.now(),
|
||||
};
|
||||
|
||||
const result = extractAssistantText(msg);
|
||||
expect(result).toBe("HTTP 500: Internal Server Error");
|
||||
});
|
||||
|
||||
it("strips Minimax tool invocations with extra attributes", () => {
|
||||
const msg: AssistantMessage = {
|
||||
role: "assistant",
|
||||
|
||||
Reference in New Issue
Block a user