Replace OpenCode 1 with OpenCode 2 and enable free models #366
No reviewers
Labels
No labels
area:authentication
area:flake-utilities
area:performance
area:tbd
host:chaos
host:cosmos
host:electra
host:fleet
host:lena
host:lyra
host:mass-storage
host:media1
host:nimmog-de
host:nova
host:pangolin
host:pangolin-vps
host:phone
host:router
host:vega
investigation
phase:cutover
phase:deploy
phase:mcp
phase:module
phase:packaging
phase:prep
phase:validation
priority:high
priority:medium
project:attic-postgres-lyra-rollout
project:auto-update-reliability
project:auto-update-remediation
project:declarative-purity-cleanup
project:external-review
project:fleet-boundary-cleanup
project:host-facts-refactor
project:lyra-nixos-deploy
project:lyra-service-stack-migration
project:nebula-mesh-network
project:nix-idioms-hygiene
project:nixos-build-deployment-pipeline
project:security-hardening
project:service-stack-migration
project:vega-sillytavern-cutover
project:wiki-rebuild
repo:numtide/flake-utils
repo:numtide/nix-auth
repo:numtide/nixos-passthru-cache
repo:numtide/nix-relay
service:auto-update
service:gitlab
service:hermes
service:mem0
service:nix
service:sillytavern
service:slskd
service:synthseek
service:tdarr
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
nimmo/nixos-config!366
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/opencode2"
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?
The shared AI runtime currently launches OpenCode 1 and excludes the built-in provider offering registration-free models. Select the existing locked llm-agents opencode2 package (2.0.32), keeping the opencode command and desktop launcher, and enable the opencode provider alongside existing providers. No lockfile changes.
Closes #365.
Validation:
dd87e8b54f, says Ready to merge and has no findings or suggestions. Review questions are answered in the discussion.No host activation, live authenticated MCP/provider acceptance or Paseo integration acceptance is claimed. The repository's agent sudo restriction prevents just test because it invokes sudo commands outside nixos-rebuild. OpenCode 2 changes its server/plugin API; supported existing configuration is normalized in memory as documented at https://opencode.ai/v2/docs/migrate-v1/ . The independently installed remediation worker is outside this shared-runtime package change.
Automated code review
Reviewed commit:
dd87e8b54fb67e311300c996db16445a4a13c05fVerdict: Ready to merge
No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory.
Overall assessment
Validated against the checked-out tree. In
modules/profiles/ai-runtime.nixthe singleopencodePackagebinding (line 35) is the only use of thellm-agentsOpenCode attribute in this file, and its only consumer isopencodeForUser(line 43), whose exec path was updated in the same diff to${opencodePackage}/bin/opencode2; the wrapper keeps the public nameopencode(pkgs.writeShellScriptBin "opencode"), so thehome.packagesentry, themakeDesktopItemexec = "konsole -e opencode", and thelib.makeBinPathentry insidepaseoRuntimePathall still resolve through the unchanged wrapper name. A repository-wide search forllm-agentsfound no other consumer of an OpenCode attribute:modules/profiles/ai-agents.nixuses only.codexand.antigravity-cli,modules/services/token-tv.nixuses onlyclients.codexandclients.antigravity-cli, andmodules/profiles/pi-pangolin.nixuses.pi. The onlybin/opencodepath references elsewhere (/home/nimmo/.opencode/bin/opencodein.forgejo/workflows/attic-cache.yml:315,350and the--opencode-bindefault inscripts/nixos_update_remediation/cli.py:330) are a separately installed binary, not derived from this package binding. The added"opencode"element inenabled_providersis a plain string in a list with no matching key required in the module: theproviderattrset and thehome.activation.opencodeAuthConfigjq merges cover onlyopenrouter,opencode-go, andpangolin-lyra, and no test or lint intests/orjustfiles/asserts the provider list or the OpenCode bin path.lib/auto-update-policy.nix:164already lists electra, lena, vega, and lyra asllm-agentsconsumers, andai-runtime.nixis imported only viamodules/profiles/ai-desktop.nix:12, imported by those same four hosts, so the input classification is unchanged. The README prose matches the code (package attributeopencode2, public nameopencode). No evaluation-breaking or scope-leaking defect is demonstrable from the supplied evidence; no findings survive the strict pass.Blocking findings
None.
Important findings
None.
Suggestions
None.
Tests and validation
Questions
/home/nimmo/.opencode/bin/opencode(.forgejo/workflows/attic-cache.yml:315,350,scripts/nixos_update_remediation/cli.py:330), andscripts/nixos_update_remediation/model.pyplustests/nixos-update-remediation-integration.py:363still encode v1 behavior ('OpenCode 1.18.10 applies a top-level wildcard deny before path-valued edit exceptions'). Is that worker deliberately left on the v1 side of this cutover, or is it expected to move to theopencode2package too?"opencode"entry inenabled_providershas no corresponding credential merge inhome.activation.opencodeAuthConfig(which writes onlyopenrouter,opencode-go,pangolin-lyra). Is the built-in provider confirmed to need noauth.jsonentry on OpenCode 2, or does it require an authentication step on each host after activation?Review limitations
llm-agentsflake source at the locked revision (flake.lock rev 0ea5795ad05403dfb9e3fda8bfa01248e4ab81e7) is not available here, so the existence of theopencode2package attribute and itsbin/opencode2output path is taken from the PR text, not verified in this container.nix flake check,just test, and the generated~/.config/opencode/opencode.jsonwere not evaluated, and the OpenCode 2 configuration schema (including whetherenabled_providers,small_model,permission, andmcpkeys are unchanged in v2) was not supplied, so config-key compatibility could not be confirmed independently.opencode/big-pickleprompt were not reproduced.Diff coverage
README.md: reviewed — included in a context-limited batchmodules/profiles/ai-runtime.nix: reviewed — included in a context-limited batchReview metadata
Assessed review 135 against current head
dd87e8b54f. Verdict is Ready to merge; there are no blocking/important findings or suggestions requiring a code change.Answers to the review questions:
Additional evidence for review limitations: built the locked opencode2 2.0.32 package and the actual opencode wrapper; wrapper --version passed. V2 debug config showed normalization preserving disabled updates, provider policies, read/shell/external-directory permission rules and all 14 MCP definitions. nix flake check passed locally. Native v2 configuration conversion is optional per upstream migration documentation; no rewrite is needed for this package change.
CI workflow 1352 remains pending on an infrastructure access prerequisite. Detailed operational evidence is kept private. No host activation, live authenticated MCP/provider or Paseo integration acceptance is claimed. No code changes or new push were necessary after review. MR remains open and unmerged; overall merge readiness awaits CI.
The external CI access prerequisite is resolved and authenticated reads of both affected pinned-input repositories have been verified from the runner host. The original stalled run was cancelled. This instance lacks the Actions API rerun endpoint, so I am closing/reopening this same MR to trigger a fresh pull_request run at unchanged head
dd87e8b54f. No source changes are needed.Automated code review
Reviewed commit:
dd87e8b54fb67e311300c996db16445a4a13c05fVerdict: Ready to merge
No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory.
Overall assessment
Re-checked the two changed files against the checked-out tree. In modules/profiles/ai-runtime.nix the package selector change (line 35:
.opencode->.opencode2) and the wrapper exec target (line 43:bin/opencode2) stay internally consistent: the wrapper keeps the nameopencode(line 40), so the PATH entry contributed byopencodeForUserinpaseoRuntimePath(line 58) and inhome.packages(line 293), plus the desktop itemexec = "konsole -e opencode"(line 313), still resolve by name.grepover the tree shows no other consumer of the flake OpenCode package:modules/services/token-tv.nix(line 11) bindsclients = inputs.llm-agents.packages.<system>but only usesclients.codexandclients.antigravity-cli;modules/profiles/pi-pangolin.nix(line 26) andmodules/profiles/ai-agents.nix(lines 14, 29) use other attributes. The remainingbin/opencodereferences are the user-home binary/home/nimmo/.opencode/bin/opencode(.forgejo/workflows/attic-cache.yml lines 315, 350; scripts/nixos_update_remediation/cli.py line 330 default), not the flake package.lib/auto-update-policy.nixclassifiesllm-agentsat input granularity (lines 164-172), so switching package attributes within the same locked input needs no policy change; no check script (scripts/check-*.nix) keys on the OpenCode package or version. The added"opencode"entry inenabled_providers(line 153) coexists with the existing entries; the credential-merge activation (lines 349-355) still provisions only openrouter, opencode-go and pangolin-lyra, and theproviderattrset (lines 176-218, merged withcfg.opencodeExtraProviders) has noopencodeentry, matching the README claim that the built-in provider needs no registration. No defect demonstrable from the supplied diff.Blocking findings
None.
Important findings
None.
Suggestions
None.
Tests and validation
Questions
/home/nimmo/.opencode/bin/opencode(.forgejo/workflows/attic-cache.yml lines 315 and 350; scripts/nixos_update_remediation/cli.py line 330 default), and scripts/nixos_update_remediation/model.py comments encode OpenCode 1 behaviour (line 36 'OpenCode 1.18.10's 2000-character read-line limit', line 221 'OpenCode 1.18.10 does not let a path-valued edit rule override the top-level wildcard deny', line 578 'OpenCode truncates each read-tool line at 2000 characters'). Is that worker intentionally left on OpenCode 1 while the fleet runtime moves to OpenCode 2, or should it be migrated in a follow-up so the two do not diverge?~/.config/opencode/config.json(line 329) and~/.config/opencode/opencode.json(lines 331-334,force = true). For the newly selectedopencode2package, is that same config path/schema still the one read, or did the upstream rename/restructure it? Nothing in the checkout shows the OpenCode 2 config schema.enabled_providers(line 151) is shared by all hosts using this profile and is not scoped bycfg.headless(modules/profiles/ai-desktop.nix lines 16-24). Should the built-inopencodeprovider be enabled on the headless hosts that run unattended automation, or only on desktop hosts?Review limitations
llm-agentsflake is an external input (flake.lock line 455, rev 0ea5795ad05403dfb9e3fda8bfa01248e4ab81e7) and is not vendored in this checkout, so I could not verify from supplied evidence that the locked rev exposes a package attribute namedopencode2or that its output path containsbin/opencode2; both are asserted only by the change itself.opencodeConfig(lines 147-220), since neither the upstream schema nor the generated JSON output was supplied.Diff coverage
README.md: reviewed — included in a context-limited batchmodules/profiles/ai-runtime.nix: reviewed — included in a context-limited batchReview metadata
Final readiness check: review 136 covers unchanged head
dd87e8b54fand says Ready to merge with zero findings and no suggestions. CI run 1354 passed its regression/Nix gate, and review run 1353 passed. Combined head status is success; deployment/publishing jobs are intentionally skipped for pull_request events.Assessed all remaining questions:
No code changes were necessary. Host activation and live authenticated MCP/Paseo acceptance remain unclaimed; merge is now user-authorized.