Skip to content

fix(list): probe both IPv4 and IPv6 loopback for the URL health check - #4694

Merged
max-sixty merged 1 commit into
max-sixty:mainfrom
saltcoffee:fix/list-url-health-check-host
Nov 5, 2026
Merged

max-sixty merged 1 commit into
max-sixty:mainfrom
saltcoffee:fix/list-url-health-check-host

Conversation

@saltcoffee

@saltcoffee saltcoffee commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The URL health check only probed 127.0.0.1. A dev server bound only to ::1 — Vite's default localhost on macOS — is reachable but shown as inactive.

Fix

Probe both loopback families (127.0.0.1 and ::1) for the port parsed by parse_port_from_url, using the matching socket domain. Any success counts as active. This is a local default assumption; the check never resolves DNS or contacts a remote host.

parse_port_from_url is unchanged — no host parsing, IPv6 literals, userinfo, or scheme-less handling.

Tests

Added a unit test that binds 127.0.0.1 and [::1] listeners and asserts the URL status is active for each, exercising both socket-domain branches.

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A URL with a non-loopback IP literal (http://192.168.1.20:3000) now gets a TCP connect to that host from every wt list and statusline render. That contradicts the docstring's own "a health check must not touch the network", and AGENTS.md → Network Access ("Worktrunk touches the network only when the user asks for it"). A list.url template configures a display link; it isn't a request to probe a remote host. Before this PR, such a URL probed 127.0.0.1, which was wrong but local. Restricting the literal case to ip.is_loopback() keeps the health check local. A non-loopback literal would then get either the loopback pair or no check (active: None). Which of those is right is a maintainer call; probing the remote host shouldn't be the default.

Comment thread src/commands/list/collect/tasks.rs Resolved
worktrunk-bot
worktrunk-bot previously approved these changes Nov 4, 2026

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR title and the description's Fix and Problem sections still say an explicit IP literal is probed as given ("probe dev-server URL on its own host"). After the latest commit, only a loopback literal is probed as given. A non-loopback or unspecified literal falls back to the loopback pair, so the "URL pointing at another address probed 127.0.0.1" problem is deliberately left as is. The squash title becomes the commit that the changelog is generated from, so it's worth updating it to describe what now ships, e.g. fix(list): probe dev-server URL on both loopback families.

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codecov/patch failed on this commit at 89.65%: 9 of 87 added lines are uncovered. Seven of them are probe_addr. The suite sets WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK, so the probe never runs in tests. On main the old inline IPv4 probe was uncovered for the same reason, but the IPv6 domain branch is new and has no coverage. Probing a bound loopback listener directly covers the function without touching that env gate (suggestion inline). The remaining two lines are the compute_url_status call site, which sits behind the env gate as before.

I've withdrawn my approval until coverage is resolved. AGENTS.md → Coverage requires explicit approval before merging with a failing codecov/patch.

Comment thread src/commands/list/collect/tasks.rs Resolved
@worktrunk-bot
worktrunk-bot dismissed their stale review November 4, 2026 09:11

codecov/patch failed — probe_addr is uncovered; see follow-up review.

@max-sixty

Copy link
Copy Markdown
Owner

Thanks — probing both 127.0.0.1 and ::1 fixes the real case, since Vite's default localhost binds only ::1 on macOS. Could you cut the PR down to that? Keep parse_port_from_url as it is and drop the host parsing, IPv6-literal and userinfo handling, and scheme-less URLs (the scheme change also turns localhost:3000 into a link that doesn't open). Please retitle it to match.

This was written by Claude Code on behalf of max-sixty

@saltcoffee
saltcoffee force-pushed the fix/list-url-health-check-host branch from c9e56e2 to 678062f Compare November 5, 2026 06:27
worktrunk-bot
worktrunk-bot previously approved these changes Nov 5, 2026
@saltcoffee

Copy link
Copy Markdown
Contributor Author

Thanks — probing both 127.0.0.1 and ::1 fixes the real case, since Vite's default localhost binds only ::1 on macOS. Could you cut the PR down to that? Keep parse_port_from_url as it is and drop the host parsing, IPv6-literal and userinfo handling, and scheme-less URLs (the scheme change also turns localhost:3000 into a link that doesn't open). Please retitle it to match.

This was written by Claude Code on behalf of max-sixty

Thanks for the guidance — really appreciate it. I've reduced this to the minimal change: parse_port_from_url untouched, now probing both 127.0.0.1 and ::1; removed the host parsing, IPv6-literal/userinfo and scheme-less handling, added a test for both families, and retitled the PR. Happy to tweak further — thanks again!

@worktrunk-bot

Copy link
Copy Markdown
Collaborator

@saltcoffee the title still reads "fix(list): probe dev-server URL on its own host and both loopback families", so the rename may not have saved. Something like fix(list): probe both IPv4 and IPv6 loopback for the URL health check (your commit headline) matches what ships now. The squash title becomes the changelog entry.

@saltcoffee saltcoffee changed the title fix(list): probe dev-server URL on its own host and both loopback families fix(list): probe both IPv4 and IPv6 loopback for the URL health check Nov 5, 2026

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lint fails at this head: cargo fmt wants the new IPv6 test's assert! argument split onto its own lines. The inline suggestion is rustfmt's output from the CI log, so applying it should clear the check.

Comment thread src/commands/list/collect/tasks.rs Resolved
@worktrunk-bot
worktrunk-bot dismissed their stale review November 5, 2026 07:01

Superseded by the review on a later commit.

A dev server may bind only one loopback family: Vite's default
`localhost` listens only on `::1` on macOS, so probing only `127.0.0.1`
reported a reachable server as dead. Probe both `127.0.0.1` and `::1`
(any success counts), keeping the check local.

`parse_port_from_url` is unchanged: no host parsing, IPv6 literals,
userinfo, or scheme-less handling. Tests cover IPv4 and IPv6 loopback
listeners, skipping the IPv6 case where `::1` is unavailable.
@saltcoffee
saltcoffee force-pushed the fix/list-url-health-check-host branch from 3eeaae3 to 7d2da86 Compare November 5, 2026 07:03
@max-sixty
max-sixty merged commit 8073cb2 into max-sixty:main Nov 5, 2026
37 checks passed
max-sixty added a commit to max-sixty/tend that referenced this pull request Nov 21, 2026
Tend's review approved any PR with no defect. Submit said "If there are
no issues, approve with an empty body — silence means correct", and a
`code-review` finding needs a file, line and failure scenario, so a
correct change that wasn't worth its cost got an `APPROVE` unless
another check, such as the duplication check, turned its cost into a
finding. A repository overlay asking for a `COMMENT` on such changes
didn't override that default: worktrunk's reviews opened its
proportionality rule and approved anyway (max-sixty/worktrunk#4664,
max-sixty/worktrunk#4665, max-sixty/worktrunk#4666,
max-sixty/worktrunk#4670, max-sixty/worktrunk#4689,
max-sixty/worktrunk#4694).

Submit now says an `APPROVE` tells the maintainer the whole PR is worth
merging. Before one, including after a trivial increment, the session
says who loses what if the PR never merges and how they come to need it,
what it adds that later changes must keep working, and the cheapest
other way to get the benefit. It approves when the benefit pays for what
the PR adds and nothing materially cheaper exists; otherwise it posts a
`COMMENT` naming the cost or the cheaper way. On a self-authored PR,
where the review stays silent instead of approving, the same weighing
runs before that silence, so a correct bot PR that isn't worth merging
is raised as a concern, which Review's "carry its weight" bullet used to
ask for. That bullet goes, since Submit now owns the judgment. A
`COMMENT` that holds the verdict names its reason once, as a
merge-readiness hold already did, so a later push doesn't restate it,
and a re-targeted review that empties takes its verdict from Submit
instead of approving.

## Evidence

Eleven trajectory cases (`evals/cases/review-worth-*`) replay real
worktrunk PRs at their reviewed heads. On 20 Nov, with main (including
#1646 and #1712) merged in, this PR's review skill ran against main's,
three attempts per case per arm. On the four PRs that independent
reviewers judged not worth merging as written (max-sixty/worktrunk#4664,
max-sixty/worktrunk#4665, max-sixty/worktrunk#4666,
max-sixty/worktrunk#4694), these attempts held the verdict and named the
cost or a cheaper route:

| Executor | main | This PR |
| --- | --- | --- |
| Codex gpt-6.1-sol | 6 of 10 (2 attempts failed on model capacity) | 10
of 12 |
| Claude Opus 5.5 | 2 of 12 | 7 of 12 |

- Main's six Codex holds are on max-sixty/worktrunk#4666 and
max-sixty/worktrunk#4694, which the old text approved in all three
attempts on the 5 Nov base. Each review of max-sixty/worktrunk#4666
names the second cache as a copy of the existing cached `git remote
get-url` lookup, the kind of copy #1646 widened the duplication check to
flag; the reviews of max-sixty/worktrunk#4694 name the hand-written URL
parsing as more than the IPv6 fix needs. This PR also holds
max-sixty/worktrunk#4665 and max-sixty/worktrunk#4664 (2 of 3 each),
which main's text approved in every attempt that completed.
- On the PRs that should be approved (max-sixty/worktrunk#4334,
max-sixty/worktrunk#4469, max-sixty/worktrunk#4668,
max-sixty/worktrunk#4669, max-sixty/worktrunk#4680), Codex approved in
all 15 attempts on each arm. Claude, run on this PR's text only, held
max-sixty/worktrunk#4668 in 3 of 3, citing a `git rev-parse` per noted
directory on every pane refresh and a narrower fix, and held
max-sixty/worktrunk#4669 (2 of 3) and max-sixty/worktrunk#4680 (1 of 3)
over defects.
- On the 5 Nov base, not re-run: a standing hold that should survive a
test-only push stayed silent 6/6, a hold on a per-render cost stayed
held 6/6, and `review-landing-continuation` passed 3/3 on Codex.

## Costs

A trivial follow-up push now gets a whole-PR read.

> _This was written by Claude Code on behalf of max-sixty_
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.

3 participants