Title: feat: set custom User-Agent header for API requests by chingjustwe · Pull Request #196 · lessweb/deepcode-cli · GitHub
Open Graph Title: feat: set custom User-Agent header for API requests by chingjustwe · Pull Request #196 · lessweb/deepcode-cli
X Title: feat: set custom User-Agent header for API requests by chingjustwe · Pull Request #196 · lessweb/deepcode-cli
Description: feat: set custom User-Agent header for API requests Problem When using deepcode-cli with custom/proxy API endpoints routed through Cloudflare or strict enterprise WAFs, requests fail with 403 Forbidden. The root cause is that the OpenAI SDK sends User-Agent: OpenAI/JS x.x.x by default, which proxy operators commonly block via WAF rules to prevent abuse of their OpenAI relay services. Changes New src/common/package-info.ts — central place that reads package.json once and exports APP_NAME and APP_VERSION as shared constants. src/common/openai-client.ts — override the User-Agent in the custom fetch wrapper from OpenAI/JS 6.35.0 to deepcode-cli/${version} (e.g. deepcode-cli/0.1.27). This references the same pattern as opencode: opencode/${version}. src/cli.tsx — use the shared APP_NAME / APP_VERSION from package-info.ts instead of local require("../package.json"). Verification deepcode --version outputs the correct version All 410 tests pass TypeScript typecheck, ESLint, Prettier all pass Build (npm run build) succeeds Related Issue #177
Open Graph Description: feat: set custom User-Agent header for API requests Problem When using deepcode-cli with custom/proxy API endpoints routed through Cloudflare or strict enterprise WAFs, requests fail with 403 Forbi...
X Description: feat: set custom User-Agent header for API requests Problem When using deepcode-cli with custom/proxy API endpoints routed through Cloudflare or strict enterprise WAFs, requests fail with 403 Forbi...
Opengraph URL: https://github.com/lessweb/deepcode-cli/pull/196
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:26c882f7-2762-babd-f6e1-f73ef93c8859 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B9DC:3C7B0B:22D904:2E8C6D:6A4D3364 |
| html-safe-nonce | 4ac54f97a944284d94c0c88822077489b63e540cd7e02c0d8479da07a4bcb6df |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOURDOjNDN0IwQjoyMkQ5MDQ6MkU4QzZEOjZBNEQzMzY0IiwidmlzaXRvcl9pZCI6IjI2NTM1NDc5NjgyNTUwNDY1MDAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 35d3744701b7501e0eeb567cb5e10defe7e8aab28dc6c953a487e838b23c27f9 |
| hovercard-subject-tag | pull_request:3932061379 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/lessweb/deepcode-cli/pull/196/files |
| twitter:image | https://avatars.githubusercontent.com/u/13643747?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/13643747?s=400&v=4 |
| og:image:alt | feat: set custom User-Agent header for API requests Problem When using deepcode-cli with custom/proxy API endpoints routed through Cloudflare or strict enterprise WAFs, requests fail with 403 Forbi... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/lessweb/deepcode-cli git https://github.com/lessweb/deepcode-cli.git |
| octolytics-dimension-user_id | 118287711 |
| octolytics-dimension-user_login | lessweb |
| octolytics-dimension-repository_id | 1223512305 |
| octolytics-dimension-repository_nwo | lessweb/deepcode-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1223512305 |
| octolytics-dimension-repository_network_root_nwo | lessweb/deepcode-cli |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 56fc8347865a14e2ec811533d68f929cf4e0ec19 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width