π OpenHands: AI-Driven Development
docs: sync README Docker tags with config/defaults.json (#1113)
Neha Prasada1158f1e77cd
diff --git a/.agents/skills/release.md b/.agents/skills/release.mdindex 47195fd527..76a750e038 100644--- a/.agents/skills/release.md+++ b/.agents/skills/release.md@@ -88,13 +88,31 @@ git commit -m "chore: bump version to <new-version>"git push```-**Also update version references in `README.md`** if the Docker image tag examples reference a specific version:+**Also update the documented Docker install version** on the release branch before tagging (the `create-release.yml` workflow fails if `versions.agentCanvas` does not match the tag):```bash-sed -i 's/ghcr.io\/openhands\/agent-canvas:[0-9]*\.[0-9]*\.[0-9]*[^ ]*/ghcr.io\/openhands\/agent-canvas:<new-version>/g' README.md-git add README.md && git commit -m "docs: update README version to <new-version>" && git push+VERSION=<new-version>+export VERSION+node <<'NODE'+const fs = require("fs");+const version = process.env.VERSION;+const configPath = "config/defaults.json";+const config = JSON.parse(fs.readFileSync(configPath, "utf8"));+config.versions.agentCanvas = version;+fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n");+const image = `${config.images.agentCanvas}:${version}`;+const imageRefPattern = /ghcr\.io\/openhands\/agent-canvas:[^\s`"]+/g;+for (const file of ["README.md", "README.windows.md"]) {+ fs.writeFileSync(file, fs.readFileSync(file, "utf8").replace(imageRefPattern, image));+}+NODE+git add config/defaults.json README.md README.windows.md+git commit -m "docs: update Docker install version to $VERSION"+git push```+External install docs on docs.openhands.dev are maintained separately; update them there when closing #1073. Pre-release Docker images are tagged by exact version only (`latest` is published for stable releases).+---## Step 3: Push the Tagdiff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.ymlindex 45656a1166..26d4c683cf 100644--- a/.github/workflows/create-release.yml+++ b/.github/workflows/create-release.yml@@ -33,6 +33,21 @@ jobs:echo "tag=$TAG" >> "$GITHUB_OUTPUT"echo "π¦ Version: $VERSION"+ - name: Checkout tag+ uses: actions/checkout@v6++ - name: Verify documented Docker install version matches release+ id: docker_docs+ run: |+ VERSION="${{ steps.version.outputs.version }}"+ PINNED=$(node -p "require('./config/defaults.json').versions.agentCanvas")+ if [ "$PINNED" != "$VERSION" ]; then+ echo "β versions.agentCanvas is '$PINNED' but release tag is v$VERSION"+ echo "Update config/defaults.json and README Docker examples before tagging."+ exit 1+ fi+ echo "β versions.agentCanvas matches release ($VERSION)"+- name: Check release does not already existid: checkenv:diff --git a/README.md b/README.mdindex d7495601b6..5431b6979f 100644--- a/README.md+++ b/README.md@@ -81,7 +81,7 @@ docker run -it --rm \-p 8000:8000 \-v "$HOME/.openhands:/home/openhands/.openhands" \-v "${PROJECTS_PATH}:/projects" \- ghcr.io/openhands/agent-canvas:1.0.0-beta.6+ ghcr.io/openhands/agent-canvas:1.0.0-rc.3```**Windows (PowerShell / Windows Terminal):** See [README.windows.md](./README.windows.md) for the equivalent commands.diff --git a/README.windows.md b/README.windows.mdindex 686af07c51..9bc8a42c40 100644--- a/README.windows.md+++ b/README.windows.md@@ -12,7 +12,7 @@ For the main install options and overall context, see [README.md](./README.md).- A host directory for `PROJECTS_PATH` containing the project folders you want the agent to access (create it before starting the container)```powershell-docker pull ghcr.io/openhands/agent-canvas:1.0.0-alpha.10+docker pull ghcr.io/openhands/agent-canvas:1.0.0-rc.3$env:PROJECTS_PATH = Join-Path $HOME "projects" # directory containing your project foldersNew-Item -ItemType Directory -Force -Path $env:PROJECTS_PATH, (Join-Path $env:USERPROFILE ".openhands") | Out-Null@@ -21,7 +21,7 @@ docker run -it --rm `-p 8000:8000 `-v "$($env:USERPROFILE)\.openhands:/home/openhands/.openhands" `-v "$($env:PROJECTS_PATH):/projects" `- ghcr.io/openhands/agent-canvas:1.0.0-alpha.10+ ghcr.io/openhands/agent-canvas:1.0.0-rc.3```The agent will be able to access any project under `PROJECTS_PATH`.diff --git a/__tests__/scripts/docs-version-sync.test.ts b/__tests__/scripts/docs-version-sync.test.tsindex 7a8d6959c6..3caaba832c 100644--- a/__tests__/scripts/docs-version-sync.test.ts+++ b/__tests__/scripts/docs-version-sync.test.ts@@ -22,37 +22,51 @@ function read(rel: string): string {}const config = JSON.parse(read("config/defaults.json")) as {- versions: { agentServer: string };+ images: { agentCanvas: string };+ versions: { agentServer: string; agentCanvas: string };};-const v = config.versions.agentServer;+const agentServerVersion = config.versions.agentServer;+const dockerImage = `${config.images.agentCanvas}:${config.versions.agentCanvas}`;describe("docs/example references stay in sync with config/defaults.json", () => {it("AGENTS.md documents the current default version", () => {const agentsMd = read("AGENTS.md");expect(agentsMd).toContain(- `\`OH_AGENT_SERVER_VERSION\` β specific PyPI version (e.g., "${v}")`,+ `\`OH_AGENT_SERVER_VERSION\` β specific PyPI version (e.g., "${agentServerVersion}")`,);expect(agentsMd).toContain(- `Default: released PyPI version \`${v}\` for agent-server SDK libraries`,+ `Default: released PyPI version \`${agentServerVersion}\` for agent-server SDK libraries`,);});+ it("every README Docker image reference uses the pinned tag", () => {+ const imageRefPattern = /ghcr\.io\/openhands\/agent-canvas:[^\s`"]+/g;++ for (const file of ["README.md", "README.windows.md"]) {+ const refs = read(file).match(imageRefPattern) ?? [];+ expect(refs.length).toBeGreaterThan(0);+ for (const ref of refs) {+ expect(ref).toBe(dockerImage);+ }+ }+ });+it("scripts/dev-safe.mjs JSDoc example matches the current default", () => {const devSafe = read("scripts/dev-safe.mjs");expect(devSafe).toContain(- `OH_AGENT_SERVER_VERSION: Specific PyPI version (e.g., "${v}")`,+ `OH_AGENT_SERVER_VERSION: Specific PyPI version (e.g., "${agentServerVersion}")`,);});it("scripts/check-sdk-version-sync.mjs examples match the current default", () => {const src = read("scripts/check-sdk-version-sync.mjs");- expect(src).toContain(`EXPECTED_SDK_VERSION=${v}`);- expect(src).toContain(`"version": "${v}"`);- expect(src).toContain(`"openhands-sdk>=${v},<2.0.0"`);- expect(src).toContain(`"openhands-tools==${v}"`);- expect(src).toContain(`"openhands-workspace (>=${v})"`);+ expect(src).toContain(`EXPECTED_SDK_VERSION=${agentServerVersion}`);+ expect(src).toContain(`"version": "${agentServerVersion}"`);+ expect(src).toContain(`"openhands-sdk>=${agentServerVersion},<2.0.0"`);+ expect(src).toContain(`"openhands-tools==${agentServerVersion}"`);+ expect(src).toContain(`"openhands-workspace (>=${agentServerVersion})"`);expect(src).toContain(- `">=${v}", "==${v}", "(>=${v})", "~=${v}"`,+ `">=${agentServerVersion}", "==${agentServerVersion}", "(>=${agentServerVersion})", "~=${agentServerVersion}"`,);});});diff --git a/config/defaults.json b/config/defaults.jsonindex e5c9d1ebf5..3c8a1ef86d 100644--- a/config/defaults.json+++ b/config/defaults.json@@ -3,6 +3,7 @@"versions": {"agentServer": "1.25.0",+ "agentCanvas": "1.0.0-rc.3","automation": "1.0.0a6","automationSdk": "1.22.1"},