Illegal header values from your env or key helper now fail clearly instead of crashing.
What's wrong with this entry?
If a header value coming from ANTHROPIC_CUSTOM_HEADERS, an API key environment variable, or apiKeyHelper is not a legal HTTP header value, Claude Code now fails with a clear error before sending, classified as your mistake rather than an internal crash.
- New
InvalidRequestHeaderValueError, classified asinvalid_request_headerorinvalid_api_keywhen the value is user-supplied. - Logged at error level rather than reported as a crash.
- Treated as non-retryable during API key verification, so a malformed key value fails immediately.
- The error class does not exist in v2.1.226.
request header value rejected before send: not a valid HTTP header value
Strings lifted out of the shipped bundle, so the claim above can be checked against them.
Related
Other releases about the same thing. Found by shared names or similar wording; neither means one caused the other.
-
v2.1.238
Zip-archive plugin entries can carry their own fetch credentials
Both mention header helper
-
v2.1.238
MCP header-minting commands run through the shared trusted-command runner
Both mention header helper
-
v2.1.248
Separate failure code when a credential helper's token is rejected
Both mention header helper