Skip to content

v0.3.0

Latest

Choose a tag to compare

@github-actions github-actions released this 01 Dec 08:22

Explicit REPL sessions

Python REPL MCP now keeps separate workers for chats that share one dispatcher, even when those chats use the same directory. DSH cannot supply the OpenCode session metadata that the old API used; with 0.2.6's implicit routing, such chats could end up in the same worker. In 0.3.0, each chat opens its own session and supplies the returned UID explicitly.

Breaking migration from 0.2.x

  1. Call repl_open_session(workdir) with an existing absolute directory. Each call starts a new worker in that directory and returns session_uid, workdir, and kernel_id.
  2. Pass session_uid to repl_execute, repl_run_file, repl_reset, and repl_stop. The _meta, PYTHON_REPL_MCP_SESSION, PYTHON_REPL_MCP_WORKDIR, and default-session routing are removed.
  3. repl_reset keeps the UID and replaces the worker. repl_stop, idle expiry, or confirmed terminal worker loss invalidates it. If a chat loses its UID, call repl_open_session again; the new worker starts with a clean namespace.

The default limit is 16 sessions per dispatcher. The idle timeout is 1,800 seconds by default and can be set with PYTHON_REPL_MCP_IDLE_TIMEOUT (seconds; 0 disables expiry). Idle expiry never interrupts an executing cell.

Install on Windows with Python 3.14:

uv pip install --upgrade python-repl-mcp==0.3.0

Verification

Verified with 180 local tests, Windows CI, two independent lifecycle checks, and two native OpenCode 2.4.3 chats using the published wheel and one dispatcher. The tests confirmed distinct worker PIDs, namespace isolation, and UID reuse across turns. Native DSH acceptance is still pending.