build(opencode): install OpenCode 2 from @opencode/cli #61
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/opencode-2-pin"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Since the Agent Foundry upgrade (#60), the repository's OpenCode hooks,
the shell check and the main-checkout guard, are OpenCode 2 plugins. The
OpenCode image still installs
opencode-aiunpinned, and that packagestops at 1.19.5, so every
opencodecontainer runs OpenCode 1. OpenCode1 does not load V2 plugins, so agent edits there skip both hooks.
OpenCode 2 is published as
@opencode/cli(2.2.1 today), by the samemaintainer through the same trusted publishing from
https://github.com/anomalyco/opencode. An exact
@2.2.1pin wasweighed and set aside: rebuilds already bring each client's latest
release, and an exact pin would need a manual bump each time.
What changed
The OpenCode image now installs
@opencode/cli@2, so each install runand each rebuild at launch brings the latest 2.x, never a 1.x or a 3.x
and never a prerelease. The image's user, directories, PATH, entrypoint
and
OPENCODE_DISABLE_AUTOUPDATEare unchanged.docs/installation.mdsays once, where it describes the install run, that OpenCode's latest
release stays within major version 2.
Breaking for OpenCode users: the next rebuild moves them from 1.19.5 to
2.x. OpenCode 2 reads its configuration from the same
~/.config/opencode.How to verify
On real rootless Podman, from a checkout of the branch:
make build-opencode, thenpodman run --rm --entrypoint opencode opencode-cli:latest --versionprints a
2.version (master gives1.19.5).make test-e2eandmake smoke-imagespass.On the tip, Verify (
make lint && .agents/hooks/shellcheck.sh repo && make test) passes: 348 tests, 0 failures. The extended unit testtest_opencode_stage_has_only_opencode_identity_and_installfails onmaster at "missing OpenCode 2 CLI installation" and "unexpected OpenCode
1 package". The image was not built here, because no real Podman was
available.
Considerations
OpenCode 2 has not yet run in the image. These points are unconfirmed
until the real-Podman gate runs:
OPENCODE_DISABLE_AUTOUPDATEstill has any effect, since V2documents an
updateconfig option instead;run --auto,--session,auth,session list);--versionoutput the installer's version tag reads;Any change these call for comes as a separate change.