8000 T146 — The hostname proxy comes back by itself, end to end by minimal-foundry[bot] · Pull Request #3039 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

T146 — The hostname proxy comes back by itself, end to end - #3039

Merged
norrietaylor merged 6 commits into
mainfrom
agent/2952-the-hostname-proxy-comes-back-by-itself-end-to-e
Nov 5, 2026
Merged

norrietaylor merged 6 commits into
mainfrom
agent/2952-the-hostname-proxy-comes-back-by-itself-end-to-e

Conversation

@minimal-foundry
Copy link
Copy Markdown
Contributor

T146 — The hostname proxy comes back by itself, end to end

slice: S23
kind: integration
covers: none
size: M
est: 60 code, 200 tests
executor: agent
difficulty: routine
model: standard
diagnostics: a person reads the case's output, which prints the activate and min ls lines it checked while the port was held and the proxied request's status after it freed, and the VM host daemon's retry lines in the case's work directory
observability: the case prints each step with the holder, the line it matched and the time the proxy took to serve after the port freed
layers:
- e2e:
- scripts/session-e2e.sh: adds the case proxy_recovers_when_its_port_frees: holds the hostname proxy's port with a listener, activates a box, checks the cause prints once at activate and on min ls's HOSTNAME PROXY row, frees the port, and opens the box by name through the proxy without a restart; with E2E_VM set it pins the proxy port so the VM starts with its proxy down
- crates/minimal/src/cmd/boxes/create.rs: the activate names: line reads the port the VM host daemon recovered, as min ls does
test: ./scripts/session-e2e.sh proxy_recovers_when_its_port_frees
test: cargo nextest run -p minimal listener_failure_reported_with_remedy
produces: none
consumes: none
depends on:
- blocked by #2942
- blocked by #2950
proof: When another program holds the hostname proxy's port, boxes and their VM still start, min session activate names the holder once and min ls names it on its HOSTNAME PROXY row, and box names open through the proxy without a restart once the port is free.

Proof

With another program on the hostname proxy's port, a box still starts. The new e2e case proxy_recovers_when_its_port_frees checks that min session activate names the cause once on its names: line and that min ls names it on its HOSTNAME PROXY row. On a VM lane the check includes who holds the port. The case then frees the port and checks that the box opens by name through the proxy on the same port, with no restart. A box activated after the recovery names that port on its names: line, because activate now falls back to the ports the VM host daemon serves on, as min ls does. On this host only the held-port half was observed. The recovery half did not run, because this host cannot start box processes.

Notes from the agent: Observed on this host (native lane, no /dev/kvm): the activate names: line and the min ls HOSTNAME PROXY row both named the held port 18756 once. The case stopped at the first min session exec: 'Minimal cannot read the box's process namespace'. ./scripts/session-e2e.sh session_exec fails the same way here, so the cause is the environment and not this case. The VM branch (E2E_VM, MINVMD_NODE_PROXY_PORT pin, minvmd retry records copied to $WORK/prf-retry.log) did not run anywhere. It needs the KVM or macOS lane with MINVMD_GVPROXY_BIN. Without a switch the VM branch reports NOT RUN. create.rs: the names: line now uses crate::cmd::list::reported_proxy_port with the ports from crate::cmd::session::vm_host_proxy_ports_at. That read runs only on a VM-backed host when the guest reported no port. The case is also in the whole-lane order, after hostnames_recover_and_two_daemons_route, and it stops both daemons at its end so that no later case inherits the pin. The added PRF_HOLD_PID/PRF_SEED_DIR globals and teardown lines are in scripts/session-e2e.sh.

Tests

line exit tail
./scripts/session-e2e.sh proxy_recovers_when_its_port_frees 1 EGRESS TITLE LAST ACTIVITY PROJECT PATH ------------------------------------ -------------------- --------------- ------------- --------------------------------------------- -------------------- ------------------- ------------
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-36d4... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling args v0.0.1 (/workbench/crates/args) Compiling client-config v0.0.1 (/wo

Verify

min task run agent-verify exited 100 under rustc 1.99.0, which the repository does not pin (1.99.1 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

dSpan {
            name: "session.message",
            fields: {
                "kind": "GetNetSwitch",
                "parent_span_id": "c7dd49a293bec7a4",
                "span_id": "f8ee9cf7907e4f92",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "GetDenyAllOptOut",
                "parent_span_id": "c7dd49a293bec7a4",
                "span_id": "4ff7ee1d6ae20d20",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "GetPaths",
                "parent_span_id": "c7dd49a293bec7a4",
                "span_id": "0d3d51d57d3e1113",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "c7dd49a293bec7a4",
                "queued_behind": "0",
                "span_id": "8bc10c08b3f884ad",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "c7dd49a293bec7a4",
                "queued_behind": "0",
                "span_id": "b3e751151adc77b6",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "b3e751151adc77b6",
                "span_id": "c7855b421b97fe3d",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "b3e751151adc77b6",
                "queued_behind": "0",
                "span_id": "ad3aa856435c91eb",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 
────────────
     Summary [  41.640s] 910 tests run: 909 passed, 1 failed, 1 skipped
        FAIL [   2.797s] (910/910) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
error: test run failed

Base

The base branch moved while the coder worked and was merged in before the tests ran. These files changed on BOTH sides since the branch point — read them first, because a rewrite from a stale reading can undo a merge without a conflict:

  • scripts/session-e2e.sh

Closes #2952

The activate names: line now falls back to the ports the VM host
daemon serves on when the guest reported none, as min ls does.
The case holds the proxy port, activates a box, checks the cause once at
activate and on min ls, frees the port, and opens the box by name through
the proxy without a restart. On a VM lane it pins MINVMD_NODE_PROXY_PORT.
@coderabbitai
coderabbitai Bot commented Nov 5, 2026 •
Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

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

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d39e37cb-9c03-4fa2-8c48-8ee5e3d801cb

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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@minimal-foundry
minimal-foundry Bot commented Nov 5, 2026 •
Copy link
Copy Markdown
Contributor Author

Approved: no findings at 2e1c9b203a57.

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 seen.

@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.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Nov 5, 2026
@minimal-arch minimal-arch Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

arch-review: PASS · the full ruling

The change conforms to §7.1 of the networking design. The names: line now takes the port from the VM host daemon, not the guest. It uses the same read as min ls, so line 244 holds. A down proxy still names its cause and no port, as line 254 requires. The new e2e case pins the port through the configured surfaces of line 264. The recovery half did not run on the author's host. The required KVM lane runs it with the switch set.

Ruled at 8ca829a against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.

@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on a failed check suite: the coder changed nothing. Round 1 changes no code. I diagnosed the failure, and the fix is outside the task's layers.

  1. Attempt 1 of test-kvm failed in step 'VM integration harnesses' (nextest exit 100), before the session e2e ran. This PR does not touch minvmd. On attempt 2 (job 127079587831) that step passed, so attempt 1 was a flake.

  2. Attempt 2 failed in the session e2e, in this PR's case: '::error::min ls does not name the held port 18756 on its HOSTNAME PROXY row (NET-020)'. The activate checks before it passed, and the holder check on the names: line passed too.

Cause: on a VM host whose live name surface is the proxy, crates/minimal/src/cmd/list.rs folds the VM host daemon's proxy-down cause into the BOX NAMES row (resolver::surface_beside_proxy_down gives LiveSurface::ProxyNotServing). resolver::proxy_down_line_beside then returns None, so the HOSTNAME PROXY row does not print. No 'listening on' row prints either, because serving_proxy_port is None and the VM serves no ports. NET-020 r…[truncated]

@norrietaylor
Copy link
Copy Markdown
Member

/revise Script only: change scripts/session-e2e.sh, not list.rs or resolver.rs. Your diagnosis is right, and the fix is inside this task's layers because the maintainer chose to change the case, not the product.

proxy_recovers_when_its_port_frees failed at min ls does not name the held port 18756 on its HOSTNAME PROXY row on both VM lanes (macOS e2e, and test-kvm attempt 2). On a VM host min ls prints the cause on the BOX NAMES row, once, with no HOSTNAME PROXY row:

BOX NAMES: <box>.min.internal: the hostname proxy is not serving: pid 55324 (Python) holds 127.0.0.1:18756. It starts serving by itself when the port is free. Finish setup: min finalize-install

  1. When $min_daemon is minvmd, read the cause from the BOX NAMES: row. Keep the same checks on it: the hostname proxy is not serving, 127.0.0.1:$prf_pin, and the holder check that follows. Check that the cause appears once in the min ls output.
  2. On a native lane, keep the HOSTNAME PROXY: check exactly as it is.
  3. Say in the case's comment that the VM row differs from NET-020 and link min ls prints a hostname listener failure on BOX NAMES on VM hosts, where NET-020 says the hostname-proxy row #3046, and change the ::error:: text so that it names the row the lane reads.
  4. The recovery half of this case has not run on any lane yet, because the case stopped here each time. Read each later check against the VM path in list.rs before you push. After recovery the cause must be gone from whichever row held it, and HOSTNAME PROXY: must name the port.

On a VM host min ls prints the proxy cause on the BOX NAMES row and no
HOSTNAME PROXY row while the port is held (#3046). The native lane keeps
the HOSTNAME PROXY check. After the recovery the case checks that no row
names the cause and that HOSTNAME PROXY names the port.
@minimal-arch minimal-arch Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

arch-review: PASS · the full ruling

The new commit changes only the e2e case. On a VM lane the case reads the proxy cause from the BOX NAMES row, and it now requires that min ls prints the cause once. Section 7.1 line 254 requires only that a failed bind is a surfaced error, and the case still proves that on both lanes. The row difference from NET-020 is in code that #3005 owns, and #3046 tracks it. Add #3046 to the PR body as a residual. The VM leg did not run yet. CI on the KVM and macOS lanes is its proof.

Ruled at af0151a against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.

@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.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

On a native developer host with no box sandbox, a host-address box
gets no PID namespace of its own, so every exec into it fails. The case
now gates the responder step on an exec, as
host_address_names_and_host_alias does: NOT RUN on a native developer
run, a failure on CI or a VM lane.
@minimal-arch minimal-arch Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

arch-review: PASS · the full ruling

This push adds one gate to the e2e case. The gate records NOT RUN when a native developer host cannot run a box, and it fails the case on CI and VM lanes. That copies the gate in proof_host_address_names_and_host_alias, and the CI legs stay hard. The design does not govern e2e skip gates, and the compare does not touch any other part of the change. The PASS on af0151a7 stands for this head.

Ruled at 2e1c9b2 against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
8BD0
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.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

@minimal-foundry
Copy link
Copy Markdown
Contributor Author

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

line exit tail
./scripts/session-e2e.sh proxy_recovers_when_its_port_frees 0 the 'min' and 'minimald' under /work/build-cache/target/debug report different versions; rebuilding the pair no usable 'min' and 'minimald' pair on PATH or under target/; building the pair this run drives (cargo build --locked -p minimal --bin min -p minimald --bin minimald) built the pair: /work/bu
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-b4e5... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workb

Verify min task run agent-verify exited 100 under rustc 1.99.0, which the repository does not pin (1.99.1 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

dSpan {
            name: "session.message",
            fields: {
                "kind": "GetNetSwitch",
                "parent_span_id": "3b18464a7613c951",
                "span_id": "14fc2203ccfdd252",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "GetDenyAllOptOut",
                "parent_span_id": "3b18464a7613c951",
                "span_id": "d0019062db484812",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "GetPaths",
                "parent_span_id": "3b18464a7613c951",
                "span_id": "290414fb8cbc2086",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "3b18464a7613c951",
                "queued_behind": "0",
                "span_id": "ca7408d4f918df5b",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "3b18464a7613c951",
                "queued_behind": "0",
                "span_id": "4db1477eb511ee20",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "4db1477eb511ee20",
                "span_id": "493882417fc16168",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "4db1477eb511ee20",
                "queued_behind": "0",
                "span_id": "313b21f042f0b9b0",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 
────────────
     Summary [  74.294s] 926 tests run: 925 passed, 1 failed, 1 skipped
        FAIL [   3.650s] (926/926) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
error: test run failed

On a VM lane the case now reads the held-port cause from the BOX NAMES row of min ls. It checks the port, the holder and that the cause prints once. A native lane keeps the HOSTNAME PROXY check. After the port frees, the case checks that no min ls row names the cause and that the HOSTNAME PROXY row names 127.0.0.1: as listening.

Notes from the agent: Script-only round, as the /revise note asked. Changed only scripts/session-e2e.sh. (1) On minvmd the min ls check reads 'BOX NAMES:', with the same checks for 'the hostname proxy is not serving', 127.0.0.1:$prf_pin and the holder. It also checks that the cause appears once in the min ls output. (2) The native lane keeps the HOSTNAME PROXY check as it was. (3) The case comment says the VM row differs from NET-020 and links #3046. The ::error:: texts name the row the lane reads. (4) I read the later checks against the VM path. In list.rs, serving_proxy_port is None while proxy_down is set. surface_beside_proxy_down moves the cause onto BOX NAMES, so no HOSTNAME PROXY row prints while the port is held. The 'listening on' check during the hold stays valid. After the recovery, proxy_down clears and reported_proxy_port falls back to the VM host daemon's served ports, so HOSTNAME PROXY names the port. The post-recovery check now fails if any row still names the cause, not only the first HOSTNAME PROXY row. It retries min ls for up to 10 s, so the listing can catch up with the proxy. The second activate reads the same fallback in create.rs. The minvmd record 'the hostname proxy is serving after its port freed' is at info level in proxy_reclaim.rs, and the case's RUST_LOG keeps minvmd=info. The recovery half is still not run on any lane: this box has no /dev/kvm, and its native run stopped at the box spawn because of the nested-sandbox limit.

@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.

Approved at 2e1c9b2. proxy_recovers_when_its_port_frees ran to the end on both VM lanes: the box started with the port held, the cause printed once at activate and on min ls, and the box answered by name about a second after the port freed, with no restart. The names: line now falls back to the port the VM host daemon serves on, as min ls does. The BOX NAMES row on VM lanes differs from NET-020, and #3046 tracks it. CI, arch-review and minimal-review pass.

@norrietaylor
norrietaylor added this pull request to the merge queue Nov 5, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 5, 2026
@norrietaylor
norrietaylor added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit 03e3df9 Nov 5, 2026
36 checks passed
@norrietaylor
norrietaylor deleted the agent/2952-the-hostname-proxy-comes-back-by-itself-end-to-e branch November 5, 2026 17: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.

T146 — The hostname proxy comes back by itself, end to end

1 participant

0