{"version":3,"sources":["../../src/voice/generation_tools.test.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2025 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport { ReadableStream as NodeReadableStream } from 'stream/web';\nimport { afterEach, describe, expect, it, vi } from 'vitest';\nimport { z } from 'zod';\nimport { FunctionCall, ToolContext, ToolError, tool } from '../llm/index.js';\nimport { initializeLogger } from '../log.js';\nimport type { Task } from '../utils.js';\nimport { cancelAndWait, delay } from '../utils.js';\nimport { AgentTask } from './agent.js';\nimport type { AgentSession } from './agent_session.js';\nimport {\n  type _TextOut,\n  _waitForToolExecutionResult,\n  performTextForwarding,\n  performToolExecutions,\n} from './generation.js';\nimport type { SpeechHandle } from './speech_handle.js';\nimport { ToolExecutor } from './tool_executor.js';\n\nfunction createStringStream(chunks: string[], delayMs: number = 0): NodeReadableStream<string> {\n  return new NodeReadableStream<string>({\n    async start(controller) {\n      for (const c of chunks) {\n        if (delayMs > 0) {\n          await delay(delayMs);\n        }\n        controller.enqueue(c);\n      }\n      controller.close();\n    },\n  });\n}\n\nfunction createFunctionCallStream(fc: FunctionCall): NodeReadableStream<FunctionCall> {\n  return new NodeReadableStream<FunctionCall>({\n    start(controller) {\n      controller.enqueue(fc);\n      controller.close();\n    },\n  });\n}\n\nfunction createFunctionCallStreamFromArray(fcs: FunctionCall[]): NodeReadableStream<FunctionCall> {\n  return new NodeReadableStream<FunctionCall>({\n    start(controller) {\n      for (const fc of fcs) {\n        controller.enqueue(fc);\n      }\n      controller.close();\n    },\n  });\n}\n\ndescribe('Generation + Tool Execution', () => {\n  initializeLogger({ pretty: false, level: 'silent' });\n\n  afterEach(() => {\n    vi.useRealTimers();\n  });\n\n  it('should not abort tool when preamble forwarders are cleaned up', async () => {\n    vi.useFakeTimers();\n    const replyAbortController = new AbortController();\n    const forwarderController = new AbortController();\n\n    const chunks = Array.from({ length: 50 }, () => `Hi.`);\n    const fullPreambleText = chunks.join('');\n    const preamble = createStringStream(chunks, 20);\n    const [textForwardTask, textOut]: [Task<void>, _TextOut] = performTextForwarding(\n      preamble,\n      forwarderController,\n      null,\n    );\n\n    // Tool that takes > 5 seconds\n    let toolAborted = false;\n    const getWeather = tool({\n      name: 'getWeather',\n      description: 'weather',\n      parameters: z.object({ location: z.string() }),\n      execute: async ({ location }, { abortSignal }) => {\n        abortSignal.addEventListener('abort', () => {\n          toolAborted = true;\n        });\n        // 6s delay\n        await delay(6000);\n        return `Sunny in ${location}`;\n      },\n    });\n\n    const fc = FunctionCall.create({\n      callId: 'call_1',\n      name: 'getWeather',\n      args: JSON.stringify({ location: 'San Francisco' }),\n    });\n    const toolCallStream = createFunctionCallStream(fc);\n\n    const [execTask, toolOutput] = performToolExecutions({\n      session: {} as any,\n      speechHandle: { id: 'speech_test', _itemAdded: () => {} } as any,\n      toolCtx: new ToolContext([getWeather]) as any,\n      toolCallStream,\n      controller: replyAbortController,\n      onToolExecutionStarted: () => {},\n      onToolExecutionCompleted: () => {},\n    });\n\n    // Ensure tool has started, then cancel forwarders mid-stream (without aborting parent AbortController)\n    await toolOutput.firstToolStartedFuture.await;\n    await vi.advanceTimersByTimeAsync(100);\n    const cancelForwarder = cancelAndWait([textForwardTask], 5000);\n    await vi.advanceTimersByTimeAsync(20);\n    await cancelForwarder;\n\n    await vi.advanceTimersByTimeAsync(6000);\n    await execTask.result;\n\n    expect(toolOutput.output.length).toBe(1);\n    const out = toolOutput.output[0]!;\n    expect(out.toolCallOutput?.isError).toBe(false);\n    expect(out.toolCallOutput?.output).toContain('Sunny in San Francisco');\n    // Forwarder should have been cancelled before finishing all preamble chunks\n    expect(textOut.text).not.toBe(fullPreambleText);\n    // Tool's abort signal must not have fired\n    expect(toolAborted).toBe(false);\n  }, 30_000);\n\n  it('should return basic tool execution output', async () => {\n    const replyAbortController = new AbortController();\n\n    const echo = tool({\n      name: 'echo',\n      description: 'echo',\n      parameters: z.object({ msg: z.string() }),\n      execute: async ({ msg }) => `echo: ${msg}`,\n    });\n\n    const fc = FunctionCall.create({\n      callId: 'call_2',\n      name: 'echo',\n      args: JSON.stringify({ msg: 'hello' }),\n    });\n    const toolCallStream = createFunctionCallStream(fc);\n\n    const [execTask, toolOutput] = performToolExecutions({\n      session: {} as any,\n      speechHandle: { id: 'speech_test2', _itemAdded: () => {} } as any,\n      toolCtx: new ToolContext([echo]) as any,\n      toolCallStream,\n      controller: replyAbortController,\n    });\n\n    await execTask.result;\n    expect(toolOutput.output.length).toBe(1);\n    const out = toolOutput.output[0];\n    expect(out?.toolCallOutput?.isError).toBe(false);\n    expect(out?.toolCallOutput?.output).toContain('echo: hello');\n  });\n\n  it('should repair and canonicalize leaked template tokens in tool args', async () => {\n    const replyAbortController = new AbortController();\n\n    const removeOrderItem = tool({\n      name: 'removeOrderItem',\n      description: 'remove order item',\n      parameters: z.object({ orderId: z.array(z.string()) }),\n      execute: async ({ orderId }) => orderId.join(','),\n    });\n\n    const rawArgs = '{\"orderId\": [\"<|\\\\\"|\\\\\"O_WAAB70<|\\\\\"|\\\\\"]}';\n    const fc = FunctionCall.create({\n      callId: 'call_repair_args',\n      name: 'removeOrderItem',\n      args: rawArgs,\n    });\n    const toolCallStream = createFunctionCallStream(fc);\n\n    const [execTask, toolOutput] = performToolExecutions({\n      session: {} as AgentSession,\n      speechHandle: { id: 'speech_repair', _itemAdded: () => {} } as unknown as SpeechHandle,\n      toolCtx: new ToolContext([removeOrderItem]) as unknown as ToolContext,\n      toolCallStream,\n      controller: replyAbortController,\n    });\n\n    await execTask.result;\n    expect(toolOutput.output.length).toBe(1);\n    const out = toolOutput.output[0];\n    expect(out?.toolCallOutput?.isError).toBe(false);\n    expect(out?.toolCallOutput?.output).toBe('\"O_WAAB70\"');\n    expect(fc.args).not.toBe(rawArgs);\n    expect(JSON.parse(fc.args)).toEqual({ orderId: ['O_WAAB70'] });\n  });\n\n  it('should abort tool when reply is aborted mid-execution', async () => {\n    const replyAbortController = new AbortController();\n\n    let aborted = false;\n    // Resolves once the tool body has begun and registered its abort listener. We cannot key off\n    // `firstToolStartedFuture` here: that future now resolves right after argument parsing (before\n    // execution), matching Python, so awaiting it does not guarantee the abort listener is wired.\n    let signalToolStarted!: () => void;\n    const toolStarted = new Promise<void>((resolve) => {\n      signalToolStarted = resolve;\n    });\n    const longOp = tool({\n      name: 'longOp',\n      description: 'longOp',\n      parameters: z.object({ ms: z.number() }),\n      execute: async ({ ms }, { abortSignal }) => {\n        abortSignal.addEventListener('abort', () => {\n          aborted = true;\n        });\n        signalToolStarted();\n        await delay(ms);\n        return 'done';\n      },\n    });\n\n    const fc = FunctionCall.create({\n      callId: 'call_abort_1',\n      name: 'longOp',\n      args: JSON.stringify({ ms: 5000 }),\n    });\n    const toolCallStream = createFunctionCallStream(fc);\n\n    const [execTask, toolOutput] = performToolExecutions({\n      session: {} as any,\n      speechHandle: { id: 'speech_abort', _itemAdded: () => {} } as any,\n      toolCtx: new ToolContext([longOp]) as any,\n      toolCallStream,\n      controller: replyAbortController,\n    });\n\n    await toolStarted;\n    replyAbortController.abort();\n    await execTask.result;\n\n    expect(aborted).toBe(true);\n    expect(toolOutput.output).toHaveLength(0);\n  }, 20_000);\n\n  it('keeps a settled tool result when abort is observed in the same tick', async () => {\n    const replyAbortController = new AbortController();\n    const settled = Promise.resolve('completed');\n    replyAbortController.abort();\n\n    await expect(\n      _waitForToolExecutionResult(settled, replyAbortController.signal),\n    ).resolves.toEqual({\n      result: 'completed',\n      isAborted: false,\n    });\n  });\n\n  it('keeps completed output while omitting interrupted regular tools and handoffs', async () => {\n    const replyAbortController = new AbortController();\n    const neverFinish = new Promise<void>(() => {});\n    let signalSlowStarted!: () => void;\n    const slowStarted = new Promise<void>((resolve) => {\n      signalSlowStarted = resolve;\n    });\n    let signalHandoffStarted!: () => void;\n    const handoffStarted = new Promise<void>((resolve) => {\n      signalHandoffStarted = resolve;\n    });\n    let signalCompleted!: () => void;\n    const completed = new Promise<void>((resolve) => {\n      signalCompleted = resolve;\n    });\n\n    const immediate = tool({\n      name: 'immediate',\n      description: 'Completes before interruption.',\n      parameters: z.object({}),\n      execute: async () => 'completed',\n    });\n    const slow = tool({\n      name: 'slow',\n      description: 'Remains in flight during interruption.',\n      parameters: z.object({}),\n      execute: async () => {\n        signalSlowStarted();\n        await neverFinish;\n        return 'unreachable';\n      },\n    });\n    const handoff = tool({\n      name: 'handoff',\n      description: 'Returns a handoff only if allowed to finish.',\n      parameters: z.object({}),\n      execute: async () => {\n        signalHandoffStarted();\n        await neverFinish;\n        return new AgentTask({ instructions: 'Handle the transferred request.' });\n      },\n    });\n    const calls = [\n      FunctionCall.create({ callId: 'call_completed', name: immediate.name, args: '{}' }),\n      FunctionCall.create({ callId: 'call_slow', name: slow.name, args: '{}' }),\n      FunctionCall.create({ callId: 'call_handoff', name: handoff.name, args: '{}' }),\n    ];\n    const completedCallIds: string[] = [];\n\n    const [execTask, toolOutput] = performToolExecutions({\n      session: {} as any,\n      speechHandle: { id: 'speech_mixed_abort', _itemAdded: () => {} } as any,\n      toolCtx: new ToolContext([immediate, slow, handoff]) as any,\n      toolCallStream: createFunctionCallStreamFromArray(calls),\n      controller: replyAbortController,\n      onToolExecutionCompleted: (output) => {\n        completedCallIds.push(output.toolCall.callId);\n        if (output.toolCall.callId === 'call_completed') signalCompleted();\n      },\n    });\n\n    await Promise.all([completed, slowStarted, handoffStarted]);\n    replyAbortController.abort();\n    await execTask.result;\n\n    expect(toolOutput.output.map((output) => output.toolCall.callId)).toEqual(['call_completed']);\n    expect(completedCallIds).toEqual(['call_completed']);\n  });\n\n  it('resolves firstToolStartedFuture even when the only tool call is duplicate-rejected', async () => {\n    const sharedExecutor = new ToolExecutor({ owningActivity: null });\n    const session = { _activity: { _toolExecutor: sharedExecutor } } as unknown as AgentSession;\n    const speechHandle = { id: 'speech_dup', _itemAdded: () => {} } as unknown as SpeechHandle;\n\n    let releaseFirst!: () => void;\n    const firstBlocked = new Promise<void>((resolve) => {\n      releaseFirst = resolve;\n    });\n    let signalFirstStarted!: () => void;\n    const firstStarted = new Promise<void>((resolve) => {\n      signalFirstStarted = resolve;\n    });\n    const slow = tool({\n      name: 'slow',\n      description: 'slow',\n      onDuplicate: 'reject',\n      parameters: z.object({}),\n      execute: async () => {\n        signalFirstStarted();\n        await firstBlocked;\n        return 'done';\n      },\n    });\n    const toolCtx = new ToolContext([slow]) as unknown as ToolContext;\n\n    // First call: starts and stays running so it occupies the executor's duplicate slot.\n    const fc1 = FunctionCall.create({ callId: 'dup_c1', name: 'slow', args: '{}' });\n    const [task1] = performToolExecutions({\n      session,\n      speechHandle,\n      toolCtx,\n      toolCallStream: createFunctionCallStream(fc1),\n      controller: new AbortController(),\n    });\n    await firstStarted;\n\n    // Second call: a duplicate of the still-running first call -> rejected by the executor.\n    const fc2 = FunctionCall.create({ callId: 'dup_c2', name: 'slow', args: '{}' });\n    const [task2, out2] = performToolExecutions({\n      session,\n      speechHandle,\n      toolCtx,\n      toolCallStream: createFunctionCallStream(fc2),\n      controller: new AbortController(),\n    });\n\n    // Would hang forever before the fix.\n    await out2.firstToolStartedFuture.await;\n    await task2.result;\n\n    // The duplicate produced a (rejection) output, and no real execution happened for it.\n    expect(out2.output.length).toBe(1);\n\n    releaseFirst();\n    await task1.result;\n  }, 20_000);\n\n  it('normalizes and commits an unknown tool call before its error output', async () => {\n    const events: string[] = [];\n    const fc = FunctionCall.create({\n      callId: 'call_unknown',\n      name: 'missing',\n      args: 'definitely not json',\n    });\n    const [execTask, toolOutput] = performToolExecutions({\n      session: {} as AgentSession,\n      speechHandle: { id: 'speech_unknown', _itemAdded: () => {} } as unknown as SpeechHandle,\n      toolCtx: ToolContext.empty(),\n      toolCallStream: createFunctionCallStream(fc),\n      controller: new AbortController(),\n      onToolExecutionStarted: (call) => events.push(`call:${call.callId}`),\n      onToolExecutionCompleted: (output) => events.push(`output:${output.toolCall.callId}`),\n    });\n\n    await execTask.result;\n\n    expect(events).toEqual(['call:call_unknown', 'output:call_unknown']);\n    expect(fc.args).toBe('{}');\n    expect(toolOutput.firstToolStartedFuture.done).toBe(true);\n    expect(toolOutput.output[0]?.toolCallOutput).toMatchObject({\n      callId: 'call_unknown',\n      isError: true,\n    });\n  });\n\n  it('should surface zod validation errors to the LLM with field-level detail', async () => {\n    const replyAbortController = new AbortController();\n\n    const echo = tool({\n      name: 'echo',\n      description: 'echo',\n      parameters: z.object({ msg: z.string() }),\n      execute: async ({ msg }) => `echo: ${msg}`,\n    });\n\n    // invalid: msg should be a string\n    const fc = FunctionCall.create({\n      callId: 'call_invalid_args',\n      name: 'echo',\n      args: JSON.stringify({ msg: 123 }),\n    });\n    const toolCallStream = createFunctionCallStream(fc);\n    const onToolExecutionStarted = vi.fn();\n\n    const [execTask, toolOutput] = performToolExecutions({\n      session: {} as any,\n      speechHandle: { id: 'speech_invalid', _itemAdded: () => {} } as any,\n      toolCtx: new ToolContext([echo]) as any,\n      toolCallStream,\n      controller: replyAbortController,\n      onToolExecutionStarted,\n    });\n\n    await execTask.result;\n    expect(onToolExecutionStarted).toHaveBeenCalledWith(fc);\n    expect(JSON.parse(fc.args)).toEqual({ msg: 123 });\n    expect(toolOutput.output.length).toBe(1);\n    const out = toolOutput.output[0];\n    expect(out?.toolCallOutput?.isError).toBe(true);\n    // LLM must see enough detail (tool name + offending field) to self-correct,\n    // not the masked generic message reserved for tool-runtime exceptions.\n    const output = out?.toolCallOutput?.output ?? '';\n    expect(output).toContain('Invalid arguments');\n    expect(output).toContain('echo');\n    expect(output).toContain('msg');\n    expect(output).not.toContain('An internal error occurred');\n  });\n\n  it('should surface JSON parse errors to the LLM', async () => {\n    const replyAbortController = new AbortController();\n\n    const echo = tool({\n      name: 'echo',\n      description: 'echo',\n      parameters: z.object({ msg: z.string() }),\n      execute: async ({ msg }) => `echo: ${msg}`,\n    });\n\n    // unrepairable JSON: random text the repair pass can't recover\n    const fc = FunctionCall.create({\n      callId: 'call_invalid_json',\n      name: 'echo',\n      args: 'definitely not json',\n    });\n    const toolCallStream = createFunctionCallStream(fc);\n\n    const [execTask, toolOutput] = performToolExecutions({\n      session: {} as any,\n      speechHandle: { id: 'speech_bad_json', _itemAdded: () => {} } as any,\n      toolCtx: new ToolContext([echo]) as any,\n      toolCallStream,\n      controller: replyAbortController,\n    });\n\n    await execTask.result;\n    expect(fc.args).toBe('{}');\n    expect(toolOutput.output.length).toBe(1);\n    const out = toolOutput.output[0];\n    expect(out?.toolCallOutput?.isError).toBe(true);\n    const output = out?.toolCallOutput?.output ?? '';\n    expect(output).toContain('Invalid arguments');\n    expect(output).toContain('echo');\n    expect(output).not.toContain('An internal error occurred');\n  });\n\n  it('should mask generic tool exceptions so internal details do not reach the LLM', async () => {\n    const replyAbortController = new AbortController();\n\n    // The tool throws a regular Error whose message contains internals (db URL,\n    // credentials) we must NOT forward to the LLM (and from there to end users).\n    const sensitive = tool({\n      name: 'sensitive',\n      description: 'sensitive',\n      parameters: z.object({}),\n      execute: async () => {\n        throw new Error('database connection failed: postgres://admin:hunter2@db.internal:5432');\n      },\n    });\n\n    const fc = FunctionCall.create({\n      callId: 'call_generic_error',\n      name: 'sensitive',\n      args: JSON.stringify({}),\n    });\n    const toolCallStream = createFunctionCallStream(fc);\n\n    const [execTask, toolOutput] = performToolExecutions({\n      session: {} as any,\n      speechHandle: { id: 'speech_generic_err', _itemAdded: () => {} } as any,\n      toolCtx: new ToolContext([sensitive]) as any,\n      toolCallStream,\n      controller: replyAbortController,\n    });\n\n    await execTask.result;\n    expect(toolOutput.output.length).toBe(1);\n    const out = toolOutput.output[0];\n    expect(out?.toolCallOutput?.isError).toBe(true);\n    const output = out?.toolCallOutput?.output ?? '';\n    expect(output).toBe('An internal error occurred');\n    expect(output).not.toContain('database');\n    expect(output).not.toContain('hunter2');\n    expect(output).not.toContain('postgres');\n    // Raw exception is still preserved server-side for observability.\n    expect(out?.rawException?.message).toContain('hunter2');\n  });\n\n  it('should forward ToolError messages to the LLM verbatim (escape hatch)', async () => {\n    const replyAbortController = new AbortController();\n\n    // Tools that intend to give the LLM a corrective hint opt in by throwing\n    // ToolError — its message is forwarded as-is.\n    const checked = tool({\n      name: 'checked',\n      description: 'checked',\n      parameters: z.object({ qty: z.number() }),\n      execute: async ({ qty }) => {\n        if (qty <= 0) {\n          throw new ToolError('qty must be positive — try again with a value greater than 0');\n        }\n        return qty;\n      },\n    });\n\n    const fc = FunctionCall.create({\n      callId: 'call_tool_error',\n      name: 'checked',\n      args: JSON.stringify({ qty: -1 }),\n    });\n    const toolCallStream = createFunctionCallStream(fc);\n\n    const [execTask, toolOutput] = performToolExecutions({\n      session: {} as any,\n      speechHandle: { id: 'speech_tool_error', _itemAdded: () => {} } as any,\n      toolCtx: new ToolContext([checked]) as any,\n      toolCallStream,\n      controller: replyAbortController,\n    });\n\n    await execTask.result;\n    expect(toolOutput.output.length).toBe(1);\n    const out = toolOutput.output[0];\n    expect(out?.toolCallOutput?.isError).toBe(true);\n    expect(out?.toolCallOutput?.output).toBe(\n      'qty must be positive — try again with a value greater than 0',\n    );\n  });\n\n  it('should handle multiple tool calls within a single stream', async () => {\n    const replyAbortController = new AbortController();\n\n    const sum = tool({\n      name: 'sum',\n      description: 'sum',\n      parameters: z.object({ a: z.number(), b: z.number() }),\n      execute: async ({ a, b }) => a + b,\n    });\n    const upper = tool({\n      name: 'upper',\n      description: 'upper',\n      parameters: z.object({ s: z.string() }),\n      execute: async ({ s }) => s.toUpperCase(),\n    });\n\n    const fc1 = FunctionCall.create({\n      callId: 'call_multi_1',\n      name: 'sum',\n      args: JSON.stringify({ a: 2, b: 3 }),\n    });\n    const fc2 = FunctionCall.create({\n      callId: 'call_multi_2',\n      name: 'upper',\n      args: JSON.stringify({ s: 'hey' }),\n    });\n    const toolCallStream = createFunctionCallStreamFromArray([fc1, fc2]);\n\n    const [execTask, toolOutput] = performToolExecutions({\n      session: {} as any,\n      speechHandle: { id: 'speech_multi', _itemAdded: () => {} } as any,\n      toolCtx: new ToolContext([sum, upper]) as any,\n      toolCallStream,\n      controller: replyAbortController,\n    });\n\n    await execTask.result;\n    expect(toolOutput.output.length).toBe(2);\n\n    // sort by callId to assert deterministically\n    const sorted = [...toolOutput.output].sort((a, b) =>\n      a.toolCall.callId.localeCompare(b.toolCall.callId),\n    );\n\n    expect(sorted[0]?.toolCall.name).toBe('sum');\n    expect(sorted[0]?.toolCallOutput?.isError).toBe(false);\n    expect(sorted[0]?.toolCallOutput?.output).toBe('5');\n    expect(sorted[1]?.toolCall.name).toBe('upper');\n    expect(sorted[1]?.toolCallOutput?.isError).toBe(false);\n    expect(sorted[1]?.toolCallOutput?.output).toBe('\"HEY\"');\n  });\n});\n"],"mappings":";AAGA,iBAAqD;AACrD,oBAAoD;AACpD,iBAAkB;AAClB,iBAA2D;AAC3D,iBAAiC;AAEjC,mBAAqC;AACrC,mBAA0B;AAE1B,wBAKO;AAEP,2BAA6B;AAE7B,SAAS,mBAAmB,QAAkB,UAAkB,GAA+B;AAC7F,SAAO,IAAI,WAAAA,eAA2B;AAAA,IACpC,MAAM,MAAM,YAAY;AACtB,iBAAW,KAAK,QAAQ;AACtB,YAAI,UAAU,GAAG;AACf,oBAAM,oBAAM,OAAO;AAAA,QACrB;AACA,mBAAW,QAAQ,CAAC;AAAA,MACtB;AACA,iBAAW,MAAM;AAAA,IACnB;AAAA,EACF,CAAC;AACH;AAEA,SAAS,yBAAyB,IAAoD;AACpF,SAAO,IAAI,WAAAA,eAAiC;AAAA,IAC1C,MAAM,YAAY;AAChB,iBAAW,QAAQ,EAAE;AACrB,iBAAW,MAAM;AAAA,IACnB;AAAA,EACF,CAAC;AACH;AAEA,SAAS,kCAAkC,KAAuD;AAChG,SAAO,IAAI,WAAAA,eAAiC;AAAA,IAC1C,MAAM,YAAY;AAChB,iBAAW,MAAM,KAAK;AACpB,mBAAW,QAAQ,EAAE;AAAA,MACvB;AACA,iBAAW,MAAM;AAAA,IACnB;AAAA,EACF,CAAC;AACH;AAAA,IAEA,wBAAS,+BAA+B,MAAM;AAC5C,mCAAiB,EAAE,QAAQ,OAAO,OAAO,SAAS,CAAC;AAEnD,+BAA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