diff --git a/CHANGELOG.md b/CHANGELOG.md index 11dfae5f..19294598 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Platform releases use `vX.Y.Z` tags and publish `ghcr.io/tencent/loopforge`. Loo - On macOS `/bin/bash` 3.2, a missing local image or a failed automatic mirror pull no longer aborts `./start.sh` before the official image pull. - `./start.sh` and `./start.sh pull` time `ghcr.io` and `ghcr.nju.edu.cn`. Nanjing is used only when the ghcr.io manifest digest was verified and the mirror returned the same digest; the pull is that digest, then tagged back to the name pinned in `compose.yaml`. A missing official digest, a digest mismatch, or a failed mirror pull stays on `ghcr.io`. `MIRROR=ghcr.io` forces the upstream registry; `MIRROR=` still forces that host and does not fall back. Accepting Nanjing, or setting `MIRROR`, trusts that host. The choice is not saved in `.env`. `registry-mirrors` such as `https://docker.nju.edu.cn` only accelerates Docker Hub. +- Docker sandboxes always get `--add-host host.docker.internal:host-gateway`. A native install hands every sandbox an `AGENTFLOW_SESSION_GATEWAY` URL on `host.docker.internal`, but the mapping was only added for conversation and runner-login containers, so `git credential fill` in an SOP run sandbox failed with `lookup host.docker.internal ... no such host` and the 发起 MR agent had to rediscover the docker bridge gateway on every run. The mapping now applies to all sandboxes. ## 0.4.0 — scheduled task history, an MR node in delivery SOPs and agent CLIs in conversation workspaces diff --git a/internal/runtime/docker_cases_test.go b/internal/runtime/docker_cases_test.go index f390d1a2..9aa0c311 100644 --- a/internal/runtime/docker_cases_test.go +++ b/internal/runtime/docker_cases_test.go @@ -131,8 +131,8 @@ func TestDockerSandboxUsesRelayNetworkOnlyWhenRequested(t *testing.T) { t.Fatalf("docker create used the wrong network: %s", args) } usesGateway := strings.Contains(args, "\n--add-host\nhost.docker.internal:host-gateway\n") - if usesGateway != (tc.conversation || tc.runnerLoginRelay) { - t.Fatalf("docker create host gateway = %v for %s", usesGateway, tc.name) + if !usesGateway { + t.Fatalf("docker create missing host gateway mapping for %s: %s", tc.name, args) } }) } diff --git a/internal/runtime/sandbox_docker.go b/internal/runtime/sandbox_docker.go index c4fb30fa..7b8ee689 100644 --- a/internal/runtime/sandbox_docker.go +++ b/internal/runtime/sandbox_docker.go @@ -766,6 +766,11 @@ func (s *dockerSandbox) start(ctx context.Context, recreate bool) error { } } network := strings.TrimSpace(os.Getenv("AGENTFLOW_DOCKER_NETWORK")) + // Sandboxes reach a native platform through the host-gateway alias: + // AGENTFLOW_SESSION_GATEWAY hands them a host.docker.internal URL, and + // Linux daemons only resolve that name when the container carries the + // mapping. Add it for every sandbox, not only conversation relays. + args = append(args, "--add-host", "host.docker.internal:host-gateway") if s.requirements.ConversationRoot != "" || s.requirements.RunnerLoginRelay { _, relayNetwork, err := conversationDockerAccess(ctx) if err != nil { @@ -774,7 +779,6 @@ func (s *dockerSandbox) start(ctx context.Context, recreate bool) error { if relayNetwork != "" { network = relayNetwork } - args = append(args, "--add-host", "host.docker.internal:host-gateway") } if network != "" { args = append(args, "--network", network)