diff --git a/integrations/opencode-athena/Dockerfile.v2 b/integrations/opencode-athena/Dockerfile.v2 new file mode 100644 index 0000000..ba1ab16 --- /dev/null +++ b/integrations/opencode-athena/Dockerfile.v2 @@ -0,0 +1,8 @@ +FROM ghcr.io/anomalyco/opencode:2.0.29@sha256:02a049e0d69c5700cdeb3be02a2882a67de87117f1ed5305f6c5cc204a2f4dc6 + +# Preserve the explicit tools installed in the former Alpine 1.18.34 container. +RUN apk add --no-cache chromium git nodejs openssh-client python3 py3-pip ripgrep + +WORKDIR /workspace +ENTRYPOINT ["opencode"] +CMD ["serve", "--hostname", "0.0.0.0", "--port", "4096"] diff --git a/integrations/opencode-athena/UPGRADE-V2-2026-10-14.md b/integrations/opencode-athena/UPGRADE-V2-2026-10-14.md new file mode 100644 index 0000000..fb017c0 --- /dev/null +++ b/integrations/opencode-athena/UPGRADE-V2-2026-10-14.md @@ -0,0 +1,126 @@ +# Unraid OpenCode 2.0.29 migration + +Upgraded the existing `OpenCode` container from 1.18.34 to 2.0.29 at the user's +explicit request. The official Docker image was pinned by digest and extended +with the existing explicit Alpine packages. See `Dockerfile.v2`. + +## Active deployment + +- Local image: `athena-opencode:2.0.29-20261014`. +- Built image ID: `7aba0864ba28a8c1910c0b360e7e6ca1e1f791dc0c6adbbdaf53d28083b4b701`. +- Official base digest: `sha256:02a049e0d69c5700cdeb3be02a2882a67de87117f1ed5305f6c5cc204a2f4dc6`. +- Command: `opencode serve --hostname 0.0.0.0 --port 4096`. +- Preserved the existing network, port 4096 binding, environment, restart policy + and Unraid management labels. The V2 working directory is `/workspace`. +- Preserved both bind mounts, including host paths and write access: + `/mnt/nvme-storage/appdata/OpenCode` -> `/root`, and the existing Unraid + development Workspace directory -> `/workspace`. +- Updated `my-OpenCode.xml` in Unraid's user templates to the new local image and + serve command. Protected a copy of the original template with the migration backup. +- Persisted the image recipe at + `/mnt/nvme-storage/appdata/OpenCode-build/Dockerfile` for local rebuilding. + +Git, SSH, Node 24.18.1, Python 3.14.8, pip, ripgrep and Chromium are baked into +the new image, rather than relying on a former container's writable layer. +The explicit package set matches the former container's /etc/apk/world extras. + +## Configuration and private data + +Retained the supported V1 global config rather than rewriting credentials and +provider settings. V2 normalizes this configuration in memory. The only model +config adjustment removed 27 legacy variant entries with `disabled: true` across +nine models. V2 otherwise interpreted those as settings and showed three extra +ineffective low/medium/high options. The five existing named Thinking variants +remain on the Qwen/Strata profiles, with their reasoningEffort values preserved. + +All twelve Athena models are present with their original context limits: +Medium/Holo4 160000, Fast 76800, Unzensiert/Lukes 131072, Large 192000, +Ultra 262144, Gemma 32768, GLM 200000, Strata 262144, Strata 512K 524288, +Strata Dual 262144 per request. Tool/image metadata is retained. This is metadata +validation and a representative live generation test, not generation tests of +all twelve models or new full-context/vision benchmarks. + +Global AGENTS.md, DuckDuckGo, Gitea launcher/binary/venv, Git credentials, +SSH files and other existing home contents remain in the persistent home. +No authentication value, private message or raw production log was emitted or +committed for migration. V2 accepted the existing server authentication internally. +The browser now offers password sign-in or pairing; browser login is still +required for visual acceptance. No authentication bypass or replacement token +was generated for that UI check. + +## Backup and rollback + +Protected root-only migration directory: +`/mnt/nvme-storage/appdata/OpenCode-upgrade-20261014` (0700 parent, protected +metadata/environment files). This is a private migration snapshot, NOT a public +Git artifact or a substitute for the encrypted full-system backup. +It contains the quiescent original home copy, original container inspection, +environment file, baseline session IDs, and original Unraid template. + +Both known projects were checked idle immediately before stopping V1. Copied +the whole persisted home only after the server stopped, including the SQLite +database/WAL state and credentials. First validated V2 against a separate private +home copy with the production workspace mounted read-only. Then started V2 on +the original persistent home and workspace mounts. Only OpenCode was replaced; +Athena Deck, Strata, OpenWebUI and the hosts were not restarted. + +The temporary validation container/home and stopped V1 container were removed +after successful production backend checks. The original private home snapshot, +inspection, template and original image remain. Rollback requires stopping V2, +preserving its current home separately, restoring the original home snapshot, +and recreating the old container from its saved specification/template. Rebuild +a V1 runtime from the original 1.18.34 image with the same tool packages from +Dockerfile.v2 if needed; do not assume the original image contains the former +container's writable-layer tool installs. Do not run V1 against the migrated +home. Full rollback onto a fresh host has not been tested. + +## Verified behavior + +- V2 reports version 2.0.29 and V1 migration status completed. +- All 12 original session IDs are present in the new session table/API. +- Compared all original legacy table rows byte-for-byte through internal digests: + 12 sessions, 1305 messages and 5138 parts are unchanged, both in staging and + production. No message bodies were emitted by these checks. +- All twelve Athena models, contexts and expected Thinking variants are listed. +- Both MCPs report connected in the production V2 API. +- A synthetic generation through V2 and the existing Athena endpoint returned + the requested marker successfully. +- A synthetic OpenCode agent session successfully used the shell and MCP code + mode to determine the HORIZON branch, find michael/HORIZON via Gitea and search + Apple AVAudioEngine documentation via DuckDuckGo. Completed tool states and + returned result markers were checked, not just the assistant's success claim. +- A second synthetic turn created exactly one named Python file in HORIZON and + ran its two arithmetic assertions successfully. Independently executed it and + verified FILE_TEST_OK. V2's VCS status and diff APIs included that exact file + and code. Removed only the synthetic file and synthetic test session afterward; + HORIZON is clean again and original session count remains 12. +- HTTPS frontend is reachable and renders the V2 server sign-in screen. + Visual checks of chat history, model picker and review panel remain pending + the user's browser login. Cross-browser UI preference synchronization has NOT + been verified or promised by this upgrade. + +## Rebuild / native deployment notes + +Rebuild on Unraid with `docker build -f Dockerfile.v2 -t +athena-opencode:2.0.29-20261014 .`, then use the saved Unraid template and persistent +private home/workspace mounts. The local image is not a published registry tag; +future upgrades require updating the pinned recipe, rebuilding and acceptance. +Do not replace it with the bare upstream image and lose the installed MCP/tool +dependencies. Upstream CLI/database upgrades must be performed only while idle. + +For a future native Debian OpenCode deployment, install the official V2 CLI +(documented npm package `@opencode/cli@2.0.29` or matching vendor binary), Git, +Python/venv/pip, Node, openssh-client and ripgrep explicitly; install Chromium if +browser workflows are required. Run `opencode serve` as the intended service +user under systemd with explicit HOME, working directory, interface and port. +Restore private config/data/auth and workspace with matching ownership; adjust +the two MCP launch paths and /workspace instructions to that user's paths. +Keep server credentials in a protected environment file, never a unit or Git. +This external client migration does not implement Athena Deck's future native +installer. Native end-to-end installation/restore remains untested. + +References: +- https://opencode.ai/v2/docs/migrate-v1/ +- https://opencode.ai/v2/docs/cli/web/ +- https://opencode.ai/v2/docs/api +- https://opencode.ai/v2/docs/ diff --git a/integrations/opencode-athena/v2-migration-results.json b/integrations/opencode-athena/v2-migration-results.json new file mode 100644 index 0000000..03629e5 --- /dev/null +++ b/integrations/opencode-athena/v2-migration-results.json @@ -0,0 +1,185 @@ +{ + "version": "2.0.29", + "models": [ + { + "id": "qwen3-8-27b-medium", + "context": 160000, + "variants": [ + "Thinking aus", + "Thinking niedrig", + "Thinking mittel", + "Thinking hoch", + "Thinking extra hoch" + ], + "tools": true, + "image": true + }, + { + "id": "gemma4-31b-32k", + "context": 32768, + "variants": [ + "low", + "medium", + "high" + ], + "tools": true, + "image": false + }, + { + "id": "qwen3-8-27b-fast", + "context": 76800, + "variants": [ + "Thinking aus", + "Thinking niedrig", + "Thinking mittel", + "Thinking hoch", + "Thinking extra hoch" + ], + "tools": true, + "image": true + }, + { + "id": "qwen3-8-27b-unzensiert", + "context": 131072, + "variants": [ + "Thinking aus", + "Thinking niedrig", + "Thinking mittel", + "Thinking hoch", + "Thinking extra hoch" + ], + "tools": true, + "image": true + }, + { + "id": "qwen3-8-27b-large", + "context": 192000, + "variants": [ + "Thinking aus", + "Thinking niedrig", + "Thinking mittel", + "Thinking hoch", + "Thinking extra hoch" + ], + "tools": true, + "image": true + }, + { + "id": "qwen3-8-27b-ultra", + "context": 262144, + "variants": [ + "Thinking aus", + "Thinking niedrig", + "Thinking mittel", + "Thinking hoch", + "Thinking extra hoch" + ], + "tools": true, + "image": true + }, + { + "id": "qwen3-8-27b-lukes-devlab", + "context": 131072, + "variants": [ + "Thinking aus", + "Thinking niedrig", + "Thinking mittel", + "Thinking hoch", + "Thinking extra hoch" + ], + "tools": true, + "image": true + }, + { + "id": "holo4-35b-a3b-medium", + "context": 160000, + "variants": [ + "low", + "medium", + "high" + ], + "tools": true, + "image": true + }, + { + "id": "glm-4-7-flash-q5", + "context": 200000, + "variants": [ + "low", + "medium", + "high" + ], + "tools": true, + "image": false + }, + { + "id": "flash-next-strata-iq3", + "context": 262144, + "variants": [ + "Thinking aus", + "Thinking niedrig", + "Thinking mittel", + "Thinking hoch", + "Thinking extra hoch" + ], + "tools": true, + "image": true + }, + { + "id": "flash-next-strata-iq3-512k", + "context": 524288, + "variants": [ + "Thinking aus", + "Thinking niedrig", + "Thinking mittel", + "Thinking hoch", + "Thinking extra hoch" + ], + "tools": true, + "image": true + }, + { + "id": "flash-next-strata-iq3-dual", + "context": 262144, + "variants": [ + "Thinking aus", + "Thinking niedrig", + "Thinking mittel", + "Thinking hoch", + "Thinking extra hoch" + ], + "tools": true, + "image": true + } + ], + "mcp": [ + { + "name": "duckduckgo", + "status": "connected" + }, + { + "name": "gitea", + "status": "connected" + } + ], + "existing_session_count": 12, + "migration": "completed", + "tests": { + "model_generation": true, + "gitea_search": true, + "duckduckgo_search": true, + "shell_git": true, + "file_edit_and_execution": true, + "python_assertions": true, + "vcs_status_and_diff": true, + "synthetic_data_removed": true, + "browser_ui": "awaiting user login" + }, + "original_records": { + "sessions": 12, + "messages": 1305, + "parts": 5138, + "exact_legacy_rows_preserved": true, + "all_original_session_ids_in_v2": true + } +}