From 37ee6779b1aa3934f78a9e69612b897a5b5f0b25 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Mon, 25 Aug 2025 07:39:27 +0000 Subject: [PATCH] refactor: address review feedback - Remove unused UNWANTED_PATTERN property - Add more detailed comment explaining the issue origin - Clarify that sanitization preserves legitimate Chinese text --- src/api/providers/deepseek.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/api/providers/deepseek.ts b/src/api/providers/deepseek.ts index 98610bd7ac..4cf6ebc22c 100644 --- a/src/api/providers/deepseek.ts +++ b/src/api/providers/deepseek.ts @@ -10,9 +10,6 @@ import type { ApiHandlerCreateMessageMetadata } from "../index" import { OpenAiHandler } from "./openai" export class DeepSeekHandler extends OpenAiHandler { - // Pattern to match unwanted "极速模式" characters and its variations - private readonly UNWANTED_PATTERN = /[极極][速][模][式]|[极極]|[速]?[模]?[式]?/g - constructor(options: ApiHandlerOptions) { super({ ...options, @@ -53,8 +50,10 @@ export class DeepSeekHandler extends OpenAiHandler { } /** - * Removes unwanted "极速模式" characters from the content. - * These characters appear to be injected by some DeepSeek V3.1 configurations. + * Removes unwanted "极速模式" (speed mode) characters from the content. + * These characters appear to be injected by some DeepSeek V3.1 configurations, + * possibly from a Chinese language interface or prompt template. + * The sanitization preserves legitimate Chinese text while removing these artifacts. */ private sanitizeContent(content: string): string { // First, try to remove the complete phrase "极速模式"