Problem
When a user runs supermodel in a second terminal window (or re-runs it after it's already watching), they see:
Error: UDP port 7734 already in use — is `supermodel watch` already running?
UDP port 7734 already in use — is `supermodel watch` already running?
This is accurate but unhelpful. The user doesn't know if this means everything is fine (watch is running in another window) or something is broken.
Better experience
Before failing, attempt to contact the existing instance on port 7734. If it responds (i.e. a healthy watch daemon is running):
supermodel is already watching this project.
Press Ctrl+C in the other terminal to stop it, or run 'supermodel status' to check.
If the port is in use but the daemon doesn't respond (stale bind):
Error: port 7734 is in use by another process. Try: lsof -i :7734
Notes
- This hits the first-run path too: a user who runs
supermodel after setup completes and the watch daemon is still running in the install terminal would see this error in any new terminal.
- A simpler short-term fix: just change the message to be more explicit: "Watch is already running in another terminal. That's fine — your graph is being kept up to date."
Problem
When a user runs
supermodelin a second terminal window (or re-runs it after it's already watching), they see:This is accurate but unhelpful. The user doesn't know if this means everything is fine (watch is running in another window) or something is broken.
Better experience
Before failing, attempt to contact the existing instance on port 7734. If it responds (i.e. a healthy watch daemon is running):
If the port is in use but the daemon doesn't respond (stale bind):
Notes
supermodelafter setup completes and the watch daemon is still running in the install terminal would see this error in any new terminal.