8000 T26 — Retry the hostname listener and clear its warning without a restart by minimal-foundry[bot] · Pull Request #1681 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

T26 — Retry the hostname listener and clear its warning without a restart - #1681

Merged
norrietaylor merged 7 commits into
mainfrom
agent/1620-retry-the-hostname-listener-and-clear-its-warnin
Sep 25, 2026
Merged

norrietaylor merged 7 commits into
mainfrom
agent/1620-retry-the-hostname-listener-and-clear-its-warnin

Conversation

@minimal-foundry
Copy link
Copy Markdown
Contributor

T26 — Retry the hostname listener and clear its warning without a restart

slice: S6
kind: task
covers: NET-020, NET-021, NET-022
size: M
est: 200 code, 260 tests
executor: agent
difficulty: routine
model: standard
diagnostics: the bundle's daemon log tail carries each failed bind with its reason and next retry, and the recovery
observability: one warn log line per failed bind with the reason and the next retry delay; one info line when the listener recovers
layers:
- daemon:
- crates/minimald/src/server.rs: start_host_proxies retries bind and publish with backoff and clears the unavailable flag on success
- crates/minimald/src/net/proxy.rs: bind_listener carries one remedy text for every failure
test: cargo nextest run -p minimald listener_retries_with_backoff
- cli:
- crates/minimal/src/cmd/list.rs: warn_if_hostname_routing_down prints the reason and the remedy
- crates/minimal/tests/cli.rs: hosts the report and clear tests
test: cargo nextest run -p minimal listener_failure_reported_with_remedy
test: cargo nextest run -p minimal ls_warning_clears_on_recovery
produces: none
consumes: none
proof: With the proxy port occupied, activate and ls print the reason and the remedy; free the port and ls clears the warning without a daemon restart.

Out of time

The coder ran out of its 3000s before it finished. If it left work uncommitted, its last commit is the runtime's snapshot of that work as it stood — the commit message says so — and not a finished step: it may not build or pass its tests. So this PR is a draft.

Proof

With the proxy port occupied, activate and ls print the reason and the remedy; free the port and ls clears the warning without a daemon restart.

Commit headers reworded by the runtime to fit commitlint. The header the coder wrote is the first paragraph of each of these commits' bodies:

  • feat(minimal): the coder's uncommitted work as it stood when its 3000s ran out

Tests

line exit tail
cargo nextest run -p minimald listener_retries_with_backoff 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-49ac... Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/5dc43/tree/crates/args) Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/5dc43/tree/crates/ot) C
cargo nextest run -p minimal listener_failure_reported_with_remedy 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-bfe5... Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/0c2a3/tree/crates/ot) Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/0c2a3/tree/crates/args) C
cargo nextest run -p minimal ls_warning_clears_on_recovery 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-7b2b... Compiling stdlib v0.0.20 (/home/runner/.local/state/minimal/sessions/051d7/tree/crates/stdlib) Compiling version v0.6.0 (/home/runner/.local/state/minimal/sessions/051d7/tree/crate

Verify

min task run agent-verify passed ([tasks.verify]).

Closes #1620

A host-side proxy whose listen address is held at boot no longer stays
down until a daemon restart. start_host_proxies now drives each proxy's
bind - and, in a microVM, its host-loopback publish - on a detached task
that retries with a doubling, capped backoff until it succeeds (NET-021),
so a freed port is picked up in seconds without touching the daemon.

bind_listener returns a BindFailure carrying the reason (address and OS
error) and the one remedy that clears it, authored once in proxy.rs; the
startup retry logs one warning per failed attempt with that report and
the next retry delay, records it on the proxy_unavailable note the
ListSessions RPC serves, and on recovery logs one info line and clears
the note (NET-022). The mTLS proxy rides the same loop.

The publish failure report gains its remedy (check the host gvproxy), and
the publish attempt cap now bounds a single attempt rather than the whole
startup, since the retry supplies the next attempt itself.
…s ran out

the coder's uncommitted work as it stood when its 3000s ran out

The coder was stopped at the end of its time with these changes
not committed. The runtime committed its working tree as it stood so
the work is kept: this commit is a snapshot, not a finished step, and
may not build or pass its tests.
@coderabbitai
coderabbitai Bot commented Sep 24, 2026 •
Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: fdffd335-8802-4ecd-85d4-48ce3c236b21

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed against the T26 plan block on #1437. Taking it out of draft: the last commit is the runtime's budget snapshot, but its content is the finished CLI layer (list.rs, the two cli.rs tests, a rustfmt reflow of server.rs), and the head builds and passes every plan test line in CI.

Plan compliance. Exactly the four files the block names.

  • crates/minimald/src/server.rs: start_host_proxies spawns drive_proxy_until_serving per proxy (egress, and mTLS under networking-proxy), retrying bind and the DM1 publish with RetryBackoff from 1 s doubling to a 30 s cap, recording reason plus remedy per failure and clearing the note on success.
  • crates/minimald/src/net/proxy.rs: bind_listener returns Result<TcpListener, BindFailure> carrying reason, remedy and reported(); the warn moved to the caller, which knows the retry delay.
  • crates/minimal/src/cmd/list.rs: hostname_routing_warning builds reason, remedy and the retry hint; used by cmd_ls and by activate.
  • Observability: one warn! per failed attempt with reason, report and next_retry; one info! with status="recovered" on success.

Test lines. All three present and green in the CI tests job (run 35974917428): listener_retries_with_backoff asserts the three warnings, the doubling delays and cap, the note text, and the clear plus recovered log after the port frees; listener_failure_reported_with_remedy and ls_warning_clears_on_recovery drive the compiled min against the in-process test server and assert the ls and session activate stderr. The CLI tests hold an ephemeral port and run the real retry loop through a test-support re-export rather than occupying :7654; same code path, not the production address.

Non-blocking.

  • The note is now set asynchronously after Server::run starts accepting, so a min ls racing the very first bind attempt can miss the warning for a few milliseconds.
  • The DM1 publish retry has no test; the plan did not ask for one.
  • hostname_routing_warning is pub in a bin crate; pub(crate) would do.

Approving; merge waits on the runtime review and CodeRabbit now that it is out of draft.

@minimal-foundry
minimal-foundry Bot commented Sep 25, 2026 •
Copy link
Copy Markdown
Contributor Author

Approved: no findings at 61b5b456149f.

Nothing to do.

Verdict APPROVE, posted as a comment: the App cannot review its own pull request; the check and the label carry it.

Clobber: none: git log on both daemon files shows the earlier bind_listener history and no silent revert of a recent fix.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

minimal-review — advisory review

Verdict COMMENT — 1 finding, 1 inline.

Comment thread crates/minimal/src/cmd/list.rs Resolved
The hostname-routing-down warning is shared by `min ls` and `min
session activate`, but its recovery sentence hardcoded "run `min ls`
again to check". A user mid-activate was told to switch to another
command to watch the recovery, which reads as a non-sequitur.

`hostname_routing_warning` now takes the command the warning rides on:
each path names itself, and the sentence says to re-run the command the
user is already in. Review finding on #1681 (low, api-design).
@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

minimal-review — advisory review

Verdict COMMENT — 1 finding, 1 inline.

Comment thread crates/minimal/src/cmd/list.rs Resolved
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on the runtime's review findings, pushed as 061bfc94d90b.

line exit tai 8000 l
cargo nextest run -p minimald listener_retries_with_backoff 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-19e4... Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/f0d76/tree/crates/ot) Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/f0d76/tree/crates/args) C
cargo nextest run -p minimal listener_failure_reported_with_remedy 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-d961... Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/31bf6/tree/crates/args) Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/31bf6/tree/crates/ot) C
cargo nextest run -p minimal ls_warning_clears_on_recovery 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-e51f... Compiling stdlib v0.0.20 (/home/runner/.local/state/minimal/sessions/1deec/tree/crates/stdlib) Compiling version v0.6.0 (/home/runner/.local/state/minimal/sessions/1deec/tree/crate

Verify min task run agent-verify passed.

Outside the task's layers::

  • crates/minimal/src/cmd/session.rs

Converted to a draft: something above needs a person before review.

Review threads the coder judged:

  • 👍 valid — crates/minimal/src/cmd/list.rs: Premise checks out: the shared warning hardcodes "run min ls again" and also prints from cmd/session.rs:261. Fixed by parameterizing the command: ls says "run min ls again to check", activate says "run min session activate again to check"; both assertions pinned in listener_failure_reported_wi

With the proxy port occupied, min session activate and min ls each print the failure's reason, the remedy, and a recovery sentence that names the command the user just ran (activate no longer says to re-run min ls); free the port and min ls clears the warning without a daemon restart.

Notes from the agent: Revise round 1: addressed the single review thread (hardcoded "run min ls again" in the shared warning). Fix: hostname_routing_warning/warn_if_hostname_routing_down take the command the warning rides on; each call site names itself. crates/minimal/src/cmd/session.rs is outside the layers' cli file list but had to be touched — it is the only other caller and the parameterized signature needs its argument; no other behavior changed there. The daemon layer (server.rs, net/proxy.rs) was untouched this round; its test line still passes against the round-0 code. cargo fmt -p minimal and cargo clippy -p minimal --all-targets clean.

@norrietaylor
Copy link
Copy Markdown
Member

/revise The branch now conflicts with main after #1685 merged (crates/minimald/src/net/proxy.rs). Merge origin/main, resolve the conflict keeping both #1685's port refusal and this PR's BindFailure changes, and re-run the three plan test lines. No other change.

… merge

Completes the merge from origin/main by resolving the proxy.rs conflict.

The incoming main version returned Option<TcpListener> and logged internally,

which broke server::drive_proxy_until_serving and listener_retries_with_bac
8000
koff.

Restore BindFailure with reason + remedy so the retry loop owns the log line and

reports the same text through ListSessions, min ls and min session activate.
@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

minimal-review — approved

Verdict APPROVE — No findings.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Sep 25, 2026
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 2 of 10 on a /revise note, pushed as 61b5b456149f.

Resolved conflicts in: crates/minimald/src/net/proxy.rs

line exit tail
cargo nextest run -p minimald listener_retries_with_backoff 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-bab9... Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/661e0/tree/crates/args) Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/661e0/tree/crates/ot) C
cargo nextest run -p minimal listener_failure_reported_with_remedy 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-9a7d... Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/3afae/tree/crates/args) Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/3afae/tree/crates/ot) C
cargo nextest run -p minimal ls_warning_clears_on_recovery 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-8a51... Compiling stdlib v0.0.20 (/home/runner/.local/state/minimal/sessions/afe0f/tree/crates/stdlib) Compiling version v0.6.0 (/home/runner/.local/state/minimal/sessions/afe0f/tree/crate

Verify min task run agent-verify passed.

Outside the task's layers::

  • crates/minimal/src/cmd/session.rs

Converted to a draft: something above needs a person before review.

With the proxy port occupied, min session activate and min ls print the reason and the remedy from the daemon's hostname-routing unavailable note; freeing the port lets the daemon's retry bind successfully, which clears the note so a later min ls no longer warns, all without restarting minimald.

Notes from the agent: Resolved an unresolved merge state on this branch: the latest merge from origin/main took an Option-returning bind_listener that logged internally, which broke server::drive_proxy_until_serving and the listener_retries_with_backoff test. Restored the task's BindFailure reason/remedy pair in bind_listener and updated the pre-existing bind_failure_warns_dns_proxy_unavailable test to assert that shape instead of internal logging. The other files in the merge were already staged and are now part of the completing commit.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft September 25, 2026 01:28
@norrietaylor
norrietaylor marked this pull request as ready for review September 25, 2026 01:32
@norrietaylor
norrietaylor enabled auto-merge (squash) September 25, 2026 01:33
@norrietaylor
norrietaylor merged commit b684267 into main Sep 25, 2026
33 checks passed
@norrietaylor
norrietaylor deleted the agent/1620-retry-the-hostname-listener-and-clear-its-warnin branch September 25, 2026 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

T26 — Retry the hostname listener and clear its warning without a restart

1 participant

0