Run PR-Agent as a pinned webhook server on the Gitea Docker network and review on PR open plus slash commands. The per-PR opencode installer and verdict-posting step are removed.
The server-side .env stays outside the repository; deploy/pr-agent/ holds the compose definition and operator notes.
PR-Agent runs as pragent/pr-agent:0.49.0-gitea_app in a long-lived
container on server0, attached to the existing gitea_gitea Docker
network. It 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 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.
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-agent is a collaborator with write permission on
CV_Website/CV_Site_Nuxt. The token scopes are read:repository,
write:issue and read: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:3000 is 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 at
http://gitea:3000; GITEA__WEB_URL=https://git.noelsabia.dev keeps
published links on the public host.
The webhook sends push, issues, pull_request and issue_comment
events. Only the last two change behaviour today; push is kept because
PR-Agent may handle push commands in a later configuration.
Secrets live only in /home/noel/self-hosted/pr-agent/.env (mode 600) on
server0. The repository contains the compose file and an example env
file, never the token or webhook secret.
Not verified
The OpenCode Go API key was not present when this was committed, so no
model call and no real review have run. The first PR after the key is set
is the verification.
Whether glm-5.3-flash handles PR-Agent's structured review output well
enough. glm-5.3 is configured as 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.toml with project instructions is deliberately absent until
the first 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_app image tag is worth taking; bump the tag and run
docker compose up -d.
Review volume makes the container's memory limit tight, or Gitea adds a
role that can comment without push access.