Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ cd pr-af
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"

# Install the af CLI (control plane) once if you don't have it:
curl -fsSL https://agentfield.ai/install.sh | bash

cp .env.example .env # set OPENROUTER_API_KEY and GH_TOKEN at minimum
af # start the AgentField control plane in another terminal
af server # start the AgentField control plane in another terminal
python main.py # start PR-AF
```

Expand All @@ -29,6 +32,8 @@ make clean # remove caches and build artifacts

CI runs ruff against `src/` and `scripts/` and validates the Docker build on every push. The test suite runs locally via `make test` (not in CI yet — see the issue tracker if you want to help wire it up). PRs that fail CI will not be merged until green.

> **Known pre-existing test failure:** `tests/test_cost_tracker.py::TestCostTracker::test_async_log_success` currently fails on `main` (the cost tracker doesn't observe a stub response payload). Skip it locally with `make test` followed by `--deselect tests/test_cost_tracker.py::TestCostTracker::test_async_log_success` until it's fixed; CI is unaffected because pytest doesn't run there.

## What makes a good PR

- **One concern per PR.** A bug fix and a refactor should be two PRs.
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ PYTHON ?= python3

.PHONY: test check lint clean

# PYTHONPATH=src so `from pr_af import ...` works without pip install -e .
test:
$(PYTHON) -m pytest tests/ -x -q
PYTHONPATH=src $(PYTHON) -m pytest tests/ -x -q

lint:
$(PYTHON) -m ruff check src/ scripts/
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,11 @@ python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"

cp .env.example .env # OPENROUTER_API_KEY, GH_TOKEN at minimum
af # start AgentField control plane (terminal 1)
af server # start AgentField control plane (terminal 1)
python main.py # start PR-AF on port 8004 (terminal 2)
```

`af` ships with the `agentfield` package; if you don't have it on `PATH`, `python -m agentfield server` does the same thing. See [CONTRIBUTING.md](CONTRIBUTING.md) for the test/lint workflow.
The `af` CLI is the AgentField control plane and ships separately from the Python SDK — install it once with `curl -fsSL https://agentfield.ai/install.sh | bash` if you don't have it on `PATH`. See [CONTRIBUTING.md](CONTRIBUTING.md) for the test/lint workflow.

## Configuration

Expand Down Expand Up @@ -276,7 +276,7 @@ jobs:

**Review hits the cost or duration cap.** The defaults (300s, $2) are tuned for smoke tests, not real reviews. Set `PR_AF_NO_BUDGET=true` (or raise `PR_AF_MAX_DURATION_SECONDS` to 1800+ and `PR_AF_MAX_COST_USD` to a real ceiling). The early termination is intentional — PR-AF posts whatever findings it has and notes the partial coverage in the summary.

**`agent registered` never appears.** Check that the AgentField control plane is reachable (`curl http://localhost:8080/health` or `http://control-plane:8080/health` from inside the compose network) and that `AGENTFIELD_SERVER` matches. With `dev_mode=True` (the default), PR-AF retries registration on a 30s loop.
**`Agent pr-af registered with DID system` never appears.** Check that the AgentField control plane is reachable (`curl http://localhost:8080/health` from the host, or `curl http://agentfield:8080/health` from inside the compose network) and that `AGENTFIELD_SERVER` matches the address PR-AF can actually reach. The agent doesn't poll on its own — if the first registration attempt fails, restart the PR-AF service after the control plane is up.

**GitHub returns 403 / rate limit.** The default `GH_TOKEN` flow uses a fine-grained PAT. For higher rate limits and per-repo install scopes, switch to the GitHub App auth path with `GITHUB_APP_ID` + `GITHUB_APP_PRIVATE_KEY`.

Expand Down
Loading