Repository navigation
fix(proxy): say when Node WILL use the proxy, and name the opt-in (PHARN-12) - #206
Merged
Merged
Conversation
…ARN-12) The proxy notice said "pharn will not use it … Node's fetch reads no proxy environment variable on any platform". Measured on Node 22.22.2: with NODE_USE_ENV_PROXY=1 (or --use-env-proxy) fetch does route through HTTPS_PROXY — so the message was false for users who opted in and hid the one workaround from users behind a proxy. Node 20.20.2 has no such option. detectProxyNotice now reports one of three states, using the runtime's own list of accepted flags (process.allowedNodeEnvironmentFlags) rather than a version table: `on` (downloads go through the proxy), `available` (set NODE_USE_ENV_PROXY=1), `unsupported` (this Node cannot). Flags are matched as whole tokens. docs/troubleshooting.md documents the opt-in. LIMITS.md §3a / THREAT-MODEL.md carry the old claim but are human-only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TvcuVhk8hTeDskp5pAJhnc
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
When a proxy variable is set, pharn prints: "…but pharn will not use it: … Node's global fetch, which reads no proxy environment variable on any platform". That is not always true.
NODE_USE_ENV_PROXY=1or--use-env-proxy,fetchdoes connect throughHTTPS_PROXY. So users who turned this on were told the opposite of what happens, and users stuck behind a proxy never learned the workaround exists.The notice now states which of three cases applies:
on: the option is set and this Node supports it. The notice says the downloads go through the proxy (Node'sfetchthen also honoursNO_PROXY).available: this Node supports the option but it is not set. The old warning stays and adds "re-run withNODE_USE_ENV_PROXY=1set".unsupported: this Node has no such option. The old warning stays and says a newer Node release has it.How support is detected: the check asks the running Node for its list of accepted flags (
process.allowedNodeEnvironmentFlags). There is no hard-coded version table.--use-env-proxyis only counted when it appears inprocess.execArgvorNODE_OPTIONSas a whole word, so something like--use-env-proxy-foodoes not count.Docs: the "Proxy environment variables" section of
docs/troubleshooting.mdnow documents the opt-in.Built with
/pharn-dev-ship; stage artifacts are in.dev/features/proxy-env-opt-in/. Results:no-regressionsPASSType of change
feat— new stack option, wizard step, or command capabilityfix— bug fixdocs— docs-only changechore/refactor— tooling or internal restructure, no behavior changeArea(s) touched
lib/proxy-env | lib/proxy-env-format | docs
Checklist
.js-extension import convention.docs/troubleshooting.md.redactProxyUrlbefore it is shown.Quality gates
npm run check+npm run test:coveragepass locally (1370/1370; non-root user, node 22).npm run build(left to CI).Notes for the reviewer
LIMITS.md§3a andTHREAT-MODEL.mdstill say pharn cannot use a proxy at all. Agents are blocked from editing those files, so a maintainer needs to update them.🤖 Generated with Claude Code
https://claude.ai/code/session_01TvcuVhk8hTeDskp5pAJhnc
Generated by Claude Code