Skip to content

[Feature]: Add ACP client support #137

Closed

Description

@TeseySTD

Summary

MandoCode currently talks to models directly (Ollama via Microsoft Agent
Framework). I'd like to propose an optional ACP client mode, so MandoCode
can also drive external coding agents (Claude Code via an ACP adapter,
Gemini CLI, Copilot CLI, Cline, ...) as subprocesses over stdio. This
complements the Claude / Foundry / OpenAI provider work planned for
v0.17.0 rather than replacing it.

Why

  • Allows to use not the API only but also the subscription.
  • Auth stays in the native tool: the user logs in with claude themselves,
    MandoCode never touches their credentials/tokens.
  • One integration gives access to many agents.

Protocol notes (as of Nov 2026)

  • Target ACP v1 (current stable). v2 is still a Draft and breaks parts
    of v1 (fs/terminal client APIs removed, new prompt lifecycle), so I'd
    gate it behind version negotiation later.
  • Transport: JSON-RPC 2.0 over stdio (NDJSON). Remote HTTP/WebSocket is
    only a draft RFD, out of scope.
  • Flow: initialize -> (authenticate) -> session/new | session/resume
    -> session/prompt, with streamed session/update notifications and
    session/cancel.

Implementation

Out of scope (for now)

  • ACP agent mode (exposing MandoCode to editors)
  • ACP v2, remote HTTP/WebSocket transport

TUI/CLI examples:

  • Toad
  • acpx (CLI)
  • Hydra
  • Martty — extensible Rust/ratatui terminal client for DeepSeek Harness and other ACP-compatible agents
  • Nori CLI
  • pool
  • SpurCode — Rust-native terminal orchestrator that runs a mixed fleet of ACP agents (Claude Code, Codex, Gemini, Kimi, OpenCode and more) in parallel across Git worktrees, from one TUI

Spec: https://agentclientprotocol.com

Activity

  1. DevMando commented on Nov 9, 2026

    @DevMando
    Owner

    @TeseySTD
    Hey! This is a great suggestion. I wasn’t familiar with ACP before you brought it up, so I took some time to look through the proposal and documentation. Thanks for including the protocol details, library options, and examples. They helped me see how this could fit into MandoCode.

    Here’s what I’m thinking for integrating it into the current workflows and UI.

    Setup and management

    I’m leaning toward a dedicated /agent-acp command. It would open a picker to select a configured external agent, add a connection, or manage existing connections. Settings would expose the same configuration screen.

    Connection setup would include a display name, launch command or adapter, arguments, and a connection check. Authentication would stay with the external tool’s supported flow. We’d verify authentication and subscription support for each integration.

    Disconnecting an agent, closing a conversation, and removing a saved configuration would be separate actions. Removing a configuration shouldn’t silently terminate sessions, uninstall the tool, or delete its history.

    Continuing an existing conversation

    If someone is already working with a native MandoCode agent, selecting an external agent through /agent-acp would offer:

    • Continue with context: prepare a recap of the task, findings, decisions, relevant files, and remaining work for review before sending.
    • Start fresh: connect without sharing the existing conversation.

    For an empty conversation, it would connect and wait for the first prompt. Running the command alone wouldn’t send context or start work.

    I’d like this transition to happen within the same tab or pane, with a clear transcript marker showing where the agent changed. Underneath, these would remain separate sessions, with the original session preserved for recovery.

    The user could then watch streamed replies and reported activity, answer permission requests, send follow-up prompts, and cancel work. The header would identify the active agent, model when available, and project folder.

    Models and returning to MandoCode

    I initially considered adding ACP to /model, but keeping agent selection separate feels clearer.

    Within an ACP session, /model would show model choices reported by that external agent, when supported. Returning to a native MandoCode agent would use an explicit context handoff, potentially within the same pane.

    That distinction matters because changing runtimes also changes the available tools, permissions, and session management.

    Snapshots and collaboration

    Context snapshots could provide a bridge between native and external agents. For example, a native agent could investigate a bug, capture its findings, and pass that recap to an external agent to continue. The same could work in reverse.

    The snapshot would transfer useful context, rather than claim to transfer the agent’s internal state or permissions. Restoring an external agent’s original session would depend on its session-loading capabilities.

    Later, external-agent conversations could appear alongside native agents in the @ picker. That would give us a familiar entry point for questions, reviews, and task handoffs while keeping each agent’s work visible in its own conversation.

    Things to account for

    Before expanding the integration, I think we need clear behavior around:

    • Session restoration: resuming an existing external session versus starting another with a recap.
    • Switching during work: stopping the current turn and resolving pending approvals before transferring responsibility.
    • Permissions: presenting external-agent permission requests without implying that native MandoCode enforcement controls everything the agent does.
    • Supported features: exposing model selection, images, planning, compaction, and other functions according to the agent’s capabilities.
    • Commands: distinguishing MandoCode commands from external-agent commands when names overlap.
    • Recovery: preserving conversations after a process failure without accidentally repeating work.
    • Isolation: keeping context, approvals, and cancellation separate across concurrent sessions.

    Implementation approach

    I’m thinking of approaching it in four phases:

    1. Protocol and library validation. Start with one external agent and evaluate the compatible C# libraries against the schema-generated alternative. Verify .NET 8 and .NET 10 compatibility, streamed updates, permissions, cancellation, and shutdown. Keep the scope to ACP v1 over stdio.

    2. Basic CLI support. Add configuration, connection testing, /agent-acp, fresh sessions, streaming, permission handling, cancellation, and clear errors.

    3. Context and continuity. Add reviewed handoffs, transitions within the same pane, transcript markers, snapshots, and session restoration where supported.

    4. Collaboration and Desktop. Extend supported @ interactions and bring the shared implementation into Desktop’s workspaces, tabs, and split views.

    That’s the direction I’m considering. I’d be interested in your perspective, particularly whether you’ve already tried either C# library and any lifecycle or rendering considerations you see from the RazorConsole side.

    Which agent would you personally want to connect first? Would you mainly use it for fresh tasks or to continue work started with a native MandoCode agent? That would help shape the first integration and where context handoff fits in the phases.

    Also, were you interested in working on an initial implementation? I’m happy to take it on or have you contribute, Either way, your research gives us a great starting point!! 😎

  2. TeseySTD commented on Nov 10, 2026

    @TeseySTD
    ContributorAuthor

    Thanks for the detailed plan, it looks great to me.

    1. First agent: Claude Code (via an ACP adapter, with the user logged
      in through claude itself).
    2. Both: fresh tasks, and continuing work started with a native
      MandoCode agent, so the context handoff in phase 3 matters to me.
    3. Yes, I'd like to work on the implementation.
    4. I'm a RazorConsole contributor, so I can help with the rendering and
      lifecycle side of streamed updates and permission prompts.

    On the libraries: I'd rather build a thin in-house client on ACP v1
    (stdio, NDJSON) than depend on an early-stage community package. I'll
    base the types on the official schema.json and keep the transport and
    protocol layers separate, so a library can still be swapped in later if
    it matures. I'll validate it with Claude Code in phase 1 (net8.0 and
    net10.0, streaming, permissions, cancellation, shutdown).

  3. DevMando commented on Nov 11, 2026

    @DevMando
    Owner

    @TeseySTD Awesome, sounds good to me! The thin in-house client approach makes sense, especially with transport and protocol kept separate so we have flexibility later.

    Starting with Claude Code and validating those core flows on both .NET targets sounds like a solid first step. We can keep the initial PR focused on that foundation, then build the setup UI and context handoff on top.

    It would also be helpful to capture which adapter and authentication setup you test with, so we can reproduce it.

    I’ll focus on the direct-provider work in parallel. Thanks for taking this on! Looking forward to seeing it come together.

  4. added
    enhancement
    good first issue
    provider
    on Nov 11, 2026
  5. DevMando commented on Nov 13, 2026

    @DevMando
    Owner

    Implemented in #140, with additional Codex support and session improvements in #142.

    Thank you @TeseySTD for proposing this, researching the options, and contributing MandoCode’s ACP client! Really appreciate the work and collaboration. This gives us a great foundation to build on.

    Closing this as completed. Context handoffs, deeper agent collaboration, and Desktop integration will be tracked separately as follow-up work.

    Great work!!!! 😎 Much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issueprovider

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions