{"record":{"id":"072205644b4bf8e4","repo":"t8y2/dbx","slug":"agent-exited-during-method","errorCode":null,"errorMessage":"agent exited during {method}","messagePattern":"agent exited during (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"critical","filePath":"agents/drivers/cassandra-go/bench/agent_compare.py","lineNumber":72,"sourceCode":"                continue\n        raise TimeoutError(self._failure(\"timed out waiting for agent readiness\"))\n\n    def call(self, method: str, params: dict | None = None) -> dict:\n        self.request_id += 1\n        request = {\n            \"jsonrpc\": \"2.0\",\n            \"id\": self.request_id,\n            \"method\": method,\n            \"params\": params or {},\n        }\n        assert self.process.stdin is not None\n        assert self.process.stdout is not None\n        self.process.stdin.write(json.dumps(request, separators=(\",\", \":\")) + \"\\n\")\n        self.process.stdin.flush()\n        while True:\n            line = self.process.stdout.readline()\n            if line == \"\" and self.process.poll() is not None:\n                raise RuntimeError(self._failure(f\"agent exited during {method}\"))\n            try:\n                response = json.loads(line)\n            except json.JSONDecodeError:\n                continue\n            if response.get(\"id\") != self.request_id:\n                continue\n            if response.get(\"error\") is not None:\n                raise RuntimeError(f\"{self.candidate.name} {method}: {json.dumps(response['error'], ensure_ascii=False)}\")\n            return response.get(\"result\")\n\n    def rss_kib(self) -> int:\n        if self.candidate.rss_command:\n            output = subprocess.check_output(self.candidate.rss_command, shell=True, text=True).strip()\n            return int(output)\n        output = subprocess.check_output(\n            [\"ps\", \"-o\", \"rss=\", \"-p\", str(self.process.pid)],\n            text=True,\n        ).strip()","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/bench/agent_compare.py#L54-L90","documentation":"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.","triggerScenarios":"Calling call(method, params) when the agent dies during handling — segfault, OOM kill, panic in the handler, or being killed by an external signal.","commonSituations":"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.","solutions":["Check the agent's stderr/exit code to find why it died (panic, OOM, signal)","Reduce workload size or raise memory limits if it was OOM-killed","Re-run with the agent under a debugger/core-dump capture to find the crash","Update or fix the agent binary if the crash is reproducible for a given method"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    result = agent.call(method, params)\nexcept RuntimeError as exc:\n    if f\"agent exited during {method}\" in str(exc):\n        code = agent.process.returncode\n        if code is not None and code < 0:\n            print(f\"agent killed by signal {-code} (possible OOM)\")\n        print(agentStderrTail())\n        sys.exit(4)\n    raise","preventionTips":["Give the agent generous memory limits to avoid OOM kills during heavy workloads","Monitor the agent's RSS and stderr during the run to catch degradation early","Reproduce crashing methods against the agent in isolation and file/fix the bug","Pin a known-good agent binary version for benchmark comparisons"],"tags":["python","subprocess","process-crash","ipc","json-rpc"],"backgroundTag":"process-exited-unexpectedly","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}