Execute agent in a podman container based on AgentdSpec.
data RunConfig = RunConfig
{ runSpec :: AgentdSpec
, runStdin :: Maybe Text -- optional stdin to append to task
, runLogDir :: FilePath -- where to write logs
, runRepoRoot :: FilePath -- repo root to mount readonly
}
data RunResult = RunResult
{ resultId :: Text -- run ID
, resultExitCode :: Int
, resultLogPath :: FilePath
}
runAgent :: RunConfig -> IO RunResult
<YYYYMMDD-HHMMSS>-<spec-basename>-<6-char-hash>
Example: 20250101-143052-deploy-a1b2c3
podman run \
--rm \
--name <run-id> \
-v <workspace>:/workspace:rw \
-v <repo-root>:/repo:ro \
-v ~/.config/agent:/root/.config/agent:ro \
-e ANTHROPIC_API_KEY \
-e OPENROUTER_API_KEY \
-e KAGI_API_KEY \
-w /workspace \
agent-<toolchain> \
agent \
--model=<model> \
--provider=<provider> \
--max-cost=<cents> \
--max-iter=<iterations> \
"<task>"
Note: No skill mounts needed. The agent reads /repo/AGENTS.md for the skill index and loads skills via read_file from /repo/...
If stdin provided, append to task:
<original task>
---
Input:
<stdin content>
<logdir>/<run-id>/output.log<logdir>/<run-id>/meta.json: json
{
"id": "20250101-143052-deploy-a1b2c3",
"spec_file": "/path/to/deploy.md",
"toolchain": "git",
"started_at": "2025-01-01T14:30:52Z",
"finished_at": "2025-01-01T14:35:12Z",
"exit_code": 0
}
Omni/Agentd/Runner.hs