fix(installer): merge missing opencode config keys#156
Open
informaticadiaz wants to merge 2 commits intoGentleman-Programming:mainfrom
Open
fix(installer): merge missing opencode config keys#156informaticadiaz wants to merge 2 commits intoGentleman-Programming:mainfrom
informaticadiaz wants to merge 2 commits intoGentleman-Programming:mainfrom
Conversation
- fix(homebrew): use #!/bin/bash and NONINTERACTIVE=1 in interactive install script — /bin/sh on Debian/Ubuntu is dash, which causes "Bash is required to interpret this script." (closes Gentleman-Programming#137) - fix(setshell): fallback to sudo usermod when chsh fails PAM auth — prevents crash in Docker and minimal Linux environments - docs: add linux-install-fixes.md with root cause analysis, diffs, build/run commands, and test results
23 tasks
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
Fixes the installer behavior that could overwrite an existing user-managed
~/.config/opencode/opencode.jsonduring the optional OpenCode setup flow.This PR does two things:
opencode.jsonduring the external OpenCode installer runGentlemanOpenCode/opencode.jsoninto an existing user config, keeping existing user values intactWhy
Upstream issue #151 reports that running Gentleman.Dots can overwrite an existing OpenCode config created by gentle-ai, which causes users to lose plugins, MCPs, orchestration settings, and other custom adjustments.
The current implementation should avoid destructive overwrites while still allowing fresh installs to receive the default OpenCode config.
Implementation
preserveFileDuringOperation(...)to protect an existing file during mutation-prone external installer executionmergeJSONFileMissingKeys(...)andmergeMissingJSONKeys(...)for non-destructive missing-key merges on JSON object configsinstaller/internal/tui/installer.goto:opencode.jsonduring the external installer runinstaller/internal/tui/installation_steps_test.gofor:Validation
Executed in
installer/:Result:
I also ran:
go test ./internal/tuiThat broader suite currently fails on clean
mainas well, with pre-existing failures tracked separately in my fork atinformaticadiaz/Gentleman.Dots#3:SetupInstallSteps()I kept this PR focused on the
opencode.jsonfix rather than mixing in unrelated test-suite repair work.Scope notes
This change intentionally preserves existing user values and only injects missing keys from the repo default config. It does not attempt to rewrite or normalize user-defined values.
Closes #151