Skip to content

feat(agents): add aider adapter#125

Closed
yyovil wants to merge 1 commit into
agents/05-crushfrom
agents/06-aider
Closed

feat(agents): add aider adapter#125
yyovil wants to merge 1 commit into
agents/05-crushfrom
agents/06-aider

Conversation

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 6, 2026

Greptile Summary

Adds the Aider agent adapter as a "Tier C" integration (no lifecycle hooks, no native session ID), following the same structural pattern as the existing amp and crush adapters. The adapter maps AO permission modes onto --yes-always/--no-auto-commits flags and registers itself in the shared registry and wiring test.

  • aider.go: Implements adapters.Adapter + ports.Agent; resolves the binary from PATH then common install locations with a sync.Mutex-guarded cache; maps four permission modes onto Aider's flag surface; all session/hook/restore methods are intentional no-ops with appropriate context-cancellation guards.
  • registry.go / wiring_test.go: Single-line registration and resolver-table assertion, consistent with every other shipped adapter.

Confidence Score: 5/5

Safe to merge; the adapter is narrowly scoped, all methods are well-tested, and the registration plumbing is one-line additions consistent with every other shipped adapter.

The change introduces a self-contained new adapter with no shared mutable state beyond a per-instance binary cache, and the wiring test confirms end-to-end resolver resolution. The only notable inconsistency — GetLaunchCommand not re-checking the context once the binary is cached — does not affect correctness or data integrity.

No files require special attention; aider.go is the most substantive change but is well-covered by the accompanying test file.

Important Files Changed

Filename Overview
backend/internal/adapters/agent/aider/aider.go New Aider adapter: binary resolution, permission mapping to --yes-always/--no-auto-commits, and all no-op Tier C methods; missing ctx.Err() guard in GetLaunchCommand after the binary is cached.
backend/internal/adapters/agent/aider/aider_test.go Comprehensive unit tests covering manifest, permission modes, system prompt handling, headless flags, no-op methods, and context cancellation; cancellation test always uses a fresh Plugin so the cached-binary path is untested.
backend/internal/adapters/agent/registry/registry.go Registers aider.New() in Constructors(); straightforward one-line addition consistent with all other adapters.
backend/internal/daemon/wiring_test.go Adds {domain.HarnessAider, "aider"} to the resolver table test; correctly validates end-to-end harness → adapter resolution.

Sequence Diagram

sequenceDiagram
    participant Manager as Session Manager
    participant Plugin as aider.Plugin
    participant Cache as resolvedBinary cache
    participant Resolver as ResolveAiderBinary
    participant FS as PATH / filesystem

    Manager->>Plugin: GetLaunchCommand(ctx, cfg)
    Plugin->>Cache: resolvedBinary set?
    alt binary cached
        Cache-->>Plugin: return resolvedBinary (ctx NOT checked)
    else not cached
        Plugin->>Resolver: ResolveAiderBinary(ctx)
        Resolver->>Resolver: ctx.Err() check
        Resolver->>FS: exec.LookPath("aider")
        FS-->>Resolver: path or ""
        Resolver-->>Plugin: binary path
        Plugin->>Cache: store resolvedBinary
    end
    Plugin->>Plugin: build argv [-m prompt, approval flags, headless flags, --read]
    Plugin-->>Manager: []string cmd

    Manager->>Plugin: GetAgentHooks(ctx, cfg)
    Plugin-->>Manager: ctx.Err() (no-op)

    Manager->>Plugin: GetRestoreCommand(ctx, cfg)
    Plugin-->>Manager: nil, false, nil (no native resume)
Loading

Reviews (2): Last reviewed commit: "feat(agents): add aider adapter" | Re-trigger Greptile

Comment thread backend/internal/adapters/agent/aider/aider.go
Registers the aider harness, stacked on the agent platform.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants