From 97866c68ce2c149454e35129a58a9e28e33eb56f Mon Sep 17 00:00:00 2001 From: Greyson LaLonde Date: Mon, 6 Apr 2026 19:37:03 +0800 Subject: [PATCH] fix: pre-cache tiktoken encoding before VCR intercepts requests --- lib/crewai/tests/llms/anthropic/test_anthropic_async.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/crewai/tests/llms/anthropic/test_anthropic_async.py b/lib/crewai/tests/llms/anthropic/test_anthropic_async.py index e09e02d4b..3c1d01ea3 100644 --- a/lib/crewai/tests/llms/anthropic/test_anthropic_async.py +++ b/lib/crewai/tests/llms/anthropic/test_anthropic_async.py @@ -7,6 +7,9 @@ import tiktoken from pydantic import BaseModel from crewai.llm import LLM + +# Pre-cache tiktoken encoding so VCR doesn't intercept the download request +tiktoken.get_encoding("cl100k_base") from crewai.llms.providers.anthropic.completion import AnthropicCompletion