{"record":{"id":"1416253d18dcf71a","repo":"can1357/oh-my-pi","slug":"host-network-is-docker-only-compose-overlay","errorCode":null,"errorMessage":"--host-network is docker-only (compose overlay)","messagePattern":"--host-network is docker-only \\(compose overlay\\)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/metaharness/src/runner.ts","lineNumber":367,"sourceCode":"\t\t\t\t\tcfg.env[spec.slice(0, eq2)] = spec.slice(eq2 + 1);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"--environment\": {\n\t\t\t\tconst v = take(arg);\n\t\t\t\tif (v !== \"docker\" && v !== \"apple-container\") {\n\t\t\t\t\tthrow new Error(\"--environment must be docker|apple-container\");\n\t\t\t\t}\n\t\t\t\tcfg.envType = v;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`unknown flag: ${arg} (see --help)`);\n\t\t}\n\t}\n\tif (cfg.models.length === 0) cfg.models = [\"anthropic/claude-sonnet-4-6\"];\n\tif (cfg.envType === \"apple-container\") {\n\t\tif (cfg.hostNetwork) throw new Error(\"--host-network is docker-only (compose overlay)\");\n\t\t// host.docker.internal doesn't exist on vmnet; containers reach the host at the bridge address.\n\t\tif (cfg.gatewayUrl === DOCKER_GATEWAY_URL) cfg.gatewayUrl = VMNET_GATEWAY_URL;\n\t}\n\treturn cfg;\n}\n\n// ─────────────────────────────────────────────────────────────────── resume\n\n/** manager.json launch record written by RunStore.registerLaunch. */\ninterface ManagerRecord {\n\tbenchmark?: string;\n\tdataset?: string;\n\tconfig?: LaunchRequest;\n}\n\n/**\n * Recover the original launch Config for `--resume <job>` — nothing needs\n * re-specifying. Prefers the exact Config snapshot recorded at launch","sourceCodeStart":349,"sourceCodeEnd":385,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/metaharness/src/runner.ts#L349-L385","documentation":"After parsing, the runner cross-validates flag combinations: --host-network maps Docker's compose host networking and has no equivalent under the apple-container (vmnet) environment, so specifying it together with --environment apple-container throws. This is a semantic (cross-flag) validation, not a parse error.","triggerScenarios":"`runner --environment apple-container --host-network` — either explicitly or because a saved runner-config for a resumed job contains hostNetwork=true while the user overrides the environment.","commonSituations":"Switching an existing docker-based job config to apple-container without removing --host-network; scripts that always append --host-network; copying a docker invocation and only changing the environment flag.","solutions":["Remove --host-network when using --environment apple-container.","Switch back to --environment docker if you actually need host networking (compose overlay).","If resuming, edit the job's saved config or pass flags that don't conflict with the resumed environment type.","Adjust your wrapper script to only add --host-network when ENV=docker."],"exampleFix":"// before\nrunner --environment apple-container --host-network\n// after\nrunner --environment apple-container","handlingStrategy":"validation","validationCode":"if (environment === \"apple-container\" && hostNetwork) {\n  throw new Error(\"--host-network is only valid with --environment docker\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runHarness({ environment, hostNetwork });\n} catch (e) {\n  if (e instanceof Error && e.message.includes(\"--host-network is docker-only\")) {\n    console.error(\"Drop --host-network or switch to --environment docker.\");\n  } else throw e;\n}","preventionTips":["In wrapper scripts, conditionally append --host-network only when ENV=docker.","When overriding the environment on resume, re-check which other flags were saved with the original config.","Treat environment choice as a bundle: apple-container implies no host networking."],"tags":["cli","flag-conflict","docker","validation"],"backgroundTag":"conflicting-cli-flags","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}