Skip to content

fix: friendlier error when watch is already running on port 7734#165

Merged
greynewell merged 3 commits intomainfrom
fix/port-conflict-ux
Apr 30, 2026
Merged

fix: friendlier error when watch is already running on port 7734#165
greynewell merged 3 commits intomainfrom
fix/port-conflict-ux

Conversation

@greynewell
Copy link
Copy Markdown
Contributor

@greynewell greynewell commented Apr 30, 2026

Closes #156.

When supermodel is already running in another terminal, the port-in-use error is confusing. Improve the message to tell users their graph is already being kept up to date.

TDD: failing test first.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced error detection and messaging when the daemon's UDP port is already in use.
    • Improved cross-platform compatibility for handling address-in-use errors across Windows and POSIX systems.
    • Users now receive clearer, more actionable error messages with specific guidance for resolving port conflicts and managing concurrent daemon instances.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: be974202-4d06-4dd3-8ba8-9a691dd5e857

📥 Commits

Reviewing files that changed from the base of the PR and between ecb93fc and 68ab0a5.

📒 Files selected for processing (2)
  • internal/shards/daemon.go
  • internal/shards/daemon_test.go

Walkthrough

The daemon's UDP listener now detects "address already in use" errors more reliably across platforms and returns a friendlier error message directing users to check or stop the other running watcher instance. A corresponding integration test validates this behavior.

Changes

Cohort / File(s) Summary
UDP Port Conflict Detection
internal/shards/daemon.go
Adds isAddrInUse helper function to cross-platform detection of address-in-use errors (handles both POSIX syscall.EADDRINUSE and Windows via error-message substring matching). Run() now returns a user-directed error message when the UDP port is already bound and filesystem watching is disabled.
Port Conflict Test
internal/shards/daemon_test.go
New integration test TestPortConflict_FriendlyMessage that simulates UDP port contention by pre-binding a listener, verifies daemon startup fails, and validates the error message contains helpful guidance for the user.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • jonathanpopham

Poem

🚨 When ports collide and daemons fight,
A helper function sets things right.
Now users know: "Stop the other watcher!" ✨
No more confusion—clarity matters! 🎯

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/port-conflict-ux

Review rate limit: 0/5 reviews remaining, refill in 56 minutes and 37 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

greynewell and others added 2 commits April 30, 2026 10:48
Closes #156.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Closes #156.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@greynewell greynewell marked this pull request as ready for review April 30, 2026 14:58
@greynewell greynewell merged commit bd1e2ad into main Apr 30, 2026
7 checks passed
@greynewell greynewell deleted the fix/port-conflict-ux branch April 30, 2026 14:58
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.

ux: 'port 7734 in use' error should detect existing watch instance and tell user what to do

1 participant