Implement Apex Agent MVP scaffold

This commit is contained in:
2026-07-06 13:22:15 +08:00
commit 02ef4d23f2
49 changed files with 2767 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
from __future__ import annotations
from runtime.executor import Executor, ExecutorConfig
from runtime.planner import PlannedStep
def test_executor_retries_until_transient_tool_succeeds() -> None:
calls = {"count": 0}
def flaky_tool() -> dict[str, bool]:
calls["count"] += 1
if calls["count"] < 3:
raise RuntimeError("transient")
return {"ok": True}
executor = Executor(
tools={"flaky": flaky_tool},
config=ExecutorConfig(max_retries=3, backoff_seconds=0),
)
result = executor.execute(PlannedStep(action="flaky", description="retry"))
assert result.success is True
assert result.attempts == 3
assert result.result == {"ok": True}