Skip to main content
The Pi coding tool lets OpenSRE submit a coding task to the Pi agent. Pi edits files in a workspace to implement the change and returns a summary plus the git diff. It does not commit, push, or open a pull request — it only edits the working tree so you can review the diff. This is different from using Pi as your LLM provider (LLM_PROVIDER=pi, see LLM providers). There Pi is the reasoning engine; here Pi is the thing that actually changes code.
This is a mutating tool — it changes files on disk. It is disabled by default: it only becomes available to the agent when PI_CODING_ENABLED=1. Enable it only when you want OpenSRE to make code changes. It never commits, pushes, or opens a PR, so you always review the diff.

Quick reference

Enable it

  1. Install and authenticate the Pi CLI (same binary/credentials as the Pi provider):
  2. Turn the tool on:
  3. Confirm Pi is ready:

How it works

When the tool runs, it:
  1. runs pi in headless mode inside the workspace with your task plus a fixed set of rules (follow AGENTS.md, do not commit or push, do not run destructive git commands, preserve unrelated changes, summarize what changed),
  2. lets Pi edit the files,
  3. returns success, a summary, the list of changed_files, and the diff (truncated if large).
You review the diff and decide whether to keep, commit, or revert the changes.

Example

Once enabled, the tool is available to the agent (investigation surface). Describe a scoped coding task, for example:
If the agent calls the tool, Pi edits PI_CODING_WORKSPACE, and you get back a summary and the diff to review. Nothing is committed. (The agent decides whether to call the tool; for a deterministic run, invoke pi_coding_task directly — see the tests.)

Notes

  • Nothing is committed or pushed. Opening a PR is out of scope for now.
  • It is disabled by default. Only when PI_CODING_ENABLED=1 does the agent see it and get to choose to call it — enable it deliberately, since it edits files.
  • If PI_CODING_ENABLED is unset, or the Pi CLI is missing or unauthenticated, the tool stays unavailable and returns a clear message instead of running.