Skip to content

Delete ACP transport and MCP server; adapt GraphContextAssembler to write context files #1117

Closed

Description

@malibio

Overview

Remove the ACP transport layer, ACP session management, and MCP server integration that are superseded by ADR-032 (PTY-based agent sessions). Adapt GraphContextAssembler — the component that builds knowledge-graph context for agent sessions — to write CLAUDE.md or AGENTS.md files to a temp directory instead of streaming context over ACP.

This is the clean-break prerequisite for all PTY session work. It eliminates dead code and establishes the file-based context handoff that PTY-spawned agents expect.

Problem Statement

ACP transport, ACP session management, and the MCP server were the previous mechanism for agent-tool integration. ADR-032 replaces them entirely with PTY-spawned binaries that read context from files. Keeping the old code alongside new PTY code creates confusion about which path is authoritative and carries maintenance burden for code that will never again be invoked.

Proposed Solution

Delete the identified files. Adapt GraphContextAssembler (previously context_assembly.rs) to accept a session_dir: PathBuf and write the assembled context as a file. The agent catalog in registry.rs is updated to reflect the new PTY-based agent definitions.

Acceptance Criteria

  • packages/agent/src/acp/transport.rs deleted
  • packages/agent/src/acp/session.rs deleted
  • packages/desktop-app/src-tauri/src/commands/acp.rs deleted
  • packages/desktop-app/src-tauri/src/mcp_integration.rs deleted
  • All references to deleted modules removed from mod.rs / lib.rs / main.rs files
  • packages/agent/src/acp/context_assembly.rs adapted: accepts session_dir: PathBuf, writes CLAUDE.md for Claude Code sessions and AGENTS.md for all others
  • packages/agent/src/acp/registry.rs updated: agent catalog reflects PTY agents (Claude Code, Codex, Gemini CLI, Pi, OpenCode) with binary names and context file type
  • cargo build succeeds with zero warnings after deletions
  • cargo test -p agent passes
  • Code passes bun run quality:fix

Technical Specifications

Files to delete

  • packages/agent/src/acp/transport.rs
  • packages/agent/src/acp/session.rs
  • packages/desktop-app/src-tauri/src/commands/acp.rs
  • packages/desktop-app/src-tauri/src/mcp_integration.rs

Files to modify

  • packages/agent/src/acp/mod.rs — remove mod transport, mod session; keep context_assembly and registry
  • packages/agent/src/acp/context_assembly.rs — replace ACP streaming output with file write:
pub struct GraphContextAssembler { /* existing fields */ }

impl GraphContextAssembler {
    /// Assembles context from the knowledge graph and writes it to the
    /// appropriate context file in `session_dir`.
    /// Returns the path of the written file.
    pub async fn write_context_file(
        &self,
        session_dir: &Path,
        agent_type: AgentType,
    ) -> anyhow::Result<PathBuf> {
        let content = self.assemble_context().await?;
        let filename = match agent_type {
            AgentType::ClaudeCode => "CLAUDE.md",
            _ => "AGENTS.md",
        };
        let path = session_dir.join(filename);
        tokio::fs::write(&path, content).await?;
        Ok(path)
    }
}
  • packages/agent/src/acp/registry.rs — update AgentCatalog to PTY agent definitions:
pub struct AgentDefinition {
    pub binary:        &'static str,   // e.g. "claude", "codex", "gemini"
    pub context_file:  ContextFile,    // ClaudeMd | AgentsMd
    pub resume_flag:   Option<&'static str>, // e.g. Some("--resume")
}
  • packages/desktop-app/src-tauri/src/main.rs — remove mcp_integration setup and ACP command registration

Agent catalog (updated)

Agent Binary Context file Resume flag
Claude Code claude CLAUDE.md --resume <id>
Codex codex AGENTS.md resume <id>
Gemini CLI gemini AGENTS.md checkpoint-based
Pi pi AGENTS.md session-aware
OpenCode opencode AGENTS.md stateless

Shared guidance rules

context_assembly.rs imports from packages/agent/src/agent_guidance.rs (see #1089) to embed the same guidance rules in both the local agent system prompt and the written context files.

Dependencies

Non-Goals

  • Implementing the PTY session manager (next issue)
  • Writing the full context content strategy (basic graph summary sufficient for this issue; enriched in later issues)

Activity

  1. malibio commented on May 17, 2026

    @malibio
    CollaboratorAuthor

    Frontend baseline: 128 test files / 3918 tests passing, 0 failing (bun run test, 38.60s). Worktree branch: worktree-issue-1117.

  2. self-assigned this
    on May 17, 2026
  3. added a commit that references this issue on May 17, 2026
  4. added a commit that references this issue on Jun 22, 2026
    2050875
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions