feat(desktop): support machine-level desktop settings#33083
Open
anduimagui wants to merge 2 commits into
Open
Conversation
795d9e1 to
4bafee6
Compare
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.
Issue for this PR
Refs #28425
Related context: #28444, #29812, #27487, #13336
Type of change
What does this PR do?
Adds a desktop-only machine config file at
~/.config/opencode/desktop.jsonfor settings that should be version-controllable or applied before the normal persisted app settings store is read.This currently supports desktop overrides for:
autoSave,releaseNotes,followup,showFileTree,showNavigation,showSearch,showStatus,showTerminal,showReasoningSummaries,shellToolPartsExpanded,editToolPartsExpanded,showSessionProgressBar,showCustomAgents, andnewLayoutDesigns.permissions.autoApprove.sounds.agentEnabled,sounds.agent,sounds.permissionsEnabled,sounds.permissions,sounds.errorsEnabled, andsounds.errors.The desktop main process reads
desktop.json, logs the resolved path and load result during startup, and exposes the normalized config through the preload bridge. The renderer passes that config through the platform context so shared app settings can use it as a desktop override without knowing about Electron file paths.The config contract now lives in
@opencode-ai/app/desktop-configas an Effect schema-backed module. Unknown keys are ignored, wrong primitive types are dropped, and missing or malformed files returnundefinedso a bad optional desktop config does not block startup.The docs now list
~/.config/opencode/desktop.jsonalongside the existing global and TUI config files.How did you verify your code works?
bun test src/desktop-config.test.tsfrompackages/appbun typecheckfrompackages/appbun test src/main/desktop-config.test.tsfrompackages/desktopbun typecheckfrompackages/desktopbun turbo typechecksuccessfullyScreenshots / recordings
N/A
Checklist