Skip to contents

"interrupt" sends SIGINT to the running code or dependency install and keeps the session's state. The code may not stop, so check the returned output: it can still end in [running; poll with an empty send]. "restart" replaces the worker and discards all R, Python and DuckDB state in the selected session.

Usage

mcp_console_control(
  connection,
  action = c("interrupt", "restart"),
  session = NULL
)

Arguments

connection

A connection created by mcp_console_connection().

action

"interrupt" or "restart".

session

Optional named session to target (defaults to NULL, which targets MCP Console's "default" session).

Value

A promise for MCP Console's reply. The call goes straight to the server, not through the agent, and errors if the connection is already handling a request.

Details

If a restart takes longer than about 4 seconds, the connection closes with a deputy_mcp_console_restart error and the server stops. Create a new connection to continue.