Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 28 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<a href="https://github.com/RazorConsole/RazorConsole"><img src="https://img.shields.io/badge/RazorConsole-0.6.0-8A63D2" alt="Built with RazorConsole 0.6.0"></a>
<img src="https://img.shields.io/badge/Ollama-Local%20LLM-black?logo=ollama" alt="Ollama">
<img src="https://img.shields.io/badge/Platform-Windows%20%7C%20Linux-lightgrey" alt="Platform">
<img src="https://img.shields.io/badge/Made%20with%20%3C3%20by-Mando-red" alt="Made with <3 by Mando">
<a href="https://buymeacoffee.com/devmando"><img src="https://img.shields.io/badge/Buy_Me_a_Coffee-Support-FFDD00?logo=buymeacoffee&logoColor=black" alt="Support MandoCode on Buy Me a Coffee"></a>
</p>

<p align="center">
Expand Down Expand Up @@ -509,7 +509,7 @@ at a pinned version; MandoCode never downloads anything. The agent signs in with
`ANTHROPIC_API_KEY` is not passed to it unless you opt in. MandoCode does not sandbox the agent: permission
questions are relayed, and the agent applies the answers itself.

Use `/agent-acp add codex` for Codex adapter installation and registration guidance. After registering an agent:
Use `/agent-acp add codex` for Codex adapter installation and registration guidance. After registering an agent (the `/acp-agent` and `/acp-agent-mode` spellings are also supported; `/agent-acp` remains compatible):

```text
/agent-acp test codex
Expand All @@ -526,6 +526,31 @@ re-read files before the next request. `/clear` starts a fresh ACP conversation
`/agent-acp <name> --resume` requests the remembered session for this folder; `/agent-acp sessions` lists available
sessions when supported. Agent memory and session continuation depend on the adapter.

ACP agents receive a built-in `mandocode` MCP server for the open-agent directory, collaboration, and saved
conversation snapshots. Type `@`, then Tab to select another agent. Try `Ask @Ares what it found and let me know
later.` Each agent keeps its own project and approvals; busy agents are not interrupted, and mentions alone do not
start work. ACP agents can receive questions and tasks from other agents. Use a native agent for read-only reviews,
since MandoCode cannot enforce an external agent's editing permissions.

Ask the ACP agent to list, read, or save a conversation snapshot with the bridge's `list_snapshots`, `read_snapshot`,
and `create_snapshot` tools. Snapshots store a supplied recap with its source project; they do not restore native
history. The same snapshot picker is available in ACP panes with Alt+C or `/context-snapshot`.
Use `/context-snap-import` to browse and import, or `/context-snap-create` to save the visible ACP conversation
using the connected ACP agent and its current model. No Ollama connection is needed for ACP snapshot creation.
Imports attach the recap to the next ACP message; failed requests retain it for retry. Imported recaps are text, so file mentions inside a recap do not attach files automatically.
The bridge is private to that pane and replaced on restart or folder change. Set `"mandoCodeMcp": false` in
an `acpAgents` entry to disable it.

ACP agents can discover and read enabled MandoCode skills with `list_skills`, `load_skill`, and
`read_skill_resource`. Project skills override matching user skills, and disabled skills stay hidden. Resource
reads are restricted to the selected skill folder and do not execute scripts. Native skill management and third-party
`mcpServers` settings remain separate; configure third-party servers through the adapter's own tooling.

When switching this pane between native and ACP agents, choose whether to carry a conversation recap. The agent
you are leaving generates it, and the next user message delivers it as reference context to the target. Declining
keeps the target's existing conversation without adding a recap; cancellation or a failed recap keeps the source
agent active. Explicit `--resume` continues the target session without the handoff question.

### Config File

Located at `~/.mandocode/config.json`
Expand Down Expand Up @@ -974,6 +999,4 @@ MandoCode exists partly to prove the point: you can build a full-featured, agent

## Support MandoCode

If MandoCode helps your workflow, you can support its development by buying me a coffee.

<a href="https://buymeacoffee.com/devmando"><img src="https://img.shields.io/badge/Buy_Me_a_Coffee-Support-FFDD00?logo=buymeacoffee&logoColor=black" alt="Support MandoCode on Buy Me a Coffee"></a>
If MandoCode helps your workflow, you can support its development by [buying me a coffee](https://buymeacoffee.com/devmando).
29 changes: 26 additions & 3 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ All notable changes to MandoCode will be documented in this file.

## [Unreleased]

**External agents, clearer session controls, and smoother workspace switching.** Run coding agents through ACP, including Codex through its tested adapter. See the connected agent, model, and mode at startup, change the session mode with `/agent-acp-mode`, and expand individual tool calls to inspect their details. Reduce visible top-to-bottom repainting when switching workspaces, including from multiple agent panes to a blank conversation. The CLI also includes RazorConsole 0.7.0's upstream focus fix and retains MandoCode's startup rendering safeguard.
**ACP and Ollama agents can collaborate, share skills, and carry conversation context between them.** Ask open agents questions, delegate work, and follow their replies through compact exchange sections. Use the same snapshot picker in ACP and native panes; ACP snapshots use the connected ACP agent and its current model. Carry an optional source-generated recap when switching agents, and use `/acp-agent` alongside the compatible `/agent-acp` commands. This release also includes clearer ACP session controls, smoother workspace switching, RazorConsole 0.7.0's upstream focus fix, and MandoCode's startup rendering safeguard.

**Highlights**

- Collaborate between ACP and native Ollama agents with agent mentions, questions, background tasks, messages, and progress tracking.
- Discover enabled user/project skills and read their instructions and referenced text files from ACP through the built-in MandoCode MCP bridge.
- Create/import snapshots with Alt+C or `/context-snapshot`, and optionally carry a recap generated by the source agent when switching agent types.
- Read agent exchanges with one participant heading, Request/Reply sections, and status updates that do not add repeated acceptance or delivery notices.

- Run Codex through the existing ACP client, with documented setup and authentication handled by Codex.
- Choose the external agent's permission and behavior mode without starting another conversation.
- Follow ACP tool calls through compact, expandable rows that update in place.
Expand All @@ -18,6 +23,18 @@ All notable changes to MandoCode will be documented in this file.

### Added

- Offer a source-agent recap when switching between native and ACP agents, with opt-out and cancellation before changing runtimes.

- Share enabled user/project skills through read-only MCP discovery, instruction loading, and bounded text-resource reads inside the skill folder.

- Accept `/acp-agent` and `/acp-agent-mode` command spellings alongside the compatible `/agent-acp` commands, preserving argument casing and exposing the new spellings in command suggestions.

- Enable the shared snapshot picker, Alt+C, and snapshot creation/import commands in ACP panes. Add `/context-snapshot` as a picker shortcut. Capture the visible ACP transcript, summarize with that ACP agent and its current model, and attach imported recaps to the next ACP prompt as text. Preserve imports on cancellation or project-update failure, consume successful imports once, and discard them on `/clear`.

- Simplify agent exchanges with one participant heading, compact Request/Reply sections, and status updates in place. Remove repeated request boxes, acceptance notices, and delivery confirmations; keep failures, queued-message notices, and background job references visible.

- Connect ACP panes to MandoCode's open-agent directory, collaboration tools, and saved snapshots through a private built-in MCP server. Use agent mentions and exchange questions or tasks with native and ACP peers while preserving per-agent identity, call-loop protection, cancellation, and job ownership. Restarting or changing folders revokes the old bridge. Disable it per agent with `mandoCodeMcp: false`; native skill management, saved native history, and third-party MCP settings remain separate. ACP recipients decline read-only reviews because their editing permissions cannot be enforced by MandoCode.

- ACP folder changes retain the selected pane's transcript and attempt to continue its session in the new folder. If the adapter starts fresh, offer a bounded recent-text handoff or a fresh context. Send a project-change note before the next request so the agent rechecks old paths and files. Other ACP panes remain unchanged; `/clear` discards pending handoff context. Use the same concise folder-change wording as native conversations, without repeating the connection card or internal acknowledgment.

- Paste clipboard images into ACP prompts with Alt+V when the connected agent advertises image support. Send in-memory PNG image blocks with text, retain per-pane attachment references and size limits, and explain unsupported agents or expired images without sending an incomplete prompt.
Expand All @@ -26,16 +43,18 @@ All notable changes to MandoCode will be documented in this file.

- `/agent-acp-mode` opens a picker for the connected agent's permission and behavior modes, including the current selection and agent-provided descriptions. Select a mode directly with `/agent-acp-mode <name>`. Changes preserve the current conversation, apply only to the ACP session, and are refused during active work. Agents without advertised modes receive an explanation.
- Codex ACP setup guidance through `/agent-acp add codex`, using the pinned `@agentclientprotocol/codex-acp` 2.6.0 adapter and the existing ACP pane implementation. Document installation, external authentication, command boundaries, and the verified connection and streamed reply on Windows. Setup guidance does not install software or change configuration automatically.
- External agents over the Agent Client Protocol (ACP v1, stdio), phases 1–2 of the ACP client. `/agent-acp <name>` switches the current pane to an agent (for example Claude Code through an ACP adapter; `--new-panel` opens a new pane, `stop` returns to the native agent, and the native session stays alive underneath without sharing context); `/agent-acp list|status|restart|add|test|remove|enable|disable` manage the `acpAgents` entries of `~/.mandocode/config.json`, and `mandocode --acp-probe <name>` checks a connection. The protocol layer is the new `MandoCode.Acp` library (own thin implementation, no third-party ACP package).
- External agents over the Agent Client Protocol (ACP v1, stdio), phases 1–2 of the ACP client. `/agent-acp <name>` switches the current pane to an agent (for example Claude Code through an ACP adapter; `--new-panel` opens a new pane, `stop` returns to the native agent, and the native session stays alive underneath; a source-generated recap can be carried explicitly); `/agent-acp list|status|restart|add|test|remove|enable|disable` manage the `acpAgents` entries of `~/.mandocode/config.json`, and `mandocode --acp-probe <name>` checks a connection. The protocol layer is the new `MandoCode.Acp` library (own thin implementation, no third-party ACP package).
- Agents are started without a shell from a real executable (`.exe`/ELF; `.cmd`, `npx` and shells are refused), after confirming the full command; the confirmation is remembered per command hash and asked again when the entry changes. `acpAgents` is read only from the user config, and `ANTHROPIC_API_KEY` is not passed to the agent by default.
- The ACP pane streams the reply, shows tool calls, plans and diffs, and relays the agent's permission questions as a menu (Escape cancels). It serves `fs/read_text_file` and `fs/write_text_file` inside the project folder, refusing symlinks and junctions that lead outside it, with atomic writes. Escape cancels a turn; an agent that ignores the cancel is shut down with its whole process tree.
- ACP panes have a clear boundary to native behaviour: one restriction set hides and blocks what does not apply (`/mcp`, `/skills`, `/history`, `/plan*`, Alt+S/C/K/M/H/V, the `@` picker's Agents group). `/clear` starts a new ACP conversation in the same agent process and folder (the native conversation is untouched), `/copy` and `/copy-code` use the pane's own last reply, `/model` picks from the agent's model option, `/compact` sends the agent's own compact command, and a folder change restarts the agent after confirmation. `@file` mentions use the shared parser (quoted paths with spaces work) and the same project-folder guard.
- ACP panes keep native-only model settings, planning, saved native history, and integration management separate (`/mcp`, `/skills`, `/history`, `/plan*`, and Alt+S/K/M/H). The snapshot picker and Alt+C work in ACP panes; Alt+V follows the connected agent's image capability. The `@` picker includes agents when the built-in bridge is enabled, while file mentions retain the project-folder guard. `/clear` starts a new ACP conversation, `/copy` and `/copy-code` use that pane's last reply, `/model` selects an advertised model, and `/compact` sends the agent's own command. Folder changes restart only the selected ACP pane and retain its transcript.
- `/agent-acp <name> --resume` continues the last session of the folder (`session/resume`, or `session/load` with the history replayed) and `/agent-acp sessions` lists the agent's sessions; MandoCode remembers only session ids in `~/.mandocode/acp-sessions.json`.
- Optional message trace for debugging an agent (`"trace": true` on the entry or `MANDOCODE_ACP_TRACE=1`): direction, method, id and size per message, never content.
- `ApprovalSelectCoordinator.Cancel()` and an opt-in Escape for approval menus (native menus are unchanged).

### Changed

- Move the Buy Me a Coffee badge alongside the project badges, remove the Made with <3 by Mando badge, and retain a concise support link in the README footer.

- **The next release requires .NET 10.** Remove the .NET 8 CLI and ACP library builds, test target, and CI jobs following Microsoft's November 10, 2026 end of support. The NuGet tool package now includes only `net10.0` assets. Install the .NET 10 SDK before updating; previously published versions are unchanged. Update development, test, and release guidance to match.

- Show ACP tool calls as persistent, expandable activity rows with status updates in place, concise summaries, and bounded command/output details. Attach completed diffs to their call and show terminal-output limitations only inside the details. Preserve permission denial and mark unfinished calls honestly when a turn ends or is interrupted. Native tool groups retain their existing behavior.
Expand All @@ -47,6 +66,8 @@ All notable changes to MandoCode will be documented in this file.

### Fixed

- Retain ACP session updates that arrive before session creation or resume has finished registering the session ID. This prevents intermittent missing advertised commands at startup without increasing timeouts; updates for genuinely unknown sessions still receive diagnostics.

- Batch synchronized terminal frames into one output write, reducing fragmented row-by-row delivery during large workspace transitions. Preserve terminal size and encoding, pass non-frame output through, bound buffering, and release interrupted frames at shutdown.
- Enable synchronized terminal frames to reduce visible top-to-bottom repainting on terminals supporting synchronized output. Publish one completed workspace-switch notification instead of three intermediate redraw requests, preserving pane focus and background sessions.
- Reuse unchanged conversation snapshots and transcript groups during focus, scrolling, and status updates. Avoid copying and regrouping the full history on these refreshes while keeping streamed output, tool expansion, late agent replies, and cleared conversations current.
Expand All @@ -55,6 +76,8 @@ All notable changes to MandoCode will be documented in this file.

### Test coverage

- The final ACP collaboration update passed 1,990 tests with one existing skip on .NET 10 Release. Real stdio MCP checks cover tool discovery, owning-pane identity, active-turn restrictions, call-loop prevention, cancellation, snapshot operations, skill precedence/disabled files, resource boundaries, and connection revocation. Component checks cover snapshots without Ollama, import retries and images, optional source-agent handoffs, compatible command spellings, and compact exchange rendering. A regression deliberately announces a command before the session/new response. Final focused checks and user testing also passed.

- Verify frame batching through the actual RazorConsole live canvas: a large-to-blank transition produces identical ANSI output in one underlying writer call. Cover fragmented frame markers, interrupted-frame shutdown, bounded buffering, and output restoration. All 59 selected rendering, workspace, and routing checks pass on both net8.0 and net10.0.
- Cover reuse of long conversation snapshots, updated streaming status, cleared history, retained expansion, and late agent replies. During this rendering work, a full-suite run passed 1,924 tests with one skip on net10.0; net8.0 passed 1,923 with one skip and hit the previously observed ACP command-notification timeout. The final frame-batching change was validated with the targeted checks above. The user also confirmed that batching resolved the visible workspace repaint sweep in their terminal.
- Add rendering regressions for no-op picker closure, one focus transition per agent-tab selection, quiet idle polling, one body repaint per pane on focus changes, and continued awaiting-input updates. A two-pane test that previously rebuilt agent bodies six extra times over 750 ms now performs no extra idle rebuilds.
Expand Down
Loading