Skip to content

hylo.codeagents.tool_agent

Package: hylo-code-agents · Core contracts

tool_agent

tools.llm (RFC-0007): a chat model operates the robot through typed tools with native tool calls.

agent: {type: tools.llm, params: {model: {backend: ollama, model: qwen3.5:35b-a3b, vision: true},
        max_decisions: 40, max_calls: 150, inbox: runs/steer/inbox.jsonl}}

Each model call sends the projected conversation (tool_context) and every tool of the surface (robot_surface plus read_artifact). Read calls of one reply run in order; an act call must be alone in its reply, runs through the kernel and the SafetyShield, and the next message carries its receipt and fresh images. finish ends the episode; the task's success check stays the verdict and is never shown.

Budgets: decisions (act calls that moved or could have moved the robot; refusals that moved nothing do not count), model calls, calls without an action, tokens, cost, wall time. Replies without a tool call get a reminder; after max_idle_replies in a row the episode ends.

Steering: with inbox, a JSON-lines file a person (the Studio, hylo watch --say) appends {"message": ...} to, each new message is shown to the model before its next call as operator guidance. A run that received any is marked human_assisted in its summary event and must not be counted as autonomous.

Trace events: agent.tool.start (surface and prompt digests), agent.tool.turn (per model call: projection stats, reply, tool calls, usage), agent.tool.result (per call), agent.tool.proposal / agent.tool.receipt (per act), agent.tool.operator, agent.tool.finish, agent.tool.summary.

Inbox

Inbox(path: str | PathLike[str])

Operator messages: a JSON-lines file; poll() returns the messages appended since the last poll (those present when the inbox was opened are skipped: they were meant for an earlier run).

path instance-attribute

path = Path(path)

offset instance-attribute

offset = self.path.stat().st_size if self.path.is_file() else 0

poll

poll() -> list[str]

ToolLLMAgent

ToolLLMAgent(model: str | Mapping[str, Any] | ChatModel = 'ollama:qwen3.5:35b-a3b', tools: str | Mapping[str, Any] | None = None, max_decisions: int = 40, max_calls: int = 150, calls_per_decision: int = 25, max_tokens: int | None = None, max_cost_usd: float | None = None, wall_s: float | None = None, reply_tokens: int = 4096, max_idle_replies: int = 4, inbox: str | None = None, contract: str | None = None, overlay_camera: str | None = None, observe_cameras: list[str] | None = None, context: Mapping[str, Any] | None = None, extra_prompt: str = '', act_wait_s: float = 21600.0)

Bases: _CodeAgentBase

name class-attribute instance-attribute

name = 'tools.llm'

model instance-attribute

model = with_tools(build_chat(model))

observe_cameras instance-attribute

observe_cameras = observe_cameras

context_params instance-attribute

context_params = dict(context or {})

extra_prompt instance-attribute

extra_prompt = extra_prompt

join_s instance-attribute

join_s = 60.0

last instance-attribute

last: dict[str, Any] = {}

spec

spec()

post

post(path: str | PathLike[str], message: str, sender: str = 'operator') -> None

Append one operator message to an inbox file.