manager
manager
¶
Persistent agent lifecycle manager.
Composition layer — stores agent state in SQLite, delegates all computation to the five existing primitives (Intelligence, Agent, Tools, Engine, Learning).
Classes¶
AgentManager
¶
Persistent agent lifecycle manager with SQLite backing.
Source code in src/openjarvis/agents/manager.py
Functions¶
start_tick
¶
Mark agent as running. Raises ValueError if already running.
A row that has been running longer than _STALE_TICK_SECONDS
without any update is treated as a zombie left by a dead worker and
overtaken rather than refused — otherwise a crash with no server
around to sweep it would wedge the agent forever.
The state transition is a single conditional SQLite update. The
read-before-write approach is racy when two workers start together:
both can observe idle and then mark the row running. The
conditional update lets SQLite choose exactly one winner, including
when workers use separate connections or processes.
Source code in src/openjarvis/agents/manager.py
find_binding_for_channel
¶
Find a dedicated binding for a specific channel.
Source code in src/openjarvis/agents/manager.py
list_templates
staticmethod
¶
Discover built-in and user templates.
Source code in src/openjarvis/agents/manager.py
create_from_template
¶
create_from_template(template_id: str, name: str, overrides: Optional[Dict[str, Any]] = None) -> Dict[str, Any]
Create an agent from a template with optional overrides.
Source code in src/openjarvis/agents/manager.py
store_agent_response
¶
Store an agent-to-user response message.
tool_calls is an optional list of {tool, arguments, result,
success, latency} dicts captured during the turn. They are stored
as JSON alongside the message so the UI can replay them after a
page reload.