Skip to content

Commit a2bde31

Browse files
JarbasAlclaude
andcommitted
refactor: remove AgenticLoopEngine and AGENT_LOOP from OPM
AgenticLoopEngine is now implemented in the standalone ovos-agentic-loop repo (Agent Plugins/ovos-agentic-loop) and registers under the existing opm.agents.chat entry-point group — no new OPM type is needed. Removed: - PluginTypes.AGENT_LOOP ("opm.agents.loop") - PluginConfigTypes.AGENT_LOOP ("opm.agents.loop.config") - AgenticLoopEngine class from templates/agents.py - AgenticLoopEngine section from docs/api/agents.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 813bbf9 commit a2bde31

3 files changed

Lines changed: 0 additions & 97 deletions

File tree

docs/api/agents.md

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -63,34 +63,6 @@ Generate a response given a list of `AgentMessage` objects.
6363

6464
---
6565

66-
### `AgenticLoopEngine`
67-
68-
**Entry point:** `opm.agents.loop`
69-
70-
A `ChatEngine` subclass for plugins that implement an internal agent loop (ReAct, tool-call/observe, background workers, etc.). Callers treat it identically to `ChatEngine` — the loop is an implementation detail.
71-
72-
Adds a standard toolbox registration interface:
73-
74-
```python
75-
def load_toolboxes(self, toolboxes: List[ToolBox]) -> None
76-
```
77-
78-
Called by the persona loader when the persona config declares a `toolboxes` list. Plugins may also discover and load toolboxes internally.
79-
80-
Persona config example:
81-
82-
```json
83-
{
84-
"name": "MyAgent",
85-
"solvers": ["ovos-react-agent"],
86-
"toolboxes": ["web_search_tools", "file_tools"]
87-
}
88-
```
89-
90-
See [Agent Tools](agent-tools.md) for the `ToolBox` plugin API.
91-
92-
---
93-
9466
### `RetrievalEngine`
9567

9668
**Entry point:** `opm.agents.retrieval`

ovos_plugin_manager/templates/agents.py

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -382,73 +382,6 @@ def get_response(self, utterance: str,
382382
units=units).content
383383

384384

385-
class AgenticLoopEngine(ChatEngine):
386-
"""
387-
A ``ChatEngine`` subclass for plugins that implement an internal agent loop
388-
(e.g. ReAct, tool-call/observe cycles, background worker agents).
389-
390-
From the perspective of a ``PersonaService`` or any caller, an
391-
``AgenticLoopEngine`` is identical to a ``ChatEngine`` — it receives a list
392-
of ``AgentMessage`` objects and returns one. All loop mechanics, tool
393-
dispatch, retries, and background tasks are implementation details hidden
394-
inside the plugin.
395-
396-
The ``toolboxes`` attribute gives OPM and persona configs a standard place
397-
to inject ``ToolBox`` instances. Plugins are free to discover and load
398-
additional toolboxes internally.
399-
400-
Entry point group: ``opm.agents.loop``
401-
"""
402-
403-
def __init__(self, config: Optional[Dict[str, Any]] = None):
404-
"""
405-
Initialise the engine and set up an empty toolbox registry.
406-
407-
Args:
408-
config: Plugin-specific configuration dictionary.
409-
"""
410-
super().__init__(config=config)
411-
self.toolboxes: List[Any] = [] # List[ToolBox] — avoid circular import
412-
413-
def load_toolboxes(self, toolboxes: List[Any]) -> None:
414-
"""
415-
Register a list of ``ToolBox`` instances with this engine.
416-
417-
Called by the persona loader when the persona config declares a
418-
``toolboxes`` list. Plugins may also call this directly or discover
419-
toolboxes on their own inside ``continue_chat``.
420-
421-
Args:
422-
toolboxes: Instantiated ``ToolBox`` objects to make available to
423-
the agent loop.
424-
"""
425-
self.toolboxes = list(toolboxes)
426-
427-
@abc.abstractmethod
428-
def continue_chat(self, messages: List[AgentMessage],
429-
session_id: str = "default",
430-
lang: Optional[str] = None,
431-
units: Optional[str] = None) -> AgentMessage:
432-
"""
433-
Run the agent loop and return the final response.
434-
435-
The implementation is responsible for all internal steps: tool
436-
selection, execution, observation, and iteration. The caller always
437-
receives a single ``AgentMessage`` with ``MessageRole.ASSISTANT``.
438-
439-
Args:
440-
messages: Full conversation history up to and including the latest
441-
user turn.
442-
session_id: Conversation session identifier.
443-
lang: BCP-47 language code.
444-
units: Preferred measurement system (``"metric"`` / ``"imperial"``).
445-
446-
Returns:
447-
The assistant's final response after the loop has completed.
448-
"""
449-
raise NotImplementedError()
450-
451-
452385
class SummarizerEngine(AbstractAgentEngine):
453386
"""Engine designed for condensing long documents into concise summaries."""
454387

ovos_plugin_manager/utils/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ class PluginTypes(str, Enum):
9999
WEB_PLAYER = "opm.media.web"
100100
PERSONA = "opm.plugin.persona" # personas are a dict, they have no config because they ARE a config
101101
AGENT_TOOLBOX = "opm.agents.toolbox"
102-
AGENT_LOOP = "opm.agents.loop"
103102

104103
# solver plugins are deprecated!
105104
QUESTION_SOLVER = "opm.solver.question"
@@ -154,7 +153,6 @@ class PluginConfigTypes(str, Enum):
154153
AGENT_COREF = "opm.agents.coref.config"
155154
AGENT_YES_NO = "opm.agents.yesno.config"
156155
AGENT_TOOLBOX = "opm.agents.toolbox.config"
157-
AGENT_LOOP = "opm.agents.loop.config"
158156
KEYWORD_EXTRACTION = "opm.keywords.config"
159157
UTTERANCE_SEGMENTATION = "opm.segmentation.config"
160158
TOKENIZATION = "opm.tokenization.config"

0 commit comments

Comments
 (0)