feat: add GitHub Copilot CLI as LLM backend - #482
Open
gsoosk wants to merge 1 commit into
Open
Conversation
Adds a `copilot_cli` provider that drives the GitHub Copilot CLI (`copilot -p`) as a non-interactive LLM backend. Authentication comes from the CLI's own login session (or a `COPILOT_GITHUB_TOKEN`), so no API key is required, and any model exposed by a Copilot subscription can be used. The CLI has no `--system-prompt` flag, so the system message is prepended to the prompt. `reasoning_effort` maps to `--effort` and is validated against the values the CLI accepts; `max_ai_credits` maps to `--max-ai-credits`. Generation runs with `--silent --no-color --no-ask-user --no-custom-instructions --disable-builtin-mcps` to keep stdout clean and prompts reproducible. Tools are not pre-approved by default since evolution only needs text generation; `allow_all_tools` opts in. A non-zero exit is raised rather than warned about, because the CLI reports failures (such as an unavailable model) on stderr with an empty stdout, and a missing binary fails immediately instead of consuming the retry budget. `temperature`, `top_p` and `max_tokens` have no CLI equivalent and are ignored by this backend. Adds a quickstart example that reuses the function_minimization program and evaluator.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
copilot_cliprovider that drives the GitHub Copilot CLI (copilot -p) as a non-interactive LLM backend. Authentication comes from the CLI's own login session (or aCOPILOT_GITHUB_TOKEN), so no API key is required, and any model exposed by a Copilot subscription can be used.The CLI has no
--system-promptflag, so the system message is prepended to the prompt.reasoning_effortmaps to--effortand is validated against the values the CLI accepts;max_ai_creditsmaps to--max-ai-credits. Generation runs with--silent --no-color --no-ask-user --no-custom-instructions --disable-builtin-mcpsto keep stdout clean and prompts reproducible. Tools are not pre-approved by default since evolution only needs text generation;allow_all_toolsopts in.A non-zero exit is raised rather than warned about, because the CLI reports failures (such as an unavailable model) on stderr with an empty stdout, and a missing binary fails immediately instead of consuming the retry budget.
temperature,top_pandmax_tokenshave no CLI equivalent and are ignored by this backend.Adds a quickstart example that reuses the function_minimization program and evaluator.