Repository navigation
fix(bwopencode2): run the opencode2 binary, not the ansible wrapper - #27
Merged
Thomas A Caswell (tacaswell) merged 1 commit intoOct 23, 2026
Conversation
The ansible /usr/local/bin/opencode2 wrapper exports
XDG_*_HOME=~/.{config,local/share,local/state,cache}/opencode2. Since
af7bc7f the sandbox mounts the OpenCode 2 directories at the standard
locations, so inside the sandbox OpenCode 2 read empty directories (no
cli.json, opencode.json, plugins or database) and every tool it ran
(git, pixi, ccache) inherited the redirected XDG paths.
Run /opt/nsls2/opencode2/node_modules/@opencode/cli/bin/opencode.exe
directly; guard_tool_args already adds --standalone, the wrapper's
other job. Fall back to the wrapper when the binary is missing; --exec
is unchanged. Register /opt/nsls2/opencode2 as mounted so the dynamic
tool mounts do not bind the binary's directory again.
Assisted-by: opencode:claude-opus-5-5
There was a problem hiding this comment.
🟢 Approval recommended
The targeted changes preserve existing argument guards and command overrides, with no blocking issues identified.
No open issues 🎉
What changed in this PR
This PR fixes bwopencode2 so OpenCode 2 uses the configuration, plugins, and database mounted at standard sandbox paths rather than paths redirected by the host wrapper.
Changes:
- Run the managed OpenCode 2 binary directly, preserving wrapper fallback, standalone guarding, and
--execbehavior. - Register the install directory as mounted to prevent duplicate dynamic mounts.
- Document the launch behavior and update the AI disclosure metadata.
| File | Description |
|---|---|
| docs/bw-wrappers.md | Explain direct binary execution, fallback, and --exec usage. |
| bin/bwopencode2 | Select the managed binary and prevent duplicate install-directory mounts. |
| AI_DISCLOSURE.md | Update the model list and disclosure date. |
Review effort: Balanced
Thomas A Caswell (tacaswell)
approved these changes
Oct 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bwopencode2launched the ansible wrapper/usr/local/bin/opencode2, whichexports
XDG_*_HOME=~/.{config,local/share,local/state,cache}/opencode2.Since af7bc7f the sandbox mounts the OpenCode 2 directories at the standard
locations, so inside the sandbox OpenCode 2 read empty directories and ignored
the mounted
cli.json,opencode.json, plugins and database. This PR runs theOpenCode 2 binary directly instead.
Description
/opt/nsls2/opencode2/node_modules/@opencode/cli/bin/opencode.exedirectly when no
--execis given.guard_tool_argsalready adds--standalone, which was the wrapper's other job. If the binary is missing,fall back to the wrapper.
/opt/nsls2/opencode2as already mounted, so the dynamic toolmounts don't bind the binary's directory a second time.
XDG_*is set inside the sandbox, so git, pixi and ccache also find theirconfig at the standard paths. That was the goal of af7bc7f.
docs/bw-wrappers.mdexplains why the wrapper is skipped.Considered instead: having the ansible wrapper skip its
XDG_*exports whena flag is set. That would be cleaner, but it needs changes in two repos and an
ansible rollout first.
Testing
bash -n bin/bwopencode2;pixi run -e dev lint-fileson the changed files(shellcheck, shfmt, markdownlint, codespell, gitleaks) passes.
bin/bwopencode2 --dry-runends with-- /opt/nsls2/opencode2/node_modules/@opencode/cli/bin/opencode.exe --standalone.XDG_*paths are used,~/.config/opencodecontainscli.json,opencode.json,plugins,tui-plugins,skills,agentsandcommands, server plugins load, thehost session database is used (sessions resume with
-s), and git finds~/.gitconfigand~/.config/git/allowed_signers.Checklist
pixi run -e dev lintlocally (or wait for CI) — see.github/workflows/lint.ymlrunansibledeployment)