Skip to content

fix: use 127.0.0.1 in internal HTTP clients to match daemon bind#436

Merged
tomasz-tomczyk merged 1 commit intomainfrom
fix/435-daemon-ipv6-localhost-mismatch
May 2, 2026
Merged

fix: use 127.0.0.1 in internal HTTP clients to match daemon bind#436
tomasz-tomczyk merged 1 commit intomainfrom
fix/435-daemon-ipv6-localhost-mismatch

Conversation

@tomasz-tomczyk
Copy link
Copy Markdown
Owner

Summary

  • Daemon binds IPv4-only on 127.0.0.1, but internal HTTP clients used http://localhost:<port>.
  • On macOS where localhost resolves to ::1 first and Go's happy-eyeballs fallback doesn't kick in (resolver config or fast ECONNREFUSED on the IPv6 attempt), the client gets connection refused instead of reaching the daemon.
  • Switched 5 internal client URLs to 127.0.0.1 (daemon health probes, waitForDaemonReady, review-cycle POSTs, fetchSessionFocus). User-facing display strings and openBrowser() calls keep localhost — browsers do their own happy-eyeballs and localhost reads better.

Test plan

  • go build ./... clean
  • go test ./... passes
  • pre-commit hook (gofmt + golangci-lint + tests) passes

Closes #435

🤖 Generated with Claude Code

The daemon binds IPv4-only on 127.0.0.1 but internal HTTP clients used
http://localhost:<port>. On macOS where the resolver returns ::1 first
and Go's happy-eyeballs fallback doesn't kick in (resolver config or
fast ECONNREFUSED on the IPv6 attempt), the client gets a connection
refused error instead of reaching the daemon.

Switch internal client URLs to 127.0.0.1 to match the bind. User-facing
display strings and openBrowser() calls keep "localhost" — browsers do
their own happy-eyeballs and "localhost" reads better.

Closes #435

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 2, 2026

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 67.39%. Comparing base (0a958f5) to head (8e6a41d).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
main.go 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #436      +/-   ##
==========================================
+ Coverage   67.36%   67.39%   +0.03%     
==========================================
  Files          35       35              
  Lines        9820     9820              
==========================================
+ Hits         6615     6618       +3     
+ Misses       2689     2687       -2     
+ Partials      516      515       -1     
Flag Coverage Δ
e2e 34.08% <33.33%> (ø)
unit 63.65% <66.66%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tomasz-tomczyk tomasz-tomczyk merged commit 95b8ab7 into main May 2, 2026
8 checks passed
@tomasz-tomczyk tomasz-tomczyk deleted the fix/435-daemon-ipv6-localhost-mismatch branch May 2, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Daemon connection refused on macOS: client uses localhost but server binds 127.0.0.1 (IPv4-only)

1 participant