restart_octobot
Restart OctoBot safely for maintenance or recovery, with a confirmation gate and automatic refusal while jobs are active.
Instructions
Trigger a full OctoBot process restart. Confirm-gated (ADR-0003/ADR-0010).
This is the first tool in this project that can never be made fully
safe or graceful (ADR-0010) -- stated plainly, not softened. OctoBot's
own restart mechanism (GET /wait_reboot?reboot=true, confirmed against
Drakkar-Software/OctoBot source) is an ABRUPT kill-and-re-exec, never
the graceful OctoBot.stop() shutdown -- no task cancellation, no
explicit order handling occurs before the kill. Exchange-side orders
are reconciled from the exchange on reboot (OctoBot's own designed,
changelog-hardened behavior, even for live trading), but the exact
duration of the unmonitored window during the restart itself is
UNVERIFIED (open question #14) and this tool cannot measure or bound it.
Check order (cheapest/safest first, ADR-0010 Decision 4), so a call that's about to be refused never makes an unnecessary live call:
confirmflag. If not exactlytrue, no OctoBot call is made at all -- this scrapes the currently selected profile'sprofile_type(the same Tier-B scrapelist_profiles/get_profileuse) ONLY to build a risk-scaled reason string, then returnsrequire_confirmation's structured refusal (a normal return, not an error). The reason string is more detailed/cautious whenprofile_typeisLIVE-- or the scrape itself is inconclusive, which fails toward the MORE cautious message, never toward silently allowing (ADR-0010 Decision 3) -- than when it isSIMULATOR. This is the SAMEconfirm=truegate regardless ofprofile_type: never a hard, non-bypassable block forLIVEprofiles (see ADR-0010 for why an earlier draft's hard refusal didn't hold up against OctoBot's own changelog/source evidence that restart-during-live-trading is a designed, hardened scenario).JobStoreactive-job check. Refuses outright -- a structured non-exception return, naming every job -- if anybacktest/data_collectionjob isqueued/running(both ofoctobot_mcp.jobs.JobStore's independent locks checked, ADR-0007's "two independent locks" precedent). Never warns-and-proceeds or auto-cancels (ADR-0010 Decision 4 explicitly rejects both): the caller mustcancel_jobor wait for completion first.The one live call.
GET /wait_reboot?reboot=true. HTTP 200 ->{"restart_triggered": true, "message": ...}(below). Anything else raisesRestartFailedError-- never a false "triggered" result.
Residual risk, accepted (ADR-0010): a job could start in the narrow window between check 2 and the actual reboot call -- accepted given this project's single-MCP-client assumption (A3), not engineered away.
Output on success: {"restart_triggered": true, "message": "OctoBot restart scheduled (~2s delay); the server will be briefly unreachable. Call wait_for_octobot_ready() next, then re-confirm the active profile via get_profile()/list_profiles() before starting a backtest."}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| confirm | No |