Inside the xAgent Agent Harness, Part 2: How Tasks Run, Pause, and Resume
· 12 min read
After task goals and the capability environment are aligned, xAgent enters what is usually called the Agent Loop. This loop is not a model process running alone until it finishes. Brain controls Session-level scheduling, SessionEngine owns runtime state and assembles every request, and AgentService owns only the fixed model and Tool execution flow.
This division allows one task to continue after a Tool Call, wait before a high-impact action, compress a growing context, exit when the user interrupts it, and resume after a service restart when valid recovery material exists.