mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #55] [CLOSED] fix(tools-image): guarantee localhost resolution for images with empty /etc/hosts #144
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#144
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/AgentENV/pull/55
Author: @JoyboyBrian
Created: 7/29/2026
Status: ❌ Closed
Base:
main← Head:fix/guest-hosts-localhost📝 Commits (6)
644083ffix(tools-image): guarantee localhost resolution for images with empty /etc/hosts8eef2acfix(tools-image): address localhost bootstrap review4a153b9fix(tools-image): harden localhost bootstrapcc1029cfix(tools-image): assert helper success in tests5928df5chore(tools-image): clarify test host supportb163e2ffix(tools-image): simplify localhost bootstrap to inline pivot-init check📊 Changes
2 files changed (+33 additions, -7 deletions)
View changed files
📝
scripts/tests/e2e/e2b_python_sdk_compat.py(+19 -0)📝
tools-image/pivot-init(+14 -7)📄 Description
Summary
Fix guest
localhostresolution when an OCI image ships/etc/hostsas an empty placeholder or without canonical loopback mappings.This PR:
/etc/hostsfallback inpivot-initwith a small content-based check;127.0.0.1 localhostor::1 localhostmappings;Problem
pivot-initcurrently initializes/etc/hostsonly when the file does not exist:Many OCI images—including
ubuntu:22.04andubuntu:24.04—ship a zero-byte/etc/hostsbecause container runtimes normally replace it at startup. AgentENV boots the image as a VM and does not perform that container-runtime mount, so these guests can start without a usablelocalhostmapping.For example:
exits with status 2 in an affected guest. A plain
getent hosts localhostis not a reliable probe because an upstream DNS resolver may answer forlocalhost.Change
At boot,
pivot-initnow:/etcif necessary;The check is idempotent across repeated boots and pause/resume cycles. Existing
/etc/hostscontent is retained.The implementation intentionally remains a small inline bootstrap block. It does not introduce a separate helper, locking, or special symlink replacement policy;
pivot-inithas a single caller before user init.Validation
scripts/tests/e2e/e2b_python_sdk_compat.pythat verifies the sandbox created from the built template contains a loopback-to-localhostmapping.ubuntu:24.04:getent -s files hosts localhostexits 2;localhostresolution succeeds;Tools-drive rollout
This PR changes tools-image source only. It does not publish a tools drive or bump
[tools].version.The published AgentENV
v0.1.1release still pins and bundles tools drive0.1.0, so it does not contain this fix. Rolling the change out requires publishing a new immutable tools-drive version and updatingconfig/deps_manifest.toml.Existing snapshots remain pinned to the
tools_drive_versionrecorded when they were created and are not modified or invalidated by that future manifest bump. Nodes that may restore historical snapshots must retain the corresponding historical tools-drive versions.Changing snapshot-based template rebuilds to cold-boot with a newer tools drive, or automatically provisioning missing historical versions, is outside the scope of this focused fix.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.