Skip to content

feat: add GitHub Copilot support to Ralph agent#80

Open
Jeff-Tian wants to merge 4 commits intosnarktank:mainfrom
Jeff-Tian:feature/copilot
Open

feat: add GitHub Copilot support to Ralph agent#80
Jeff-Tian wants to merge 4 commits intosnarktank:mainfrom
Jeff-Tian:feature/copilot

Conversation

@Jeff-Tian
Copy link

@Jeff-Tian Jeff-Tian commented Feb 2, 2026

Thanks for the great repo! 👍 I’ve made some changes and successfully used it. Hope the change can also benefit others.

ScreenShot_2026-01-26_121200_592

This pull request adds support for GitHub Copilot as a third AI coding tool in the Ralph agent workflow, alongside Amp and Claude Code. The changes update documentation, scripts, and instructions to reflect Copilot integration, and introduce a new prompt template specifically for Copilot. The most important changes are grouped below:

Copilot Integration:

  • Added support for the copilot tool in the ralph.sh script, allowing users to run Ralph iterations using GitHub Copilot by specifying --tool copilot. The script now validates the new option and handles Copilot-specific prompt formatting. [1] [2] [3]
  • Introduced a new COPILOT.md file containing detailed instructions and prompt template for Copilot-driven iterations, mirroring the structure of existing Amp and Claude Code prompts.

Documentation Updates:

  • Updated README.md and AGENTS.md to reference GitHub Copilot throughout, including installation instructions, usage examples, and file explanations. This ensures users know how to set up and run Ralph with Copilot. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

These changes make Ralph more flexible by supporting a wider range of AI coding tools and providing clear instructions for using Copilot in autonomous agent workflows.

@greptile-apps
Copy link

greptile-apps bot commented Feb 2, 2026

Greptile Overview

Greptile Summary

This PR adds GitHub Copilot as a third supported “AI coding tool” alongside Amp and Claude Code.

Changes include documentation updates (README.md, AGENTS.md) to describe installing/using Copilot and a new COPILOT.md prompt template, plus ralph.sh changes to accept --tool copilot and attempt to run Copilot each iteration similarly to the existing Amp/Claude loops.

Main concern: the Copilot execution path in ralph.sh does not currently use the new COPILOT.md template (it derives the prompt from prompt.md instead) and appears to call a Copilot CLI interface (copilot -i … --yolo --no-ask-user) that may not exist for the documented gh extension install github/gh-copilot setup, so users may be unable to run Ralph with Copilot as documented.

Confidence Score: 2/5

  • Not safe to merge as-is because the new Copilot path is likely non-functional in common setups.
  • While docs and templates are straightforward, ralph.sh’s Copilot branch appears miswired (uses prompt.md instead of COPILOT.md) and likely invokes the wrong Copilot CLI entrypoint/flags, which would prevent the advertised feature from working for many users.
  • ralph.sh

Important Files Changed

Filename Overview
ralph.sh Adds --tool copilot option and a Copilot execution branch; however Copilot path builds prompt from prompt.md (ignoring new COPILOT.md) and likely calls a non-existent copilot CLI/flags.
README.md Docs now list GitHub Copilot support and copying COPILOT.md; generally fine, but currently mismatched with ralph.sh which doesn’t read COPILOT.md for Copilot runs.
AGENTS.md Updates overview/commands/key files to include GitHub Copilot; no functional issues, but references COPILOT.md which ralph.sh currently ignores.
COPILOT.md Introduces Copilot-specific agent instructions template; looks consistent with existing templates, but is not wired up by ralph.sh in the Copilot execution path.

Sequence Diagram

sequenceDiagram
    participant User
    participant Ralph as ralph.sh
    participant Prompt as prompt.md/COPILOT.md
    participant Amp
    participant Claude
    participant CopilotCLI as Copilot CLI

    User->>Ralph: ./ralph.sh --tool {amp|claude|copilot} [max_iterations]
    Ralph->>Ralph: Parse args, validate tool
    loop Iterations 1..MAX
        alt TOOL=amp
            Ralph->>Prompt: Read prompt.md
            Ralph->>Amp: amp --dangerously-allow-all
            Amp-->>Ralph: stdout/stderr
        else TOOL=claude
            Ralph->>Prompt: Read CLAUDE.md
            Ralph->>Claude: claude --dangerously-skip-permissions --print
            Claude-->>Ralph: stdout/stderr
        else TOOL=copilot
            Ralph->>Prompt: Read prompt.md (current implementation)
            Ralph->>CopilotCLI: copilot -i "PROMPT_CONTENT" --yolo --no-ask-user
            CopilotCLI-->>Ralph: stdout/stderr
        end
        Ralph->>Ralph: If output contains <promise>COMPLETE</promise> then exit 0
    end
    Ralph-->>User: Exit 1 if max iterations reached
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

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