Skip to content

fix(headless): resolve host.docker.internal for Harbor's in-container arms - #2062

Merged
Astro-Han merged 1 commit into
mainfrom
fix/headless-harbor-linux-host-gateway
Aug 4, 2026
Merged

fix(headless): resolve host.docker.internal for Harbor's in-container arms#2062
Astro-Han merged 1 commit into
mainfrom
fix/headless-harbor-linux-host-gateway

Conversation

@Astro-Han

Copy link
Copy Markdown
Contributor

Summary

The first real three-arm canary on a bare-metal Linux VM produced a result that reads like a competitor indictment: Maka 3 passed / 2 budget-exhausted, Codex 5/5 infra_failed, Claude Code 5/5 plumbing_failed. Both competitor arms had in fact died before their first model step, for one reason.

In-container agents dial host.docker.internal to reach the host credential proxy (provider-auth-proxy.ts defaults advertisedHost to that name). Docker Desktop injects it; native Linux Docker does not, and Harbor's linux/amd64 compose override declared only platform. So the name did not resolve:

  • Codex — stream disconnected before completion: error sending request for url (http://host.docker.internal:34151/responses), five reconnects then turn.failed
  • Claude Code — API Error: Unable to connect to API (ENOTFOUND), ten retries over 170s

The Maka arm passed throughout, because a Maka host cell reaches the proxy on loopback and never needs the name. That is what makes this worth pinning rather than just patching: a missing container DNS entry presented as the two competitors are broken, on exactly the axis the benchmark exists to measure.

pier-task-runner.ts:180-186 already documents this Linux gap and threads providerProxyAdvertisedHost past it, but MAKA_HARNESS_AB_PROVIDER_PROXY_ADVERTISED_HOST reaches only the Pier path; the Harbor path has no equivalent knob. Rather than add one, fix it where the platform difference already lives. harbor-task-runner.ts attaches the compose override precisely when dockerPlatform === 'linux/amd64', so mapping the name to host-gateway there fixes native Linux, is a no-op on Docker Desktop, and keeps the advertised host byte-identical across platforms — manifests, prompt hashes, and fingerprints are untouched, so a Linux run stays comparable with a macOS one.

Refs #1970.

Verification

  • Live containers on the affected VM, same Docker (29.7.1) and image the benchmark uses:
    • base compose only — getent hosts host.docker.internal returns nothing
    • base + this override — 172.17.0.1 host.docker.internal
  • npm run test -w @maka/headless — 1338 pass / 0 fail / 1 skip, including the added contract test.
  • npm run lint, npm run format:check, git diff --check — clean.

Review focus

The added test asserts the compose file's content rather than a runner behavior. That is deliberate: no unit-level assertion over buildHarborJobConfig can observe container DNS, and the failure mode this guards against is the two lines silently going away. The cost of that regression is a wasted multi-hour, real-spend benchmark run whose output looks like data.

… arms

Codex and Claude Code reach the host credential proxy by dialling
host.docker.internal. Docker Desktop injects that name; native Linux
Docker does not, and Harbor's linux/amd64 compose override declared only
`platform`. On a bare-metal Linux benchmark VM every competitor cell
therefore died before its first model step -- Codex as a connect error
after five reconnects, Claude Code as ENOTFOUND after ten retries and
170 seconds -- while the Maka arm passed, because a Maka host cell talks
to the proxy over loopback and never needs the name.

That shape is the danger: the harness looked like it was measuring two
broken competitors rather than one missing container DNS entry.

pier-task-runner.ts already documents this exact Linux gap and threads
providerProxyAdvertisedHost to escape it, but MAKA_HARNESS_AB_PROVIDER_
PROXY_ADVERTISED_HOST covers only the Pier path. Fix it where the
platform difference already lives instead: the compose override is
applied precisely when dockerPlatform is linux/amd64, so mapping the
name to host-gateway there keeps the advertised host identical on both
platforms and leaves the manifest, prompts, and fingerprints untouched.

Refs #1970.
@Astro-Han
Astro-Han marked this pull request as ready for review August 4, 2026 01:29
@Astro-Han
Astro-Han merged commit ef3905a into main Aug 4, 2026
10 checks passed
@Astro-Han
Astro-Han deleted the fix/headless-harbor-linux-host-gateway branch August 4, 2026 01:29
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.

1 participant