Skip to content

Commit ef1a908

Browse files
committed
fix: restore assistant error truncation ellipsis
1 parent 75c6450 commit ef1a908

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎src/agents/pi-embedded-helpers.formatassistanterrortext.test.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,12 @@ describe("formatRawAssistantErrorForUi", () => {
414414
"Authentication failed with an HTML 403 response from the provider. Re-authenticate and verify your provider account access.",
415415
);
416416
});
417+
418+
it("preserves a clean ellipsis when truncating fallback error text", () => {
419+
const raw = "x".repeat(601);
420+
421+
expect(formatRawAssistantErrorForUi(raw)).toBe(`${"x".repeat(600)}\u2026`);
422+
});
417423
});
418424

419425
describe("raw API error payload helpers", () => {

‎src/shared/assistant-error-format.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,5 +257,5 @@ export function formatRawAssistantErrorForUi(raw?: string): string {
257257
return `${prefix}${type}: ${info.message}`;
258258
}
259259

260-
return trimmed.length > 600 ? `${trimmed.slice(0, 600)}…` : trimmed;
260+
return trimmed.length > 600 ? `${trimmed.slice(0, 600)}\u2026` : trimmed;
261261
}

0 commit comments

Comments
 (0)