Skip to content

feat(mcp-server)!: remove the repl tool and the repl-engine package - #515

Merged
VikashLoomba merged 2 commits into
mainfrom
feat/remove-repl-tool
Sep 18, 2026
Merged

VikashLoomba merged 2 commits into
mainfrom
feat/remove-repl-tool

Conversation

@VikashLoomba

Copy link
Copy Markdown
Collaborator

What

Removes the interactive repl MCP tool and everything that existed only to serve it. The MCP server's model-facing surface is now the workflow tool plus the capability-gated workflow_monitor view (and the app-only workflow-events / workflow-runs / workflow-notifications tools).

  • packages/repl-engine is deleted (≈18k lines of source, ≈13k of tests). Only mcp-server imported it; workflows declared it solely because its bundled MCP entry externalizes @automatalabs/*. quickjs-wasi drops out of the lockfile. The workspace is nine packages.
  • mcp-server: the six REPL-only modules (repl-tool, repl-project, repl-presence, repl-stdio-transport, repl-stdio-relay-worker, wasm-ambient.d.ts) are deleted, and the REPL is cut out of the shared files.

Scope decision

Kept by decision: the acp-agents / pi-acp / codex-acp SDK and wire surfaces whose only in-repo consumer was the REPL broker — InteractiveSession.awaitCurrentTurn() and the loaded-turn errors, the _session/loaded_turn extension, the turn-text passthroughs, onHandoff, InteractiveSession.steer, runner.defaultBackendId(). They are unchanged and remain supported; only comments and README passages that credited them to "the REPL broker" were reworded to describe the host re-attach surface.

Contract changes (@automatalabs/mcp-server, major)

  • repl is no longer registered; SERVER_INSTRUCTIONS describes workflow only.
  • Removed exports: replToolInputShape, replToolOutputShape, ReplToolOptions, createReplProjectState, ensureReplWorkspace, disposeReplProjectState, resetReplProjectState, renameAsideNeverOverwriting, ReplProjectState, ReplPresenceLedger.
  • CreateWorkflowServerOptions: drops replRunner, replPresence, replEvalBreakChannel, replDrainBoundMs, disconnectReplClientOnClose. replClientIdclientId: it had one non-REPL job — scoping workflow_monitor notification claims per legacy-era MCP client — so that capability is kept under an honest name (the daemon still passes each session's id).
  • WorkflowServerControl: drops replBreakUrl() (was required), replDefaultProjectDir(), disposeReplEvalBreakChannel(). The stdio entry had been using the last of those as its general shutdown hook (event-subscription detach + permission-broker dispose); that is now a generic optional dispose().
  • The in-process stdio entry serves over the SDK's StdioServerTransport. The worker-thread relay transport existed only to break a synchronous eval out of band; it and the shim's tools/call interception are gone.
  • Daemon: the client-presence ledger and drain are removed with everything that fed them — CreateDaemonOptions.replRunner / replDrainBoundMs / sessionTtlMs / evalBreakChannel, DaemonHandle.activeReplDrainCount(), WorkflowProjectRegistry.disposeReplStates(), ProjectContext.repl, DaemonInfo.replBreakUrl, the SessionRegistry presence hooks and evictDrainable's keep veto (their sole consumer was the ledger). Idleness is sessions, runs and in-flight requests.
  • Env knobs removed: AGENTPRISM_REPL_EVAL_TIMEOUT_MS, AGENTPRISM_REPL_DRAIN_BOUND_MS.
  • Existing per-project repl/ stores on disk are left untouched and no longer read. No compatibility layer.

@automatalabs/workflows is also a major: its bundled mcp subcommand no longer serves repl and the repl-engine dependency is dropped. The programmatic SDK is unchanged.

Tests (deletions and rewrites named, per AGENTS.md)

  • Deleted: the seven REPL-only mcp-server test files; the http-daemon presence-drain test; the live "REPL queue smoke"; the daemon-lifecycle "drain in flight" test.
  • Rewritten, coverage kept:
    • Two shim recovery e2e tests used a never-ending repl eval as their accepted-but-unanswered request. They now start a live workflow config probe and freeze the daemon mid-probe (SIGSTOP) before killing it. (A request that never reached the daemon is a different case — the legacy path deliberately replays it — which is why a plainly frozen daemon was not a valid substitute.)
    • The live "invalid modes fail before execution" assertion moves from a repl eval to the workflow tool, which is stricter: it refuses at preparation, creating no run.
    • The idle-clock-restart test uses an active run instead of a drain; the session-registry test drops the veto case.
    • Tool-inventory assertions drop "repl"; the documented package count moves from ten to nine.

Docs

README, AGENTS.md, CONTRIBUTING.md, docs/api.md (three REPL sections removed) and the mcp-server / workflows READMEs drop the REPL. docs/roadmap/repl-orchestrator.md and repl-eval-redesign.md move to docs/archive/roadmap/ (design records of a removed feature); the one live cross-reference is updated. docs/authoring/ and the generated skills bundle had no REPL content and are unchanged.

Verification

pnpm build, pnpm typecheck, all nine package suites (2,246 tests, 0 failures), check-acp-deps, check-workflows-bundle-deps, attribution gate, changeset status, and the pre-push live (Claude / OpenCode / pi) + UI gates pass. One pnpm test run tripped workflow-engine's timing-bound journal test (3.5s against its bound) while the machine load average was ~26; it passes in 0.6s alone and on re-run, and this branch does not touch workflow-engine.

Follow-up outside this repo

@automatalabs/repl-engine@0.4.39 stays on npm. It should be marked deprecated there (npm deprecate), which needs publish rights and is not something CI does.

The MCP server's model-facing surface is now the workflow tool plus the
capability-gated workflow_monitor view. The interactive per-project
QuickJS REPL, its broker and its snapshot store are removed, and
@automatalabs/repl-engine, which only mcp-server imported, is deleted
from the workspace.

mcp-server: drop the repl tool registration, its exports, the REPL
options on CreateWorkflowServerOptions, the eval-break members of
WorkflowServerControl (the stdio entry's shutdown hook becomes a generic
optional dispose), the worker-thread relay stdio transport (the entry now
serves over the SDK StdioServerTransport) and the shim's out-of-band
eval-break. The daemon loses the client-presence ledger and drain with
everything that fed it: activeReplDrainCount, disposeReplStates,
ProjectContext.repl, DaemonInfo.replBreakUrl, the SessionRegistry
presence hooks and evictDrainable's keep veto. replClientId had one
non-REPL job, scoping workflow_monitor notification claims per legacy
client, and stays as clientId. The AGENTPRISM_REPL_EVAL_TIMEOUT_MS and
AGENTPRISM_REPL_DRAIN_BOUND_MS knobs are gone.

workflows: the bundled MCP server no longer serves repl and the package
no longer depends on repl-engine.

acp-agents, pi-acp, codex-acp: comments and README passages that credited
awaitCurrentTurn, the _session/loaded_turn extension and the turn-text
passthroughs to the REPL broker now describe the host re-attach surface.
Those SDK and wire surfaces are deliberately unchanged.

Tests: the seven REPL-only mcp-server test files and the REPL cases in
shared files are deleted. Two shim recovery tests borrowed a never-ending
repl eval as their accepted-but-unanswered request; they now use a live
config probe frozen mid-flight. The live invalid-mode check moves to the
workflow tool, which refuses at preparation. The idle-accounting and
session-registry tests keep their coverage without drains or vetoes, and
the documented package count moves from ten to nine.

Docs: README, AGENTS.md, CONTRIBUTING.md, docs/api.md and the package
READMEs drop the REPL; the two REPL roadmap documents move to
docs/archive/roadmap.
Resolve the modify/delete conflicts on packages/repl-engine: the Version
Packages release bumped a package this branch deletes.
@VikashLoomba
VikashLoomba merged commit 21bb2ca into main Sep 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant