From 67f6bd619e5beba3c5ebcfde791ab34d8abc5177 Mon Sep 17 00:00:00 2001 From: Simon <10131203+gaomeng1900@users.noreply.github.com> Date: Tue, 13 Jan 2026 14:20:52 +0800 Subject: [PATCH] chore: rename `autoFixer` for better understanding --- packages/page-agent/src/utils/{normalize.ts => autoFixer.ts} | 4 ++-- packages/page-agent/src/utils/index.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename packages/page-agent/src/utils/{normalize.ts => autoFixer.ts} (96%) diff --git a/packages/page-agent/src/utils/normalize.ts b/packages/page-agent/src/utils/autoFixer.ts similarity index 96% rename from packages/page-agent/src/utils/normalize.ts rename to packages/page-agent/src/utils/autoFixer.ts index a8b88ea..e9bf91a 100644 --- a/packages/page-agent/src/utils/normalize.ts +++ b/packages/page-agent/src/utils/autoFixer.ts @@ -1,7 +1,7 @@ import chalk from 'chalk' /** - * Normalize LLM response to fix common format issues. + * Normalize LLM response and fix common format issues. * * Handles: * - No tool_calls but JSON in message.content (fallback) @@ -65,7 +65,7 @@ export function normalizeResponse(response: any): any { resolvedArguments = { action: safeJsonParse(resolvedArguments) } } } else { - throw new Error('No tool_call and message content does not contain valid JSON') + throw new Error('No tool_call and the message content does not contain valid JSON') } } else { throw new Error('No tool_call nor message content is present') diff --git a/packages/page-agent/src/utils/index.ts b/packages/page-agent/src/utils/index.ts index 1c6c0b1..4e90c39 100644 --- a/packages/page-agent/src/utils/index.ts +++ b/packages/page-agent/src/utils/index.ts @@ -1,4 +1,4 @@ -export { normalizeResponse } from './normalize' +export { normalizeResponse } from './autoFixer' /** * Wait until condition becomes true