Skip to content

Commit 06af4f0

Browse files
refactor: move max_worker_retries as a common arg in the base orchestrator
1 parent 08b56ff commit 06af4f0

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

MaxKernel/auto_search/algorithms/parallel_search.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,13 @@ def __init__(
1616
self,
1717
num_parallel_runs: int = 2,
1818
strategies: Optional[List[str]] = None,
19-
max_worker_retries: int = 1,
2019
agent_config: Optional[dict] = None,
2120
**kwargs,
2221
):
2322
if num_parallel_runs <= 0:
2423
raise ValueError(
2524
f"num_parallel_runs must be a positive integer, got {num_parallel_runs}."
2625
)
27-
if max_worker_retries < 1:
28-
raise ValueError(
29-
f"max_worker_retries must be at least 1, got {max_worker_retries}."
30-
)
3126

3227
self.num_parallel_runs = num_parallel_runs
3328
if strategies is not None:
@@ -43,7 +38,6 @@ def __init__(
4338
self.strategies = [""] * num_parallel_runs
4439

4540
self.remaining_strategies = list(self.strategies)
46-
self.max_worker_retries = max_worker_retries
4741
self.agent_config = agent_config
4842
self.worker = ADKSessionWorker()
4943

MaxKernel/auto_search/orchestrator.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ def __init__(
1717
reference_code: str,
1818
graph_db_path: Optional[str] = None,
1919
max_concurrency: int = 2,
20+
max_worker_retries: int = 1,
2021
):
22+
if max_worker_retries < 1:
23+
raise ValueError(
24+
f"max_worker_retries must be at least 1, got {max_worker_retries}."
25+
)
26+
self.max_worker_retries = max_worker_retries
2127
# Resolve graph db path and run directory
2228
if not graph_db_path:
2329
workdir = os.environ.get("WORKDIR", os.getcwd())
@@ -152,8 +158,6 @@ def _post_step_hook(self) -> None:
152158
"""
153159
pass
154160

155-
# --- Concrete Flow ---
156-
157161
@abc.abstractmethod
158162
async def _execute_expansions(self, tasks: Any) -> List[Node]:
159163
"""Executes expansion tasks to evaluate new kernels.
@@ -163,6 +167,7 @@ async def _execute_expansions(self, tasks: Any) -> List[Node]:
163167
"""
164168
pass
165169

170+
# --- Workflow ---
166171
async def run(self) -> Node:
167172
logger.info(
168173
f"Starting search orchestration for problem: {self.graph.problem_id}"

0 commit comments

Comments
 (0)