Repository navigation
Feature: Let ACP agents run builds, tests, and scripts in MandoCode terminals with live output and automatic cleanup - #152
Merged
Conversation
Add typed create, output, wait, kill, and release messages and register them with the JSON source generator. Route terminal requests only when the client advertises terminal support, reject unknown sessions, and require an active turn before launching commands. Expose the active session cancellation token so host commands remain attached to the owning turn rather than a short-lived RPC request. Preserve compatibility for handlers that do not provide terminal support.
…output Introduce a reusable process manager with literal executable arguments, merged live stdout/stderr, UTF-8 tail buffering, exit status, and explicit wait, kill, and release operations. Enforce a ten-minute command lifetime, eight running commands, 32 retained IDs, and a one-MiB output ceiling. Adapt the backend to ACP with session ownership, configured environment handling, and project-directory validation including link boundaries. Stop owned process trees on cancellation and clean up terminals when sessions are cleared, fail, or are disposed. Keep kill and release semantics distinct and make disposal idempotent.
…ommand rows Provide create_terminal, get_terminal_output, wait_for_terminal, kill_terminal, and release_terminal through the existing MandoCode MCP bridge. Resolve ownership from the connected pane and active session, reuse the protocol backend, and retain command lifetime beyond individual MCP calls. Render command output, truncation, and completion status in expandable transcript rows. Keep final output visible across turns and after release, bound the live display cache, and avoid marking running host commands incomplete when a model turn ends. Wire terminal services into ACP startup and add the per-agent clientTerminals setting, enabled by default. Disabling it removes both protocol and MCP terminal access; the MCP route also respects the existing bridge setting.
Extend the mock adapter and command fixture to exercise all five terminal methods, real MCP calls, capability opt-out, active-session checks, and stale terminal IDs. Verify the terminal DTOs against the vendored ACP v1 schema. Cover literal arguments, environment and working directory rules, stdout/stderr, output without newlines, Unicode tail limits, large output floods, and nonzero exit codes. Exercise cancellation with child processes, pane isolation, wait timeouts, release behavior, and cleanup on clear, crash, and disposal. Verify live command rows retain final output across turns and release, and that the per-agent terminal flag controls host capabilities. Validation: full .NET 10 Release suite passed 2,038 tests with one existing skip; manual Codex create/wait/release returned SDK 10.0.401 and exit code zero.
Document protocol and MCP terminal access, live transcript output, executable arguments, session cleanup, and the clientTerminals opt-out. Explain environment handling, working directory boundaries, command and output limits, and that commands run with ordinary user permissions rather than a filesystem sandbox. Record terminal support in the upcoming release highlights and test coverage. Clarify that ACP v1 is sufficient and this change does not add ACP v2 negotiation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this solves
ACP agents can now run non-interactive commands through MandoCode and show their output directly in the conversation. This makes builds, tests, and scripts visible and manageable in the same pane where the work is requested, without waiting for ACP v2.
What changes for users
clientTerminals: false. MCP access also requires the existing MandoCode bridge setting.Execution boundaries
Commands run with ordinary user permissions and the ACP entry's environment rules. The starting directory must remain inside the pane's project, including through links; this is not a filesystem sandbox. Commands are non-interactive and use an explicit executable plus arguments, with an explicit shell when shell syntax is needed.
Each command has a ten-minute limit. Output defaults to 64 KiB and is capped at 1 MiB, retaining the most recent complete UTF-8 text. Each runtime permits eight running commands and 32 retained terminal IDs. Released IDs cannot be reused. ACP v2 negotiation is outside this change.
Validation
create_terminalrandotnet --version,wait_for_terminalreturned 10.0.401 with exit code 0 and no truncation, andrelease_terminalsucceeded while keeping the output visible.Review organization
Five detailed commits separate protocol support, process lifecycle, MCP/UI integration, regression coverage, and README/changelog updates.
Related to #144 (terminal capability work).