Skip to content

feat(adapters): add Aider CLI adapter (--harness aider) - #3

Open
Abhiix0 wants to merge 1 commit into
DataArcTech:mainfrom
Abhiix0:main
Open

Abhiix0 wants to merge 1 commit into
DataArcTech:mainfrom
Abhiix0:main

Conversation

@Abhiix0

@Abhiix0 Abhiix0 commented Sep 14, 2026

Copy link
Copy Markdown

Summary

Adds AiderAdapter, a new optional compatibility backend for the Aider CLI, following the same AgentAdapter contract as the existing Claude Code / GenericAgent / mini-swe-agent adapters. Aider has a large, active user base and no existing adapter, so this extends Bayesian Skill evolution to another widely-used coding harness without vendoring any of its code.

What's added

  • bayesian_agent/adapters/aider.pyAiderAdapter dataclass:
    • Drives Aider non-interactively via --message-file (avoids ARG_MAX issues with large skill-context prompts and leaves an inspectable prompt file per workspace, instead of --message/argv).
    • Process-group-isolated subprocess execution with SIGTERM→SIGKILL timeout handling, matching ClaudeCodeAdapter's cleanup behavior (including killing orphaned child processes on timeout).
    • parse_result extracts token usage and cost from Aider's stdout (Tokens: X sent, Y received. Cost: $Z session.), including k/m suffix handling, since Aider's CLI output isn't JSON like Claude Code's.
    • load_run_from_workspace for resuming/repairing from prior runs.
    • Never imports the aider package — pure CLI subprocess boundary.
  • Registered in bayesian_agent/adapters/__init__.py.
  • Wired into experiments/run_benchmarks.py: new --harness aider choice, --aider-cli / --aider-timeout / --aider-auto-commits / --aider-yes-always flags, backend construction branch, and agent_name_for_harness entry.
  • docs/adapters.md: new "Aider Adapter" section matching the existing adapter doc structure.
  • README.md: Aider added alongside GenericAgent / mini-swe-agent / Claude Code in the feature list, compatibility-backends list, and file listing.
  • tests/test_adapters.py: 7 new tests mirroring the existing adapter test conventions — command construction, token/cost parsing, task boundary, timeout handling, child-process cleanup on timeout, workspace-log recovery, and the "does not import eagerly" guarantee. All use a fake CLI script as cli_path, no real aider install required.

Testing

python3 -m pytest tests/ -q
89 passed

All 89 existing + new tests pass, including the 7 new Aider-specific tests and the full existing suite (no regressions in other adapters).

Notes

  • CLI flags (--message-file, --yes-always, --auto-commits/--no-auto-commits, --no-stream, --no-pretty, --check-update/--no-check-update, --analytics/--no-analytics) were verified against Aider's current CLI options reference rather than assumed.
  • No Aider source is copied or vendored — communication is purely via CLI subprocess, same boundary as the Claude Code and mini-swe-agent adapters.

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.

1 participant