Agent Orchestration
The orchestration layer that defines, connects, runs, and observes agents, plus agent lifecycle and MCP & Skills.
The orchestration layer is the core of Sophonz AI Agent. Individual pipelines such as error auto-fix and test generation are implemented as combinations of agents running on top of this layer. This page covers how agents are defined, connected, run, and observed, and how their capabilities are composed from MCP & Skills.
Core concepts
- Agent — An execution unit defined by a prompt + a model + a list of MCP servers + a set of Skills.
- Orchestrator — The root manager that creates, schedules, and connects agents.
- Hierarchy — An agent can spawn sub-agents; depth is governed by policy.
- Dependency vs. isolation — An agent can take another agent's output as input, or run fully independently.
NOTE — v2 plan
This page describes the v2 orchestration layer plan. The conceptual model is settled, but dashboard screens and detailed settings may change during implementation.
Architecture
The orchestration view visualizes agent relationships as a node-edge graph.
- Nodes — Agents and orchestrators.
- Edges — Dependency (data flow), parent-child (creation), and subscription (events).
Agent lifecycle
An agent progresses through the following states.
| State | Meaning |
|---|---|
| Defined | Created by a user or a parent agent |
| Provisioned | Model, MCP, and Skills are bound |
| Running | Execution triggered |
| Spawning | Creating sub-agents |
| Waiting | Awaiting an external event or response |
| Done / Failed | Successful exit / error exit (retryable) |
Who creates agents
- User — Defined directly in the dashboard UI.
- Parent agent — Spawns sub-agents dynamically at runtime.
- Event trigger — Alert rules create agents automatically (the error & crash auto-fix pipeline).
Sub-agent rules
- The parent grants permissions to children under a scope-reduction principle.
- When the parent exits, children are cancelled too (cascade); this can be changed by configuration.
- The default maximum depth is 5, adjustable by per-organization policy.
- A child's result returns to the parent context or is emitted as a separate event stream.
Isolation vs. dependency
| Mode | Description | Use case |
|---|---|---|
| Independent run | No shared state with other agents | Batch jobs, testing |
| Dependent input | Another agent's output is the input | Building pipelines |
| Shared context | Shared session and memory | Collaborating agents |
Exit conditions
- Explicit
donetool call. - A cancel signal from the parent.
- Timeout.
- Error count over threshold.
MCP & Skills
An agent's capabilities are composed from two axes. MCP servers are the interface to external systems, and Skills are reusable task processes. The two evolve independently.
| Component | What it provides | Examples |
|---|---|---|
| MCP server | Read/write tools for external systems | GitHub, GitLab, DB, filesystem, internal APIs |
| Skills | Reusable task scripts | "Create a branch", "Review a PR", "Summarize an error report" |
A Skill combines several MCPs to complete one task.
MCP server management
- Default presets are provided in the repository and registered by a seed script.
- Users can add their own MCP servers (stdio, SSE, HTTP).
- A community Skill marketplace is a roadmap item.
Skill definition
- A Skill consists of a prompt template + a default MCP list + success criteria.
- An agent can hold multiple Skills and select which to run at runtime.
- Skills are combined within the prompt of a higher-level agent.
Observability and security
- Agent execution is itself recorded as a trace and queried with the same tools — so agents are observable subjects too.
- Every state transition is emitted as an event and viewable in the activity timeline.
- LLM token usage, MCP calls, and the number of spawned children are recorded as trace attributes.
- MCP calls are allowed only within an agent's scope.
- Secrets matching
Bearertokens,*_TOKEN,*_SECRET, and*_API_KEYpatterns are masked in API responses; raw values live only in storage and are used only during runtime calls. - Sensitive MCPs (for example, production deployment) require a separate approval flow.
Operating model
- SaaS — A managed orchestrator is available at sophonz.com.
- On-prem — Integrates with local LLM adapters, keeping customer data inside the network.