From b47430c9631c9b688e22a6a822f617aa41fa4634 Mon Sep 17 00:00:00 2001 From: StanPonomarev Date: Tue, 21 Jul 2026 00:10:58 +0200 Subject: [PATCH] fix: remove build script --- .env.example | 1 + Dockerfile | 8 +++----- README.md | 13 ++++++------- compose.yaml | 2 +- scripts/build.sh | 8 -------- tests/test_opencode_deployment.py | 6 +++--- 6 files changed, 14 insertions(+), 24 deletions(-) delete mode 100755 scripts/build.sh diff --git a/.env.example b/.env.example index 0cb6c00..96490e1 100644 --- a/.env.example +++ b/.env.example @@ -4,6 +4,7 @@ AGENTCI_BOT_USERNAME=agentci AGENTCI_BOT_NAME=Agent CI AGENTCI_BOT_EMAIL=agentci@localhost OPENCODE_SERVER_USERNAME=opencode +AGENTCI_OPENCODE_VERSION=^1 AGENTCI_PLAN_MODEL=openai/gpt-5.6-sol AGENTCI_PLAN_VARIANT= AGENTCI_IMPLEMENT_MODEL=openai/gpt-5.6-sol diff --git a/Dockerfile b/Dockerfile index 16c35b4..b3a409d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,11 +3,9 @@ ARG TEA_VERSION=0.14.2 FROM node:24-bookworm-slim AS agent-tools ARG CODEGRAPH_VERSION=1.3.1 -ARG OPENCODE_REFRESH -RUN test -n "$OPENCODE_REFRESH" \ - || { echo "OPENCODE_REFRESH is required; run scripts/build.sh" >&2; exit 1; } \ - && npm install --global \ - 'opencode-ai@^1' \ +ARG AGENTCI_OPENCODE_VERSION=^1 +RUN npm install --global \ + "opencode-ai@${AGENTCI_OPENCODE_VERSION}" \ "@colbymchenry/codegraph@${CODEGRAPH_VERSION}" \ && version="$(opencode --version)" \ && case "$version" in 1.*) ;; *) echo "Expected OpenCode 1.x, got $version" >&2; exit 1;; esac diff --git a/README.md b/README.md index 014a768..a9a84c3 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ remaining review findings are posted separately. 4. Build the image: ```sh - ./scripts/build.sh + docker compose build ``` 5. Authenticate the configured OpenCode providers before starting the persistent server: @@ -61,11 +61,10 @@ Models use OpenCode's `provider/model` format. Planning, implementation, and res different providers. Optional `AGENTCI_PLAN_VARIANT` and `AGENTCI_IMPLEMENT_VARIANT` values are passed directly to OpenCode for providers that support variants. -`scripts/build.sh` supplies a unique required cache key on every invocation. The image then runs -`npm install -g 'opencode-ai@^1'`, verifies the installed major version, and prints it. Compose also -requests a no-cache build. A direct build without `OPENCODE_REFRESH` fails rather than silently -reusing an old OpenCode installation layer. This is intentionally fresh rather than reproducible. -Runtime auto-update is disabled so an image cannot cross into OpenCode 2.x after it is built. +`AGENTCI_OPENCODE_VERSION` controls the npm version or range installed into the image and defaults +to `^1`. The build verifies that the resolved version is still OpenCode 1.x and prints it. Compose +requests a no-cache build so the configured range is resolved again on each build. Runtime +auto-update is disabled so an image cannot cross into OpenCode 2.x after it is built. The trusted configuration is `opencode/opencode.json`. It grants `permission: "allow"` globally and to every built-in or custom agent that Agent CI can invoke. Repository-local OpenCode config @@ -139,7 +138,7 @@ uv run ruff check . uv run pyright uv run pytest docker compose config -./scripts/build.sh +docker compose build ``` The tests fail if any tracked Python file exceeds 250 lines. Prompts and JSON schemas live outside diff --git a/compose.yaml b/compose.yaml index d3c3af2..a49cc33 100644 --- a/compose.yaml +++ b/compose.yaml @@ -5,8 +5,8 @@ services: context: . no_cache: true args: + AGENTCI_OPENCODE_VERSION: ${AGENTCI_OPENCODE_VERSION:-^1} CODEGRAPH_VERSION: ${CODEGRAPH_VERSION:-1.3.1} - OPENCODE_REFRESH: ${OPENCODE_REFRESH:-} TEA_VERSION: ${TEA_VERSION:-0.14.2} restart: unless-stopped depends_on: diff --git a/scripts/build.sh b/scripts/build.sh deleted file mode 100755 index 006368d..0000000 --- a/scripts/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -set -eu - -script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) -cd "$script_dir/.." - -export OPENCODE_REFRESH="$(date +%s)-$$" -exec docker compose build "$@" diff --git a/tests/test_opencode_deployment.py b/tests/test_opencode_deployment.py index ca10e62..b63dbb8 100644 --- a/tests/test_opencode_deployment.py +++ b/tests/test_opencode_deployment.py @@ -26,6 +26,6 @@ def test_compose_removes_codex_sandbox_exceptions() -> None: assert "opencode_home:/var/lib/opencode" in compose assert "HOME: /etc/opencode/home" in compose assert "OPENCODE_DISABLE_EXTERNAL_SKILLS" in compose - assert "ARG OPENCODE_REFRESH" in dockerfile - assert "OPENCODE_REFRESH is required" in dockerfile - assert "'opencode-ai@^1'" in dockerfile + assert "AGENTCI_OPENCODE_VERSION: ${AGENTCI_OPENCODE_VERSION:-^1}" in compose + assert "ARG AGENTCI_OPENCODE_VERSION=^1" in dockerfile + assert '"opencode-ai@${AGENTCI_OPENCODE_VERSION}"' in dockerfile