fix: make oh-my-opencode optional in ModePreset and add tests#15
Merged
fix: make oh-my-opencode optional in ModePreset and add tests#15
Conversation
- Make 'oh-my-opencode' field optional in ModePreset type - Add undefined guards in manager.ts (4 locations) to skip oh-my-opencode processing when not configured in preset - Update initializer.ts to omit 'oh-my-opencode' key from preset when oh-my-opencode.json does not exist - Fix MockModeManager in manager.test.ts to match production behavior - Add 7 new test cases covering oh-my-opencode optional scenarios Fixes #14
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
'oh-my-opencode'field optional inModePresetto fix plugin startup errors in environments without oh-my-opencodeundefinedguards in 4 locations inmanager.tsto skip oh-my-opencode processing when not configured in presetinitializer.tsto omit the'oh-my-opencode'key from preset entirely whenoh-my-opencode.jsondoes not existChanges
src/config/types.ts— Make'oh-my-opencode'optional (?)src/modes/manager.ts— Addundefinedguards (4 locations)src/config/initializer.ts— Conditionally include key via spread operatorsrc/modes/manager.test.ts— Fix MockModeManager + 4 new testssrc/config/initializer.test.ts— 3 new testsRelated Issues
Closes #14