fix: set canonical User-Agent header format#1576
Conversation
The User-Agent header is now always `workos-node/{VERSION}`,
matching the canonical WorkOS Node SDK format used through the
6.x line.
Three pieces of behavior added in later majors that broke
conformance are removed:
- Runtime detection no longer appended (e.g. `(node/v22.0.0)`)
- The `appInfo` option is still accepted for backwards
compatibility, but the value no longer affects the outgoing
User-Agent header
- The HTTP-client annotation injected by `addClientToUserAgent`
(e.g. `/fetch`) is dropped
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughUser-Agent header generation is simplified across the SDK. The implementation no longer appends runtime version information or app info details, reducing the User-Agent to a basic Changes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Review rate limit: 4/5 reviews remaining, refill in 12 minutes. Comment |
Greptile SummaryThis PR strips the Confidence Score: 4/5Safe to merge — the behaviour change is intentional and tests pass; only minor cleanup remains. Only P2 findings: one stale test description and dead getClientName code. No logic errors or security concerns. src/common/net/http-client.ts — getClientName and its interface/subclass implementations are now unreachable dead code. Important Files Changed
|
Summary
The outgoing
User-Agentheader is now alwaysworkos-node/{VERSION}— the canonical WorkOS Node SDK format used through the 6.x line. The 7.x and 8.x lines accumulated several augmentations that no longer conformed (/fetchHTTP-client annotation,(node/v22.0.0)runtime info,appName: appVerfromappInfo).Behavior changes
appInfooption still parses for backwards compatibility, but the value no longer affects theUser-Agentheader.addClientToUserAgenthelper now returns the input unchanged.Callers relying on these tokens being present in
User-Agentwill need to set a separate header via the request-options headers mechanism.Test plan
npx jest(683 passed, 0 failed)User-Agent: workos-node/{VERSION}on a real outgoing request🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests