Skip to content

Commit b7c8ab3

Browse files
swghoshclaude
andcommitted
Refactor agent/ into phased workflow of multiple agents
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Swarup Ghosh <swghosh@redhat.com>
1 parent e6412e6 commit b7c8ab3

8 files changed

Lines changed: 669 additions & 301 deletions

File tree

agent/agent.py

Lines changed: 0 additions & 294 deletions
This file was deleted.

agent/config.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"""Constants and configuration loading."""
2+
3+
import json
4+
import logging
5+
from pathlib import Path
6+
7+
_CONTAINER_PLUGIN = Path("/plugins/oape")
8+
_CONTAINER_CONFIG = Path("/config/config.json")
9+
_RELATIVE_PLUGIN = Path(__file__).resolve().parent.parent / "plugins" / "oape"
10+
_RELATIVE_CONFIG = Path(__file__).resolve().parent.parent / "config" / "config.json"
11+
12+
PLUGIN_DIR = str(_CONTAINER_PLUGIN if _CONTAINER_PLUGIN.exists() else _RELATIVE_PLUGIN)
13+
14+
CONVERSATION_LOG = Path("/tmp/conversation.log")
15+
16+
conv_logger = logging.getLogger("conversation")
17+
conv_logger.setLevel(logging.INFO)
18+
_handler = logging.FileHandler(CONVERSATION_LOG)
19+
_handler.setFormatter(logging.Formatter("%(message)s"))
20+
conv_logger.addHandler(_handler)
21+
22+
23+
def load_config() -> dict:
24+
"""Load config.json from the mounted ConfigMap (or local fallback)."""
25+
config_path = _CONTAINER_CONFIG if _CONTAINER_CONFIG.exists() else _RELATIVE_CONFIG
26+
with open(config_path) as cf:
27+
return json.loads(cf.read())

agent/main.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66
"""
77

88
import asyncio
9-
import json
109
import os
1110
import sys
1211

1312
from rich import print_json
1413

15-
from agent import run_workflow
14+
from phases import run_workflow
1615

1716

1817
async def main():

0 commit comments

Comments
 (0)