Repository navigation
feat(pi): add support for the Pi agent - #59
Merged
Merged
Conversation
Add a pi provider module that sends a deterministic one-shot prompt in print mode with sessions, tools, extensions, skills, and project context disabled, so commit messages derive only from the rendered diff. Pi has no single built-in model: it resolves one from the configured provider and credentials, so pi has no default model override and `ai.model` is left unset by default. Wire pi into agent and model resolution, dependency checks, the devShell hint, and the configuration docs, and cover the provider with tests.
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.
Summary
Adds Pi (
pi) as a supported AI agent alongside Claude, Codex, and Gemini.scripts/git_cmd_pi.sh_get_pi_default_modelreturns empty: Pi has no single built-in model, so--modelstays unset and Pi resolves its configured provider/credentials.ai.modelstill overrides when set._ask_piruns a deterministic one-shot:--print --no-session --no-context-files --no-mcp --no-tools --no-extensions --no-skills --no-prompt-templates --no-approve, reading the rendered prompt from stdin. Errors go to stderr with the samegit-ai: pi failed to generate a responseshape as the codex/gemini providers.ai.agent=pidispatch in_get_agent_default_model/_cmd_ask, dependency check (pi — https://pi.dev), devShell hint, README requirements/config/agent-defaults.pi, empty default model, flag/stdin assertions, model override, failure and empty-response cases, plus dependency-check coverage.Implementation mirrors the
piprovider already merged in gh-extensions/gh-ai#129. One deliberate divergence: gh-ai grants--tools readbecause its prompts reference repository files, while git-ai embeds the staged diff in the prompt and therefore disables tools entirely.Usage
git config --global ai.agent pi git config --global --unset ai.model # optional: let Pi pick its model git ai commitTesting
nix develop --command bats tests/— 43/43 passingshellcheck -x -e SC1091 git-ai scripts/git_cmd.sh scripts/git_cmd_pi.sh— cleanpiin a scratch repo withai.agent=pireturned the model response throughscripts/git_cmd.sh askAlso fixes
tests/git_ai.batsPATH handling so the dependency tests run on NixOS, where/usr/binhas no coreutils.