os_restart_api
Safely restart the AI Team OS FastAPI process after backend code changes so new versions load without manual process killing; busy agents and port conflicts are guarded.
Instructions
Restart the AI Team OS FastAPI process safely (standardized restart flow).
Use this after backend code changes to pick up the new version without manually killing processes. The flow has three safety guards:
Busy-agent guard — refuses to restart while any agent is working (status=busy) unless force=True.
Port-pin guard — only ever restarts on the ORIGINAL port (default 8000, read from api_port.txt). If that port is held by an unrelated process it aborts rather than drifting to a random port.
Dead-before-spawn guard — waits until the old process has fully exited and released the port before spawning the new one; never spawns on a timeout.
If the API is already down, steps 2-4 are skipped and this becomes a plain "start" of the API on its configured port.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "os_restart_api"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | Bypass the busy-agent guard and restart even while agents work. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||