fix: remove false-positive billing error rewrite on normal assistant text (openclaw#17834) thanks @niceysam

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: niceysam <256747835+niceysam@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
niceysam
2026-02-22 03:17:39 +09:00
committed by GitHub
parent 57fbbaebca
commit 5e423b596c
3 changed files with 8 additions and 21 deletions

View File

@@ -72,9 +72,14 @@ describe("sanitizeUserFacingText", () => {
expect(sanitizeUserFacingText(text)).toBe(text);
});
it("rewrites billing error-shaped text", () => {
it("does not rewrite billing error-shaped text without errorContext", () => {
const text = "billing: please upgrade your plan";
expect(sanitizeUserFacingText(text)).toContain("billing error");
expect(sanitizeUserFacingText(text)).toBe(text);
});
it("rewrites billing error-shaped text with errorContext", () => {
const text = "billing: please upgrade your plan";
expect(sanitizeUserFacingText(text, { errorContext: true })).toContain("billing error");
});
it("sanitizes raw API error payloads", () => {