Repository navigation
Description
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.rsdeleted -
packages/agent/src/acp/session.rsdeleted -
packages/desktop-app/src-tauri/src/commands/acp.rsdeleted -
packages/desktop-app/src-tauri/src/mcp_integration.rsdeleted - All references to deleted modules removed from
mod.rs/lib.rs/main.rsfiles -
packages/agent/src/acp/context_assembly.rsadapted: acceptssession_dir: PathBuf, writesCLAUDE.mdfor Claude Code sessions andAGENTS.mdfor all others -
packages/agent/src/acp/registry.rsupdated: agent catalog reflects PTY agents (Claude Code, Codex, Gemini CLI, Pi, OpenCode) with binary names and context file type -
cargo buildsucceeds with zero warnings after deletions -
cargo test -p agentpasses - Code passes
bun run quality:fix
Technical Specifications
Files to delete
packages/agent/src/acp/transport.rspackages/agent/src/acp/session.rspackages/desktop-app/src-tauri/src/commands/acp.rspackages/desktop-app/src-tauri/src/mcp_integration.rs
Files to modify
packages/agent/src/acp/mod.rs— removemod transport,mod session; keepcontext_assemblyandregistrypackages/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— updateAgentCatalogto 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— removemcp_integrationsetup 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
malibio commentedon May 17, 2026
Frontend baseline: 128 test files / 3918 tests passing, 0 failing (bun run test, 38.60s). Worktree branch: worktree-issue-1117.
Address review feedback for #1117
Delete ACP transport/MCP server; rework GraphContextAssembler to writ…