(
self,
store: SkillStore,
registry: "SkillRegistry",
llm_client: "LLMClient",
model: Optional[str] = None,
available_tools: Optional[List["BaseTool"]] = None,
*,
max_concurrent: int = 3,
)
| 183 | """ |
| 184 | |
| 185 | def __init__( |
| 186 | self, |
| 187 | store: SkillStore, |
| 188 | registry: "SkillRegistry", |
| 189 | llm_client: "LLMClient", |
| 190 | model: Optional[str] = None, |
| 191 | available_tools: Optional[List["BaseTool"]] = None, |
| 192 | *, |
| 193 | max_concurrent: int = 3, |
| 194 | ) -> None: |
| 195 | self._store = store |
| 196 | self._registry = registry |
| 197 | self._llm_client = llm_client |
| 198 | self._model = model |
| 199 | self._available_tools: List["BaseTool"] = available_tools or [] |
| 200 | |
| 201 | # Concurrency: semaphore limits parallel LLM sessions |
| 202 | self._max_concurrent = max(1, max_concurrent) |
| 203 | self._semaphore = asyncio.Semaphore(self._max_concurrent) |
| 204 | |
| 205 | # Anti-loop for Trigger 2: tracks which skills have already been |
| 206 | # evolved for each degraded tool. Keyed by tool_key. |
| 207 | # Pruned when a tool leaves the problematic list (= recovered). |
| 208 | self._addressed_degradations: Dict[str, Set[str]] = {} |
| 209 | self._degradation_lock = asyncio.Lock() |
| 210 | |
| 211 | # Track background tasks so they can be awaited on shutdown. |
| 212 | self._background_tasks: Set[asyncio.Task] = set() |
| 213 | |
| 214 | def set_available_tools(self, tools: List["BaseTool"]) -> None: |
| 215 | """Update the tools available for evolution agent loops.""" |
nothing calls this directly
no outgoing calls
no test coverage detected