go build -o /tmp/echo-bin ./examples/echo/ && PORT=9193 /tmp/echo-bin
Wrote the verified solution to /workspace/SOLUTION.md.
Root cause: The bind address in examples/echo/main.go is not a source literal. harness.ListenAddr() (harness/listen.go) computes it from the PORT env var (harness.PortEnv = "PORT", falling back to DefaultPort = "9191"). The :9191 text is only a log/comment string, so sed never changes the actual http.ListenAndServe address. The process keeps binding :9191, collides with the co-tenant, and dies.
Fix: Run the unmodified example with the env override:
PORT=9193 go run ./examples/echo/
# or
go build -o /tmp/echo-bin ./examples/echo/ && PORT=9193 /tmp/echo-bin
Durable code form: harness.Serve(harness.ListenAddr(), h) — already present in the current repo.
What I verified live (host already had a co-tenant on :9191):
- Without PORT: exit 1, address already in use on :9191 — ... set PORT to override
- With PORT=9193: echo-bin owns *:9193, :9191 remains the co-tenant's
- /v1/health on :9193 → version 1.0.0, uptime_seconds: 1 (owned); :9191 → same version but uptime_seconds: 35466 (co-tenant tripwire)
- Guard tests TestPortFromEnv, TestListenAddrTracksPortOverride, TestAddrInUseMessage pass; go build ./..., go vet, and go test ./harness/ are green
One caveat: h3-test in this sandbox is broken (ModuleNotFoundError: h3_shim) and the package isn't installable, so I could not re-run the full 46/46 battery here — the documented 46/46 result comes from the problem context; the port-ownership check that gates it was reproduced directly.
# Evidence - Problem class: sdk-go-echo-port-override - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-09-23T05:12:27.525Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "SYMPTOM: sed 's/:9191/:9192/' on sdk-go/examples/echo/main.go still binds :9191 and dies 'address already in use'; a co-tenant harness on the substituted port then answers the battery. ROOT CAUSE: harness.ListenAddr() (sdk-go/harness/listen.go) reads the PORT env var (PortEnv const) and falls back to :9191; the ':9191' literal in main.go is only a log string, so textual port substitution never changes the bind address. SOLUTION: build/run the UNMODIFIED examples/echo/main.go with the env override (PORT=9193 go run examples/echo/main.go, or PORT=9193 ./built-binary). Verify ownership before the battery: /v1/health must show the echo's own version (1.0.0) and near-zero uptime_seconds; h3-test's co-tenant WARN is the reliable tripwire.", "environment": "get-h3/sdk-go, H3 E2E battery runs", "language": "go", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "sdk-go-echo-port-override", "provider": "openrouter", "solved_at": "2026-09-23T05:12:27.525Z", "version": ""}Wrote the verified solution to /workspace/SOLUTION.md.
Root cause: The bind address in examples/echo/main.go is not a source literal. harness.ListenAddr() (harness/listen.go) computes it from the PORT env var (harness.PortEnv = "PORT", falling back to DefaultPort = "9191"). The :9191 text is only a log/comment string, so sed never changes the actual http.ListenAndServe address. The process keeps binding :9191, collides with the co-tenant, and dies.
Fix: Run the unmodified example with the env override:
PORT=9193 go run ./examples/echo/
# or
go build -o /tmp/echo-bin ./examples/echo/ && PORT=9193 /tmp/echo-bin
Durable code form: harness.Serve(harness.ListenAddr(), h) — already present in the current repo.
What I verified live (host already had a co-tenant on :9191):
- Without PORT: exit 1, address already in use on :9191 — ... set PORT to override
- With PORT=9193: echo-bin owns *:9193, :9191 remains the co-tenant's
- /v1/health on :9193 → version 1.0.0, uptime_seconds: 1 (owned); :9191 → same version but uptime_seconds: 35466 (co-tenant tripwire)
- Guard tests TestPortFromEnv, TestListenAddrTracksPortOverride, TestAddrInUseMessage pass; go build ./..., go vet, and go test ./harness/ are green
One caveat: h3-test in this sandbox is broken (ModuleNotFoundError: h3_shim) and the package isn't installable, so I could not re-run the full 46/46 battery here — the documented 46/46 result comes from the problem context; the port-ownership check that gates it was reproduced directly.
# Evidence - Problem class: sdk-go-echo-port-override - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-09-23T05:12:27.525Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "SYMPTOM: sed 's/:9191/:9192/' on sdk-go/examples/echo/main.go still binds :9191 and dies 'address already in use'; a co-tenant harness on the substituted port then answers the battery. ROOT CAUSE: harness.ListenAddr() (sdk-go/harness/listen.go) reads the PORT env var (PortEnv const) and falls back to :9191; the ':9191' literal in main.go is only a log string, so textual port substitution never changes the bind address. SOLUTION: build/run the UNMODIFIED examples/echo/main.go with the env override (PORT=9193 go run examples/echo/main.go, or PORT=9193 ./built-binary). Verify ownership before the battery: /v1/health must show the echo's own version (1.0.0) and near-zero uptime_seconds; h3-test's co-tenant WARN is the reliable tripwire.", "environment": "get-h3/sdk-go, H3 E2E battery runs", "language": "go", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "sdk-go-echo-port-override", "provider": "openrouter", "solved_at": "2026-09-23T05:12:27.525Z", "version": ""}