Move the service and its env file into the Gitea stack, remove the separate deploy directory and the unused /opt operator-access scripts, and keep the operational guide in OKF_Nuxt/pr-agent.md.
5.4 KiB
type, title, description, tags, status, generated, verified, sources
| type | title | description | tags | status | generated | verified | sources | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Decision | PR-Agent for Gitea reviews | A pinned PR-Agent service inside the Gitea compose stack reviews pull requests through a scoped Gitea bot user, replacing the per-PR opencode job. |
|
draft |
|
|
|
Decision
PR-Agent runs as pragent/pr-agent:0.49.0-gitea_app in a long-lived
container on server0, as the pr-agent service in the Gitea compose
stack. It attaches to the existing gitea_gitea Docker network and
publishes no ports. Gitea delivers pull-request and comment events to
http://pr-agent:3000/api/v1/gitea_webhooks; the bot user pr-agent
posts the result with a scoped personal access token. The service
definition lives in /home/noel/self-hosted/gitea/docker-compose.yml; the
operator guide is PR-Agent operations.
The opencode review job is removed from pr-checker.yml. PR-Agent runs
/describe and /review on pull request open/reopen and answers slash
commands in the conversation. Push-triggered re-review is disabled, so a
PR is reviewed once when it opens, not on every push.
The model is OpenCode Go's OpenAI-compatible endpoint:
model openai/glm-5.3-flash
fallback openai/glm-5.3
api base https://opencode.ai/inference/go/openai/v1
CONFIG__CUSTOM_MODEL_MAX_TOKENS=128000 supplies the context limit the
model table does not know; PR-Agent's default config.max_model_tokens
still caps the review budget at 32000.
OpenCode Go requires an x-opencode-session header. PR-Agent sends the
stable id pr-agent through LITELLM__EXTRA_HEADERS; without it the
provider rejects the request before it reaches the model.
Why
- One container replaces a per-PR CLI install, binary cache and prompt wrapper. The review path is then the same code for every PR.
- PR-Agent owns the Gitea webhook and comment plumbing, including the slash
commands (
/review,/improve,/ask) the repository previously had no way to trigger. - The webhook endpoint stays on the Docker network. Nothing new is exposed to the internet, and comment links still use the public Gitea URL.
- The image tag is pinned. A new PR-Agent release is a deliberate change, not a rollout underneath the repository.
Gitea configuration
- Bot user
pr-agentis a collaborator with write permission onCV_Website/CV_Site_Nuxt. The token scopes areread:repository,write:issueandread:user. Gitea has no comment-only collaborator role, so write is the narrowest role that can post comments and labels. [webhook] ALLOWED_HOST_LIST = private:3000is required: Gitea's default lax egress policy allows public targets but refuses private ones, and the webhook target is a Docker-network address. The API is reached athttp://gitea:3000;GITEA__WEB_URL=https://git.noelsabia.devkeeps published links on the public host.- The webhook sends
push,issues,pull_requestandissue_commentevents. Only the last two change behaviour today;pushis kept because PR-Agent may handle push commands in a later configuration. - Auto commands are
/describeand/review./improvestays available on demand; the default auto list would add a second model call and a second comment to every PR. - Secrets live only in
/home/noel/self-hosted/gitea/pr-agent.env(mode 600) onserver0. The repository contains the decision and the operator guide, never the token, webhook secret or model key.
Evidence
- 2026-10-30: a direct
glm-5.3-flashcall through the handler returnedOK, and/reviewon PR #28 posted a PR Reviewer Guide through the Gitea comment API. The key is set only ingitea/pr-agent.env.
Not verified
- Whether the model finds the same class of issues as the opencode prompt on
larger diffs. The first review found none;
glm-5.3remains the fallback. - Whether two gunicorn workers and the 1 GB memory limit hold under concurrent reviews. The host has roughly 2.5 GB available with Gitea and its runner idle.
- Whether the default review prompt is specific enough for this repository.
A
.pr_agent.tomlwith project instructions is deliberately absent until a real review shows what it misses.
Revisit when
- The first review fails, returns unstructured output, or misses the kind of finding the opencode prompt used to catch.
- A newer
gitea_appimage tag is worth taking; bump the tag in the Gitea compose file and rundocker compose up -d pr-agentfrom that directory. - Review volume makes the container's memory limit tight, or Gitea adds a role that can comment without push access.