Sign inSign up

kookster310/op-agent-engine

By kookster310

•Updated about 7 hours ago

Autonomous OpenProject work-package engine: polls tickets and dispatches CLI coding agents.

Image
0

719

kookster310/op-agent-engine repository overview

⁠OpenProject Agent Engine

Polls OpenProject work packages and dispatches the pi⁠ coding agent to work on them.

OpenProject is the system of record. The engine claims work, prepares a per-agent clone, renders a prompt, runs the agent, verifies the outcome against GitHub and OpenProject, and performs every status transition itself. Agents never change status: a human (or the engine) still owns the board.

⁠Image

docker pull kookster310/op-agent-engine
TagMeaning
latestnewest build from main
<version>, e.g. 0.2.5a release, pinned and reproducible
sha-<short>one commit, useful for bisecting

linux/amd64 only. The engine itself is architecture independent, but the op, node and gh builds baked into the image are not cross-built, so no arm64 image is published.

The image is a runtime, not a deployment by itself: it ships the engine, the prompts and the agent definitions, and expects a docker/docker-compose.yml next to a .env you provide. That compose file lives in the repository, not in the image.

⁠Quick start

Requires Docker, OpenProject 17 (API v3) and a GitHub repository the agents can push to and merge in.

  1. One-time OpenProject setup — statuses, the GIT_REPO and AGENT project/work-package fields, the Agent Worker role: docs/OPENPROJECT_SETUP.md⁠

  2. Get the deployment directory (it is the whole deployment — copy anywhere, for example /opt/op-agent-engine):

    git clone https://github.com/310networks/openproject-agent-engine
    cd openproject-agent-engine/docker
    
  3. Run the interactive setup. It asks for the OpenProject URL and token, the four agent tokens, the model and the provider key, and writes .env. Re-running is safe:

    ./agent-init.sh
    
  4. Add the GitHub token(s) to .env — the setup script does not ask for them:

    GH_TOKEN=github_pat_...
    # optional, see "Branch protection" below
    GH_TOKEN_REVIEWER=github_pat_...
    GIT_REVIEWER_NAME=...
    GIT_REVIEWER_EMAIL=...
    
  5. Start it and watch the log:

    docker compose up -d
    docker compose logs -f engine
    
  6. After adding a project, or changing its GIT_REPO / AGENT values in OpenProject: docker compose restart engine. After editing .env: docker compose up -d engine — restart keeps the old environment.

Pin a release in .env instead of tracking latest:

OP_AGENT_ENGINE_TAG=0.2.5

⁠Required environment variables

VariableMeaning
OP_BASE_URLyour OpenProject URL
OP_PROJECTproject identifier: one, a comma list, or * for every project that has GIT_REPO
OP_ENGINE_TOKENAPI token of the runtime user (administrator)
AGENT_MODELmodel for every agent as <provider>/<model>; the provider selects the credential variable
AGENT_MODEL_<AGENT>optional per-agent override: AGENT_MODEL_FRONTEND, ..._BACKEND, ..._DESIGNER, ..._REVIEWER
OP_TOKEN_FRONTEND / _BACKEND / _DESIGNER / _REVIEWERone token per agent account
OPENROUTER_API_KEY (or another provider key)model provider credential
LLAMA_BASE_URLlocal llama.cpp router URL, instead of a hosted provider
GH_TOKENGitHub token used to clone, push and look up pull requests

Everything else — concurrency, timings, status names, paths, git identity — has a working default. The full list, including limits and the llama.cpp provider, is in docs/CONFIG.md⁠.

Each monitored project needs a project attribute named GIT_REPO holding its GitHub repository (owner/name or a github.com URL).

⁠The agent team

Fixed in the image, one OpenProject account and one token each:

AGENT field valueLoginKind
FRONTENDfrontendEngineerimplementer
BACKENDbackendEngineerimplementer
LEAD_DESIGNERleadDesignerimplementer
REVIEWERcodeReviewerreviewer

⁠How a ticket flows

Observed stateEngine actionRunVerified outcomeTransition
New, eligible, AGENT setclaim, In Progressimplementopen PR / BLOCKEDReady for Review / On Hold
Ready for Review, PR existsclaim, In TestingreviewPR merged / REJECTEDClosed / Rejected
Ready for Review, no PR———On Hold + comment
Rejected, eligibleclaim, In Progressfixas implementas implement

On Hold is terminal until a human moves the ticket. Branches are op-<project>-<wp>, one per ticket. At most MAX_RUNS_PER_AGENT runs per agent (default 1). Every engine comment starts with ENGINE:.

⁠Branch protection

If your repository requires an approving review from an account other than the pull request's author, give codeReviewer its own GitHub account and set GH_TOKEN_REVIEWER. The reviewer then switches gh/git to that account and can submit an approving review before merging. With a single GH_TOKEN, every agent is the same account, cannot approve its own PR, and merges stall.

If reviewers are also required for specific paths, list both the human and the reviewer account in .github/CODEOWNERS — an owner that is also the PR author can never satisfy the requirement.

⁠What is in the container

Baked inConfigured at runtime
Python 3.12, git, gh, ripgrep, fd, opdeployment values, limits, API tokens, provider keys (environment only)
Node 22 and pimodel, git identity
agents/*/AGENTS.md (seeds the workspace volume)—
prompts/—

Runs as uid 10001 (agent). Nothing is mounted from the host: settings and credentials are environment variables, and all state lives in volumes. Provider credentials are never written to credential files by the image.

VolumeMount pointHolds
agent-workspace/home/agent/agentsseeded agents/ tree plus one clone per agent workspace
engine-data/home/agent/.local/share/op-agent-engineSQLite store, runs/<id>/, heartbeat, pause flag, lock
pi-agent/home/agent/.pi/agentpi sessions, logs, model cache, installed tools

⁠Dashboard

The compose stack also starts a read-only dashboard on http://127.0.0.1:8765 (loopback only). It has no authentication — keep it on loopback or put it behind your own reverse proxy. Details: docs/DASHBOARD.md⁠.

⁠Documentation

DocContents
docs/DOCKER.md⁠image internals, volumes, releases, troubleshooting
docs/OPENPROJECT_SETUP.md⁠statuses, GIT_REPO, AGENT, Agent Worker role, admin engine user
docs/CONFIG.md⁠every environment variable, provider keys, agent team, CLI
docs/RUNBOOK.md⁠status, pause, run inspection, On Hold handling, recovery
docs/ACCEPTANCE.md⁠fake-agent test and manual acceptance checklist

⁠License

MIT. See LICENSE⁠.

Tag summary

Content type

Image

Digest

sha256:21215254e…

Size

255.5 MB

Last updated

about 7 hours ago

docker pull kookster310/op-agent-engine