Core Concepts
Runtime Relationship & Process
Collaboration model and startup/process order across console, agent, execution context, session, service, and plugin
Runtime Relationship & Process
1. Role Summary
console: manages registry, model pool, shared storage, and UIagent: the host process for one projectexecution context: the unified capability surface used during executionsession: a concrete execution instanceservice: the main path moduleplugin: an extension module that joins only at fixed points
In one sentence:
console governs, agent hosts, execution context injects, session executes, service orchestrates, and plugin augments.
2. What Happens at Startup
When you run:
city agent startThe usual order is:
- the agent reads project config and env
- the agent initializes logger, model, session store, plugin registry, and service instances
- the agent exposes the shared
execution context - services become available
- plugin extension points become available
- project-local traces continue to be written into
.downcity/*
The key point:
- services and plugins are available after startup
- but no specific session execution has started yet
3. When Real Execution Starts
Real execution begins only when an external request arrives, for example:
- Telegram delivers a message
- dashboard executes a target session
- task scheduler triggers one task run
Then the order is usually:
- the request enters a service
- the service resolves the target
sessionId - the service creates or reuses a session
- the service triggers plugins at fixed points
- the service enters execution through
context.session - the session returns a result
- the service decides how to reply or persist state
4. One Timeline Diagram
5. The Most Common Confusion
Do not mix up these 2 states:
agenthas started- a
sessionis actively executing
agent is the long-lived host.
session is the execution instance created or reused on demand.
So:
- one agent can host many sessions
- one service routes different requests into different sessions
- plugins do not create a separate execution axis