Multi-tier framework for evaluating AI agent skills and plugins with quality gates, security scanning, harness compatibility checks, semantic overlap detection, synthetic evaluation dataset generation, and live agent evaluation that measures how skills affect agent behavior. Ships reusable CI templates that bring every check to any repository.
Python agent-evaluationagent-pluginsagent-securityagent-skillsagentic-aibenchmarkci-templatesclaude-codecodexevaluateevaluationharnesspluginplugin-evaluationsecurity-scannerskill-evalskill-evaluationskill-evaluatorskill-gap-analysisskills
fix(tier3): name Docker address-pool exhaustion and document trial network cleanup (#557)
Narendran Raghavan1244b3cdf40e
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 3b79d6df..2321a0e0 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -892,6 +892,12 @@ All notable changes to SkillEvaluator are documented in this file.`--pii-waivers` entry that accepted such an address now matches no finding,so it is reported as a LOW `stale-pii-waiver` instead of an INFO`applied-pii-waiver` and can be removed.+- A Tier 3 trial that fails because Docker has no free network address pools+ now names that cause, and how to clean up, right after the exception type in+ its failure reason, which used to cut Docker's error off after the long+ Compose command. The documented cleanup for interrupted or killed runs now+ also lists and removes the trials' leftover Compose networks, which are what+ use up the pools.- A native Codex `exec` wrapper that calls the freeform `apply_patch` tool withthe patch as a bare string is decoded instead of being discarded. The boundeddiff --git a/docs/tier3-live-evaluation.mdx b/docs/tier3-live-evaluation.mdxindex 06422b35..cb8c8ff0 100644--- a/docs/tier3-live-evaluation.mdx+++ b/docs/tier3-live-evaluation.mdx@@ -352,12 +352,18 @@ using Harbor 0.25:trial environments, and has up to 30 seconds to exit before its POSIX processgroup is killed and reaped. The progress view shows the agents that arestopping; a second Ctrl+C skips the wait. On Windows the Harbor task tree is- stopped immediately. A skipped or exceeded wait, or a Windows run, can leave- trial containers or in-container agent processes running. Harbor's Docker- backends name each Compose project after its trial, so- `docker ps --filter label=com.docker.compose.project` lists the candidates;- check their project names before removing them with `docker rm -f`. The- progress view marks unfinished stages as interrupted.+ stopped immediately. The progress view marks unfinished stages as+ interrupted.+- A skipped or exceeded Ctrl+C wait, a Ctrl+C on Windows, or a SkillEvaluator+ process that is killed rather than interrupted (for example with `kill` or by+ a cancelled CI job) can leave trial containers or in-container agent+ processes running, and the trials' Compose networks behind. Each leftover+ network keeps a subnet from Docker's limited default address pools. Harbor's+ Docker backends name each Compose project after its trial, so+ `docker ps -a --filter label=com.docker.compose.project` and+ `docker network ls --filter label=com.docker.compose.project` list the+ candidates; check their project names before removing the containers with+ `docker rm -f` and then the networks with `docker network rm`.- Docker accepts Harbor stdin payloads and isolates main-container executionfrom sidecar operations without placing environment values on Compose argv.For NVIDIA Build, the credential reaches the trusted parent over stdin; each@@ -2220,6 +2226,23 @@ machine-readable JSON contract, and how to judge whether a given lift is good.Start Docker or configure the selected `--env-mode`, then re-run`skillevaluator doctor` with the same agent and environment.</Accordion>+ <Accordion title="Docker reports that all predefined address pools have been fully subnetted">+ A trial's Compose project normally creates its own Docker network, and+ Docker carves each one from a limited set of default address pools. Each+ running trial holds a network, so a run holds up to `--n-concurrent`+ networks for each agent running in parallel, and up to `--max-agents`+ agents run in parallel, every selected agent by default. Networks that+ interrupted or killed runs left behind, or too many trials at once, can use+ the pools up. Docker then fails to create the next trial's network with+ this error, or with `could not find an available, non-overlapping IPv4+ address pool`, and the trial's failure reason names the cause ahead of+ Docker's message. List the leftover trial containers and networks with+ `docker ps -a --filter label=com.docker.compose.project` and+ `docker network ls --filter label=com.docker.compose.project`, check their+ project names, and remove the containers with `docker rm -f` and then the+ networks with `docker network rm`. Then rerun, with a lower+ `--n-concurrent` or `--max-agents` if the pools still run out.+ </Accordion><Accordion title="No eval dataset or native task source found">Write task requests and observable outcomes in `eval-guidance.md`, then run`skillevaluator create-eval-dataset ./my-skill --prompt eval-guidance.md`.diff --git a/src/skillevaluator/tier3/harbor/collector.py b/src/skillevaluator/tier3/harbor/collector.pyindex a0b5326a..45c85418 100644--- a/src/skillevaluator/tier3/harbor/collector.py+++ b/src/skillevaluator/tier3/harbor/collector.py@@ -785,6 +785,40 @@ def _trajectory_agent_runtime_failure_reason(trajectory: Any) -> str:return ""+# Compose's prefix when it cannot create a project network, ahead of Docker's error.+_COMPOSE_NETWORK_CREATE_FAILURE = "failed to create network"+# Docker's errors when every default address pool already backs a network.+_DOCKER_ADDRESS_POOL_MARKERS = (+ "all predefined address pools have been fully subnetted",+ "could not find an available, non-overlapping ipv4 address pool",+)+_DOCKER_ADDRESS_POOL_NOTE = (+ "Docker has no free network address pools. List leftover trial Compose containers and networks "+ "(`docker ps -a --filter label=com.docker.compose.project`, "+ "`docker network ls --filter label=com.docker.compose.project`), check their names, and remove "+ "the containers with `docker rm -f` before the networks with `docker network rm`; "+ "or lower --n-concurrent or --max-agents."+)+++def _is_compose_address_pool_failure(exception_type: str, exception_message: str) -> bool:+ """Return true when Compose could not create a trial network because Docker's pools ran out.++ Agent failures carry the agent's own output, which can quote Docker's error,+ so they keep their reason as recorded.+ """+ if (+ exception_type in _AGENT_RUNTIME_EXCEPTION_TYPES+ or exception_type in _UNCONDITIONAL_AGENT_RUNTIME_EXCEPTION_TYPES+ ):+ return False+ message = exception_message.casefold()+ network_failure_start = message.find(_COMPOSE_NETWORK_CREATE_FAILURE)+ return network_failure_start >= 0 and any(+ marker in message[network_failure_start:] for marker in _DOCKER_ADDRESS_POOL_MARKERS+ )++def _exception_details(exception_info: Any) -> tuple[str, str]:"""Return one Harbor exception type and bounded display reason."""if not isinstance(exception_info, dict):@@ -792,6 +826,9 @@ def _exception_details(exception_info: Any) -> tuple[str, str]:exception_type = str(exception_info.get("exception_type") or "").strip()exception_message = str(exception_info.get("exception_message") or "").strip()+ # Docker's own line follows the long Compose command and falls past the cut.+ if _is_compose_address_pool_failure(exception_type, exception_message):+ exception_message = f"{_DOCKER_ADDRESS_POOL_NOTE} {exception_message}"if exception_type and exception_message:return exception_type, f"{exception_type}: {exception_message}"[:600]return exception_type, (exception_type or exception_message)[:600]diff --git a/tests/test_harbor_collector_runtime_failures.py b/tests/test_harbor_collector_runtime_failures.pyindex beac2111..f904af21 100644--- a/tests/test_harbor_collector_runtime_failures.py+++ b/tests/test_harbor_collector_runtime_failures.py@@ -2568,3 +2568,170 @@ def test_harbor_verifier_and_environment_failures_are_unscored_not_agent_failureassert opencode["num_trials_with"] == 0assert opencode["agent_runtime_failures"]["with_skill"] == []assert results["execution_status"] == "failed"+++_ADDRESS_POOL_NOTE_START = "Docker has no free network address pools."+++def _compose_network_failure(docker_error: str) -> str:+ """Shape a secure Compose failure: the long command line comes before Docker's own error."""+ command = " ".join(["docker compose --project-name case-001__attempt__env -f /tmp/task/compose.yaml up"] * 12)+ return (+ "Docker compose command failed for environment case-001. "+ f"Command: {command}. Return code: 1. Stdout: . "+ f"Stderr: failed to create network case-001__attempt__env_default: Error response from daemon: {docker_error}."+ )+++ "docker_error",+ (+ "all predefined address pools have been fully subnetted",+ "could not find an available, non-overlapping IPv4 address pool among the defaults to assign to the network",+ "ALL PREDEFINED ADDRESS POOLS HAVE BEEN FULLY SUBNETTED",+ ),+)+def test_docker_address_pool_exhaustion_is_named_before_the_reason_cut(docker_error: str) -> None:+ message = _compose_network_failure(docker_error)+ assert message.casefold().index("address pool") > 600++ exception_type, reason = collector_module._exception_details(+ {"exception_type": "RuntimeError", "exception_message": message}+ )++ assert exception_type == "RuntimeError"+ assert reason.startswith(f"RuntimeError: {_ADDRESS_POOL_NOTE_START} ")+ assert "`docker network ls --filter label=com.docker.compose.project`" in reason+ assert "prune" not in reason+ assert len(reason) == 600+++def test_docker_address_pool_note_removes_trial_containers_before_networks() -> None:+ # A leftover container still attached to its network makes `docker network rm` fail.+ _, reason = collector_module._exception_details(+ {+ "exception_type": "RuntimeError",+ "exception_message": _compose_network_failure("all predefined address pools have been fully subnetted"),+ }+ )+ note = reason.split("RuntimeError: ", 1)[1].split(" Docker compose command failed", 1)[0]++ assert "`docker ps -a --filter label=com.docker.compose.project`" in note+ assert "`docker network ls --filter label=com.docker.compose.project`" in note+ assert "check their names" in note+ assert note.index("`docker rm -f`") < note.index("`docker network rm`")+ assert note.endswith("; or lower --n-concurrent or --max-agents.")+ assert "prune" not in note+++def test_docker_address_pool_note_without_exception_type() -> None:+ message = (+ "failed to create network case-001__attempt__env_default: "+ "Error response from daemon: all predefined address pools have been fully subnetted"+ )++ _, reason = collector_module._exception_details({"exception_message": message})++ assert reason.startswith(f"{_ADDRESS_POOL_NOTE_START} ")+ assert reason.endswith(message)+++ "message",+ (+ "Verifier log: Error response from daemon: all predefined address pools have been fully subnetted",+ "all predefined address pools have been fully subnetted; failed to create network demo_default: denied",+ ),+)+def test_docker_address_pool_error_outside_compose_network_creation_gets_no_note(message: str) -> None:+ assert collector_module._exception_details({"exception_type": "RuntimeError", "exception_message": message}) == (+ "RuntimeError",+ f"RuntimeError: {message}",+ )+++ "exception_type",+ sorted(+ collector_module._AGENT_RUNTIME_EXCEPTION_TYPES | collector_module._UNCONDITIONAL_AGENT_RUNTIME_EXCEPTION_TYPES+ ),+)+def test_agent_runtime_failures_get_no_address_pool_note(exception_type: str) -> None:+ message = _compose_network_failure("all predefined address pools have been fully subnetted")++ assert collector_module._exception_details({"exception_type": exception_type, "exception_message": message}) == (+ exception_type,+ f"{exception_type}: {message}"[:600],+ )+++def test_agent_failure_quoting_docker_address_pool_error_keeps_its_reason(tmp_path: Path) -> None:+ # The agent read a log that quotes Docker's error, then failed on its own credential.+ stdout = "\n".join(+ (+ *(f"read fixtures/compose-{index}.log" for index in range(8)),+ "API Error: 401 Unauthorized",+ "fixtures/compose-8.log: failed to create network demo_default: Error response from daemon: "+ "all predefined address pools have been fully subnetted",+ )+ )+ message = f"Command failed (exit 1): opencode run --format json\nstdout: {stdout}\nstderr: exit status 1"+ trial_dir = tmp_path / "case-001__attempt"+ trial_dir.mkdir()+ (trial_dir / "result.json").write_text(+ json.dumps({"exception_info": {"exception_type": "NonZeroAgentExitCodeError", "exception_message": message}}),+ encoding="utf-8",+ )++ reason = _agent_runtime_failure_reason(trial_dir)++ assert reason == f"NonZeroAgentExitCodeError: {message}"+ assert "API Error: 401 Unauthorized" in reason+ assert _ADDRESS_POOL_NOTE_START not in reason+++def test_other_docker_network_failures_get_no_address_pool_note() -> None:+ message = "failed to create network case-001__attempt__env_default: permission denied"++ assert collector_module._exception_details({"exception_type": "RuntimeError", "exception_message": message}) == (+ "RuntimeError",+ f"RuntimeError: {message}",+ )+++def test_trial_failure_names_docker_address_pool_exhaustion(tmp_path: Path) -> None:+ jobs_dir = tmp_path / "jobs"+ job_dir = jobs_dir / "demo-opencode-with"+ trial_dir = job_dir / "case-001__attempt"+ trial_dir.mkdir(parents=True)+ (trial_dir / "result.json").write_text(+ json.dumps(+ {+ "trial_name": trial_dir.name,+ "exception_info": {+ "exception_type": "RuntimeError",+ "exception_message": _compose_network_failure(+ "all predefined address pools have been fully subnetted"+ ),+ },+ }+ ),+ encoding="utf-8",+ )+ _write_complete_job_result(job_dir, [trial_dir.name])++ results = collect_harbor_results(+ skill_name="demo",+ agents=["opencode"],+ output_dir=tmp_path / "results",+ jobs_dir=jobs_dir,+ skip_baseline=True,+ expected_cases=1,+ expected_case_ids=["case-001"],+ expected_trials=1,+ )++ assert results["execution_status"] == "failed"+ [failure] = results["agents"]["opencode"]["trial_failures"]["with_skill"]+ assert failure["trial"] == "case-001__attempt"+ assert failure["reason"].startswith(f"RuntimeError: {_ADDRESS_POOL_NOTE_START} ")