t8y2/dbx · critical · RuntimeError

agent exited during {method}

Error message

agent exited during {method}

What it means

call() writes a JSON-RPC request to the agent's stdin and reads responses; if the agent's stdout reaches EOF while the process has exited, it raises RuntimeError('agent exited during {method}'). This detects mid-session crashes of the benchmarked agent.

Source

Thrown at agents/drivers/cassandra-go/bench/agent_compare.py:72

                continue
        raise TimeoutError(self._failure("timed out waiting for agent readiness"))

    def call(self, method: str, params: dict | None = None) -> dict:
        self.request_id += 1
        request = {
            "jsonrpc": "2.0",
            "id": self.request_id,
            "method": method,
            "params": params or {},
        }
        assert self.process.stdin is not None
        assert self.process.stdout is not None
        self.process.stdin.write(json.dumps(request, separators=(",", ":")) + "\n")
        self.process.stdin.flush()
        while True:
            line = self.process.stdout.readline()
            if line == "" and self.process.poll() is not None:
                raise RuntimeError(self._failure(f"agent exited during {method}"))
            try:
                response = json.loads(line)
            except json.JSONDecodeError:
                continue
            if response.get("id") != self.request_id:
                continue
            if response.get("error") is not None:
                raise RuntimeError(f"{self.candidate.name} {method}: {json.dumps(response['error'], ensure_ascii=False)}")
            return response.get("result")

    def rss_kib(self) -> int:
        if self.candidate.rss_command:
            output = subprocess.check_output(self.candidate.rss_command, shell=True, text=True).strip()
            return int(output)
        output = subprocess.check_output(
            ["ps", "-o", "rss=", "-p", str(self.process.pid)],
            text=True,
        ).strip()

View on GitHub (pinned to c0390bff16)

Solutions

  1. Check the agent's stderr/exit code to find why it died (panic, OOM, signal)
  2. Reduce workload size or raise memory limits if it was OOM-killed
  3. Re-run with the agent under a debugger/core-dump capture to find the crash
  4. Update or fix the agent binary if the crash is reproducible for a given method
Defensive patterns

Strategy: try-catch

Try / catch

try:
    result = agent.call(method, params)
except RuntimeError as exc:
    if f"agent exited during {method}" in str(exc):
        code = agent.process.returncode
        if code is not None and code < 0:
            print(f"agent killed by signal {-code} (possible OOM)")
        print(agentStderrTail())
        sys.exit(4)
    raise

Prevention

When it happens

Trigger: Calling call(method, params) when the agent dies during handling — segfault, OOM kill, panic in the handler, or being killed by an external signal.

Common situations: OOM killer terminating the agent under memory-heavy workloads; a bug in the agent triggered by a specific RPC; container memory limits killing the process.

Related errors


AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05). Data as JSON: /api/errors/072205644b4bf8e4. Report an issue: GitHub.