Repository navigation
Conversation
The flake-built binary lives in the read-only Nix store, so the self-updater can never apply an update — and when the TUI offers one, the attempt fails and can leave a running session in a bad state (observed on NixOS: the update flow started and the session stopped responding until its processes were killed). Set OPENCODE_DISABLE_AUTOUPDATE=1 in the existing wrapper so the flake's opencode skips the updater entirely; users update through nix. The env var is already supported by the updater.
|
The following comment was made by an LLM, it may be inaccurate: |
|
Renaming the head branch to |
There was a problem hiding this comment.
This fixes what #54022 reports for flake installs. With OPENCODE_DISABLE_AUTOUPDATE=1 set, the automatic update check is skipped, so the home-screen /update to install vX notice and its prompt no longer appear.
There's no Nix in my sandbox, so I simulated the flake install: the released 2.0.25 binary in a read-only /nix/store-style folder, behind a wrapper that sets the variable and runs it, like wrapProgram does. Without the variable, the home screen offered v2.0.26. With it, the notice was gone. I couldn't run nix build.
Public API: unchanged. This only sets an existing environment variable in the Nix package.
One gap: the manual /update command still offers the update. In my run with the variable set, /update opened "Update available" with an Update button, and accepting it still failed with Installation method not found. The variable is only read by the automatic check (inspect() in packages/cli/src/services/updater.ts); check() and apply(), which /update uses, ignore it. Nix users who run /update still reach the path that failed for you. To fully cover it, check() would need to honour the variable (or report unavailable when no installation method is found, as the issue suggests). That would be a change in the CLI rather than in the flake, so it could also be a follow-up.
Separately, the new comment is inline below.
Related: #52122
| install -Dm755 dist/cli-*/bin/opencode $out/bin/opencode | ||
|
|
||
| # OpenTUI dlopens Wayland for clipboard images. | ||
| # A Nix store install cannot self-update: the store is read-only, and an |
There was a problem hiding this comment.
This block sits between # OpenTUI dlopens Wayland for clipboard images. and the LD_LIBRARY_PATH line that comment explains, so the Wayland comment now reads as if it explains this one. For a one-line fix the comment isn't needed; it can be dropped (along with the unrelated versionCheckKeepEnvironment reformat) so the change stays minimal.



Issue for this PR
Closes #54022
Type of change
What does this PR do?
opencode installed via this repo's flake lives in the read-only Nix store, but the TUI still offers the in-app update. Accepting it starts the self-updater, which cannot replace the binary, and the session stops responding until its processes are killed.
This sets
OPENCODE_DISABLE_AUTOUPDATE=1in the flake's existingwrapProgramcall, so the flake'sopencodeskips the updater entirely — the env var the updater already supports. Nix users update through nix.How did you verify your code works?
Built
nix build .#opencodeon NixOS (x86_64-linux), confirmed the installed wrapper sets the variable before exec, and ranopencode serveand--version— both work, with no update-check activity in the logs.Screenshots / recordings
Not a UI change.
Checklist
Added by the opencode bot (AI-generated).
Related: #52122