executor
executor
¶
AgentExecutor — runs a single agent tick.
Classes¶
AgentExecutor
¶
AgentExecutor(manager: AgentManager, event_bus: EventBus, system: Any = None, trace_store: Any = None)
Executes a single tick for a managed agent.
Constructor receives a JarvisSystem reference for access to engine, tools, config, memory backends, and all other primitives.
Source code in src/openjarvis/agents/executor.py
Functions¶
set_system
¶
run_ephemeral
¶
run_ephemeral(agent_type: str, system_prompt: str, input_text: str, tools: list[str] | None = None) -> Any
Run a one-shot agent turn with no lifecycle tracking.
Source code in src/openjarvis/agents/executor.py
execute_tick
¶
Run one tick for the given agent.
- Acquire concurrency guard (start_tick)
- Invoke agent with retry logic
- Update stats
- Release guard (end_tick)
lock_already_held is set by callers that took the start_tick()
lock themselves before spawning the worker (e.g. the HTTP /run route
guards against concurrent POSTs by acquiring before threading).
Without this flag, the executor would re-acquire and trip its own
guard — bailing out with no end_tick(), leaving the agent stuck in
status='running' forever.
Source code in src/openjarvis/agents/executor.py
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | |