Conversation
|
🧪 Testing To try out this version of the SDK: Expires at: Sat, 09 May 2026 10:21:36 GMT |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b6b4010. Configure here.
| export const readEnv = (env: string): string | undefined => { | ||
| if (typeof (globalThis as any).process !== 'undefined') { | ||
| return (globalThis as any).process.env?.[env]?.trim() ?? undefined; | ||
| return (globalThis as any).process.env?.[env]?.trim() || undefined; |
There was a problem hiding this comment.
Nullish coalescing replaced with logical OR changes semantics
Low Severity
Changing ?? to || causes readEnv to return undefined for environment variables that are set to an empty string or whitespace, since empty string is falsy. The function's docstring says it returns undefined only when the variable "doesn't exist or cannot be accessed," but an empty-string env var does exist and is accessible — so || makes the function contradict its own documented contract. While the downstream effect on apiKey validation may be benign, any caller relying on distinguishing "set to empty" from "not set" will silently get incorrect results.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit b6b4010. Configure here.


Automated Release PR
0.3.1 (2026-04-09)
Full Changelog: v0.3.0...v0.3.1
Chores
This pull request is managed by Stainless's GitHub App.
The semver version number is based on included commit messages. Alternatively, you can manually set the version number in the title of this pull request.
For a better experience, it is recommended to use either rebase-merge or squash-merge when merging this pull request.
🔗 Stainless website
📚 Read the docs
🙋 Reach out for help or questions
Note
Low Risk
Low risk: primarily a version bump and changelog update, with a small tweak to
readEnvthat only affects handling of empty/whitespace-only env var values.Overview
Bumps the library version to
0.3.1across release metadata (package.json, lockfile, manifest,src/version.ts) and adds the0.3.1changelog entry.Adjusts
readEnvto returnundefinedwhen an env var resolves to an empty string after trimming (for both Nodeprocess.envand DenoDeno.env.get).Reviewed by Cursor Bugbot for commit b6b4010. Bugbot is set up for automated code reviews on this repo. Configure here.