Core Concepts
Port and Instance Lifecycle
How console, agent, and plugin endpoints coordinate on port allocation, routing, and runtime lifecycle
Port and Instance Lifecycle
Unified Rule
- Agent ports are allocated by
console. studio agent start/restartdoes not require users to manage ports manually.- plugin commands resolve the target agent first, then the endpoint.
Runtime Roles
console
- Maintains
~/.downcity/console/agents.json - Starts/stops/restarts agent daemons
- Allocates agent ports
agent
- One project maps to one daemon
- Runtime HTTP APIs include
/api/plugins/list,/api/plugins/catalog, and/api/plugins/* - Debug metadata is persisted to
.downcity/.debug
plugin endpoints
studio plugin ...calls plugin routes- both are dispatched in the target runtime
Agent Port Allocation
- Validate console is running
- Validate project files
- Allocate an available port
- Start daemon
- Persist debug metadata
- Upsert console registry
Endpoint Resolution
For plugin API calls:
- explicit CLI
--host/--port DC_CITY_HOST/DC_CITY_PORT- daemon metadata
- default
127.0.0.1:5314
Recommendations
- In multi-agent scenarios, prefer
studio plugin ... --agent <id>. Plugin actions run locally against the selected project path. - Do not keep stale
DC_CITY_PORTin your shell profile. - If runtime status is abnormal, run
studio agent doctor --fixand inspect daemon logs.