@@ -29,7 +29,6 @@ import { BaseProvider } from "./base-provider"
2929import type { ApiHandlerCreateMessageMetadata , SingleCompletionHandler } from "../index"
3030import { handleOpenAIError } from "./utils/openai-error-handler"
3131import { generateImageWithProvider , ImageGenerationResult } from "./utils/image-generation"
32- import { sanitizeReasoningDetailId } from "./utils/sanitize-reasoning-id"
3332
3433// Add custom interface for OpenRouter params.
3534type OpenRouterChatCompletionParams = OpenAI . Chat . ChatCompletionCreateParams & {
@@ -287,18 +286,18 @@ export class OpenRouterHandler extends BaseProvider implements SingleCompletionH
287286 if ( detail . data !== undefined ) {
288287 existing . data = ( existing . data || "" ) + detail . data
289288 }
290- // Update other fields if provided - sanitize ID to remove invalid characters
291- if ( detail . id !== undefined ) existing . id = sanitizeReasoningDetailId ( detail . id )
289+ // Update other fields if provided
290+ if ( detail . id !== undefined ) existing . id = detail . id
292291 if ( detail . format !== undefined ) existing . format = detail . format
293292 if ( detail . signature !== undefined ) existing . signature = detail . signature
294293 } else {
295- // Start new reasoning detail accumulation - sanitize ID to remove invalid characters
294+ // Start new reasoning detail accumulation
296295 reasoningDetailsAccumulator . set ( key , {
297296 type : detail . type ,
298297 text : detail . text ,
299298 summary : detail . summary ,
300299 data : detail . data ,
301- id : sanitizeReasoningDetailId ( detail . id ) ,
300+ id : detail . id ,
302301 format : detail . format ,
303302 signature : detail . signature ,
304303 index,
0 commit comments