Skip to content

[Phase 4] Aider Engine Adapter #413

Description

@frankbria

Summary

Implement an AgentAdapter for Aider, allowing CodeFrame to use Aider's established code editing capabilities as an execution engine.

Parent issue: #408

Motivation

Aider is a mature, open-source AI coding assistant with strong file editing capabilities and multi-model support. It has a different interaction model (message + explicit file list) that complements CodeFrame's orchestration.

Scope

New module: core/engines/aider.py

  1. AiderAdapter implementing AgentAdapter:
class AiderAdapter:
    name = "aider"
    requires_api_key = {}  # Aider manages its own API keys
    
    def execute(self, task_prompt, workspace_path, context, timeout_ms):
        # 1. Build file list from context
        # 2. Launch: aider --message <prompt> --yes-always <files>
        #    with cwd=workspace_path
        # 3. Capture output
        # 4. Parse results into AgentResult
        ...
  1. Aider CLI invocation:

    • --message: task prompt from context packager
    • --yes-always: auto-confirm for automated execution
    • --no-auto-commits: let CodeFrame manage git (important!)
    • File list from context.relevant_files
    • --model: configurable (default: whatever Aider's default is)
  2. Output parsing:

    • Parse Aider's output for success/failure indicators
    • Detect modified files from Aider's output or git diff
    • Extract summary from Aider's completion message
  3. Configuration:

    • aider_path: path to Aider binary (default: aider)
    • aider_model: LLM model to use (optional override)
    • aider_flags: additional CLI flags

Key Design Decisions

  • --no-auto-commits: Critical — CodeFrame owns the git workflow, not Aider. Aider should modify files but not commit.
  • File list management: CodeFrame's context packager identifies relevant files; Aider receives them explicitly. This avoids Aider's own repo-scanning which might conflict with CodeFrame's context.
  • Model agnostic: Aider supports Claude, GPT-4, etc. Let users configure which model Aider uses independently.

Acceptance Criteria

  • AiderAdapter implements AgentAdapter protocol
  • Aider launched with --message, --yes-always, --no-auto-commits
  • Relevant files passed as arguments
  • Timeout enforced
  • Modified files detected after execution
  • Works with cf work start <id> --execute --engine aider
  • Integration test with mock Aider binary

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestphase-4Phase 4: Multi-Agent Coordination

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions