Skip to main content

Module agent_runtime

Module agent_runtime 

Source
Expand description

Agent runtime: wraps oxi-agent’s AgentLoop for use by the kernel.

The AgentRuntime creates an oxi-agent AgentLoop session, configures it with a custom ToolRegistry based on the agent’s CSpace (capability space), and executes a Seed’s goal through the multi-turn LLM tool-calling loop.

§Architecture

All tool access goes through KernelHandle — the single syscall-table-like path for agent OS control. The runtime:

  1. Resolves the agent’s CSpace from persona/role/hint
  2. Registers tools via register_tools_from_cspace()
  3. Optionally queries ToolRetriever for semantic capability hints
  4. Runs the agent loop with the assembled tool set

Note: Since oxi-sdk 0.19+, AgentLoop::run() produces a Send future. We call it directly from async context without spawn_blocking.

Structs§

AgentRuntime
Runtime that wraps an oxi-agent AgentLoop for executing Seeds.
AgentRuntimeConfig
Configuration for creating AgentRuntime instances.