mirror of
https://github.com/mikeyobrien/ralph-orchestrator.git
synced 2026-04-26 07:35:51 +03:00
[GH-ISSUE #50] [Implementation] Implement Amp Adapter #18
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ralph-orchestrator#18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mikeyobrien on GitHub (Jan 12, 2026).
Original GitHub issue: https://github.com/mikeyobrien/ralph-orchestrator/issues/50
Ref: #48
Task: Implement Amp Adapter
Description
Implement a new adapter class
AmpAdapterinsrc/ralph_orchestrator/adapters/amp.pyto enable the Ralph Orchestrator to use the Amp AI CLI tool (amp) as an execution backend. This allows users to leverage Amp's models and capabilities within the Ralph workflow.Background
Ralph Orchestrator supports multiple AI backends via a plugin/adapter architecture. Issue #48 requests support for Amp. The Amp CLI (
amp) is available for terminal-based AI interaction. We need to wrap this CLI in a python class adhering to theToolAdapterinterface.Reference Documentation
Required:
src/ralph_orchestrator/adapters/base.py(ToolAdapter interface)src/ralph_orchestrator/adapters/kiro.py(Example of CLI wrapper)Additional References:
Note: You MUST read the detailed design document (base adapter) before beginning implementation.
Technical Requirements
src/ralph_orchestrator/adapters/amp.py.AmpAdapterclass inheriting fromToolAdapter.__init__to configure the command (defaultamp).aexecute(self, prompt: str, prompt_file: str = None, verbose: bool = False)method.amp. Note: Check ifampsupports non-interactive input/output or requires specific flags (e.g. reading from stdin or file).asyncio.create_subprocess_exec).stdoutandstderr.tests/test_amp_adapter.py.Dependencies
src/ralph_orchestrator/adapters/base.pyasyncioImplementation Approach
src/ralph_orchestrator/adapters/base.pyto understand the contract.src/ralph_orchestrator/adapters/amp.py.ampto accept the prompt.ampaccepts a prompt as an argument or via stdin. The adapter should handle this.tests/test_amp_adapter.pymocking the subprocess to verify command construction and parsing.Acceptance Criteria
Adapter Initialization
Command Execution
aexecuteis calledampCLI with the promptError Handling
ampis not installedaexecuteis calledFileNotFoundErrorgracefully and returns a failure responseUnit Tests
pytest tests/test_amp_adapter.pyMetadata