Files
aios/active-runtime/app/task_plane/adapters/codex.py
T

32 lines
1.2 KiB
Python

from __future__ import annotations
from .base import WorkerAdapter
class CodexAdapter(WorkerAdapter):
worker_name = "codex"
def capabilities(self) -> list[str]:
return ["code.read", "code.write.patch", "test.python", "review.security"]
def claim(self, task):
return {"worker": self.worker_name, "task_id": task.task_id, "status": "claimed"}
def execute(self, task, claim):
return {"worker": self.worker_name, "task_id": task.task_id, "status": "SHADOW_VERIFIED", "claim_id": claim.claim_id, "execution_mode": "shadow", "production_side_effects": False}
def heartbeat(self, claim):
return {"worker": self.worker_name, "claim_id": claim.claim_id, "status": "alive"}
def report_progress(self, claim, progress):
return {"worker": self.worker_name, "claim_id": claim.claim_id, "progress": progress}
def probe(self, claim):
return {"worker": self.worker_name, "claim_id": claim.claim_id, "status": claim.status}
def cancel(self, claim):
return {"worker": self.worker_name, "claim_id": claim.claim_id, "status": "cancelled"}
def collect_result(self, claim):
return {"worker": self.worker_name, "claim_id": claim.claim_id, "result": "not_collected"}