PROXY_PORT is documented in --help but read nowhere in 2.1.2 (regression of #81)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 812
- Forks
- 175
- Avg merge
- 2m
- Merged PRs (30d)
- 3
Description
Summary
PROXY_PORT is advertised in --help but is read nowhere in the published dist/ of agentic-flow@2.1.2. The proxy port is the hardcoded class field dist/cli-proxy.js:47.
This appears to be a regression of the fix described in #81, which reported that npm 2.0.1-alpha.5 already shipped proxyPort = parseInt(process.env.PROXY_PORT || '3001'). Both halves of that fix are absent in 2.1.2.
Reproduce
npm i -g agentic-flow@2.1.2
# documented:
agentic-flow --help | grep PROXY_PORT
# PROXY_PORT Proxy server port (default: 3000)
# implemented:
grep -rn "env.PROXY_PORT" "$(npm root -g)/agentic-flow/dist"
# (no output)
grep -n "proxyPort = " "$(npm root -g)/agentic-flow/dist/cli-proxy.js"
# 47: proxyPort = 3000;
The :3000 fallbacks in dist/agents/claudeAgentDirect.js are also still hardcoded — the second half of the fix #81 described:
29: baseURL: process.env.GEMINI_PROXY_URL || 'http://localhost:3000'
35: baseURL: process.env.REQUESTY_PROXY_URL || 'http://localhost:3000'
41: baseURL: process.env.OPENROUTER_PROXY_URL || 'http://localhost:3000'
Impact
Exactly what #81 predicted. Any process already holding :3000 — Docker Desktop, a Next.js dev server — breaks every proxied provider, and PROXY_PORT cannot move it because nothing reads it. The failure is quiet: the proxy logs ✅ Anthropic Proxy running at http://localhost:3000 and the SDK then fails with ECONNREFUSED / an empty response, so it reads as a model problem rather than a port collision.
I hit this while a dev server held :3000; the only available workaround was to stop that server.
Suggested fix
dist/cli-proxy.js:47 (and the corresponding source):
- proxyPort = 3000;
+ proxyPort = parseInt(process.env.PROXY_PORT || '3000', 10);
Plus the three claudeAgentDirect.js fallbacks, so a non-default port reaches every provider path and not only the ones that route via ANTHROPIC_BASE_URL.
Verified locally against 2.1.2: with that one-line change, a run succeeds on :3999 while another process holds :3000. Happy to open a PR if useful.
Environment
agentic-flow@2.1.2 · node v22.23.0 · npm 10.9.8 · macOS (Darwin 25.6.0)
Related: #81 (original report of this fix)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect dist/cli-proxy.js:47 and the corresponding source, then check the three provider fallbacks in dist/agents/claudeAgentDirect.js. Verify that PROXY_PORT reaches every proxy path and that a non-default port works while port 3000 is occupied.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- backend, cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100