* fix: warn when localhost resolves to ::1 but Studio is bound only to 127.0.0.1
* studio: fix localhost/::1 warning suppression and cover _run wiring
Addresses the Codex review on #5994 plus review-team findings:
- Remove the `_local_port_open("::1", port)` early-return. Studio binds
127.0.0.1 only, so a successful connect to ::1:<port> means a *different*
process is there -- exactly when http://localhost opens the wrong service
and the user most needs the warning. Dropping the probe also removes the
~0.25s startup latency and the probe/warn race.
- Extract the banner/warning block from `_run` into `_emit_startup_output`
so the wiring is unit-testable, and make the mismatch vs wildcard paths
an explicit if/elif (they are mutually exclusive by construction).
- Hoist the `_working_local_url` confirmation out of the try block and
reorder `_stdout_color_ok` before its only caller.
- Tests: add `_emit_startup_output` integration coverage (banner
include_stop_hint, warning emission, single stop hint), a regression test
that ::1 being occupied does NOT suppress the warning, dual-stack and
non-positive-port cases; drop the unreachable `None` getaddrinfo arm.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Etherll <mrmrmidessam@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>