Enabling Prompt Caching Throws "crypto is not defined" Error
Closed this issue ยท 5 comments
Before submitting your bug report
- I've tried using the "Ask AI" feature on the Continue docs site to see if the docs have an answer
- I believe this is a bug. I'll try to join the Continue Discord for questions
- I'm not able to find an open issue that reports the same bug
- I've seen the troubleshooting guide on the Continue Docs
Relevant environment info
- OS: Ubuntu 22.04.5 LTS
- Continue version: 1.0.44-eap
- IDE version: PhpStorm 2025.2 (Build #PS-252.23892.419)
- Model: Anthropic Claude Sonnet 4
- config:
%YAML 1.1
---
name: IntelliJ
version: 0.0.1
schema: v1
config_defaults: &config_defaults
provider: bedrock
env:
region: us-east-1
profile: bedrock
anthropic_model_defaults: &anthropic_model_defaults
roles:
- chat
- edit
- apply
defaultCompletionOptions:
contextLength: 200000
maxTokens: 64000
promptCaching: true
capabilities:
- tool_use
- image_input
reasoning: true
reasoningBudgetTokens: 3000
models:
- name: Claude 4 Sonnet Bedrock
<<: *config_defaults
<<: *anthropic_model_defaults
model: us.anthropic.claude-sonnet-4-20250514-v1:0
- name: Claude 3.7 Sonnet Bedrock
<<: *config_defaults
<<: *anthropic_model_defaults
model: us.anthropic.claude-3-7-sonnet-20250219-v1:0
embeddingsProvider:
<<: *config_defaults
model: amazon.titan-embed-text-v2:0
roles:
- embedDescription
When I enable promptCaching for Claude Sonnet 4, all inference requests fail and I receive the following error in the Continue logs:
"crypto is not defined."
I also tried uninstalling the Continue plugin and deleting the ~/.continue directory. After reinstalling and adding my config.yaml file, the same problem occurred. Please investigate and fix this error.
NOTE: Commenting out promptCaching: true in the config.yaml file and restarting PHPStorm is a work around that fixes the issue.
To reproduce
- Add Claude Sonnet 4 model in the
config.yamlfile. - Be sure to add
promptCaching: trueto the model - Save the
config.yamlfile - Run an inference request
- Error message is displayed by the Continue plugin: "crypto is not defined"
Log output
[info] Starting Continue core...
[2025-09-17T12:51:30] [info] Starting Continue core...
[2025-09-17T12:51:30] Setup
[2025-09-17T12:51:30] [binary] Core started
[2025-09-17T12:51:52] ReferenceError: crypto is not defined
[2025-09-17T12:51:52] Error running handler for "llm/streamChat": ReferenceError: crypto is not definedI tried the following config and did not get any error:
models:
- uses: anthropic/claude-4-sonnet
with:
ANTHROPIC_API_KEY: <key>
override:
defaultCompletionOptions:
promptCaching: true@Patrick-Erichsen I wonder if it's a bedrock specific issue?
๐ This issue has been resolved in version 1.19.1 ๐
The release is available on:
Your semantic-release bot ๐ฆ๐
Thank you for resolving this issue. I wanted to confirm that hotfix 7938 fixed my issue. Thanks again!
๐ This issue has been resolved in version 1.22.0 ๐
The release is available on:
Your semantic-release bot ๐ฆ๐