-
-
Notifications
You must be signed in to change notification settings - Fork 957
fix: update omoPluginName from oh-my-opencode to oh-my-openagent (#2600) #2603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lark1115
wants to merge
4
commits into
manaflow-ai:main
Choose a base branch
from
lark1115:fix-2600-omo-package-rename
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+70
−40
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8a9795e
fix: update omoPluginName from oh-my-opencode to oh-my-openagent (#2600)
lark1115 9a61ccc
fix: update all oh-my-opencode references to oh-my-openagent
lark1115 0fb2299
fix: add legacy oh-my-opencode config fallback for existing users
lark1115 47f4d28
fix: correct try?/?? operator precedence in legacy config fallback
lark1115 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't silently replace malformed OMO config.
Lines 563, 570, and 573 ignore
json.Unmarshalerrors. If the user's OMO config is malformed, the fallback branch still removesomoConfigPathat Lines 571 and 574 and later writes defaults, which hides the syntax error instead of surfacing it.🛠️ Proposed fix
omoConfigPath := filepath.Join(shadowDir, "oh-my-openagent.json") var omoConfig map[string]any if data, err := os.ReadFile(omoConfigPath); err == nil { - json.Unmarshal(data, &omoConfig) + if err := json.Unmarshal(data, &omoConfig); err != nil { + return fmt.Errorf("failed to parse %s: fix the JSON syntax and retry", omoConfigPath) + } } if omoConfig == nil { // Check if user had one we symlinked (new name first, fall back to legacy) userOmoConfig := filepath.Join(userDir, "oh-my-openagent.json") legacyOmoConfig := filepath.Join(userDir, "oh-my-opencode.json") if data, err := os.ReadFile(userOmoConfig); err == nil { - json.Unmarshal(data, &omoConfig) - os.Remove(omoConfigPath) + if err := json.Unmarshal(data, &omoConfig); err != nil { + return fmt.Errorf("failed to parse %s: fix the JSON syntax and retry", userOmoConfig) + } + _ = os.Remove(omoConfigPath) } else if data, err := os.ReadFile(legacyOmoConfig); err == nil { - json.Unmarshal(data, &omoConfig) - os.Remove(omoConfigPath) + if err := json.Unmarshal(data, &omoConfig); err != nil { + return fmt.Errorf("failed to parse %s: fix the JSON syntax and retry", legacyOmoConfig) + } + _ = os.Remove(omoConfigPath) } }🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Valid concern, but this is pre-existing behavior — the
json.Unmarshalerror handling pattern is identical onmain(lines 543-555). This PR only changes the filenames, not the error handling logic. Better addressed in a separate follow-up.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lark1115, that's a fair point — thejson.Unmarshalerror-handling pattern is pre-existing and this PR doesn't alter it. I'll drop the concern for this PR.Would you like me to open a follow-up GitHub issue to track the improvement (surfacing parse errors instead of silently falling back to defaults for the OMO config files)?
🧠 Learnings used