fix: update omoPluginName from oh-my-opencode to oh-my-openagent (#2600)#2603
fix: update omoPluginName from oh-my-opencode to oh-my-openagent (#2600)#2603lark1115 wants to merge 4 commits intomanaflow-ai:mainfrom
Conversation
|
@lark1115 is attempting to deploy a commit to the Manaflow Team on Vercel. A member of the Team first needs to authorize it. |
|
To use Codex here, create a Codex account and connect to github. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughRenames the OMO plugin and related artifacts from Changes
Sequence DiagramsequenceDiagram
participant CLI as CLI
participant Agent as Agent/Daemon
participant PluginList as Plugin List
participant ConfigFS as Config Files (user & shadow)
CLI->>Agent: request OMO setup/install
Agent->>PluginList: read current plugins
PluginList->>PluginList: remove entries matching "oh-my-opencode" / "oh-my-opencode@*"
Agent->>ConfigFS: check for user `oh-my-openagent.json/jsonc`
alt new config exists
ConfigFS-->>Agent: provide `oh-my-openagent` config
else fallback
Agent->>ConfigFS: check for user `oh-my-opencode.json/jsonc`
ConfigFS-->>Agent: provide legacy config (if present)
end
Agent->>ConfigFS: create/copy shadow `oh-my-openagent.{json,jsonc}` (or copy legacy if only legacy present)
PluginList->>PluginList: append "oh-my-openagent"
Agent->>CLI: report install result / updated config
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR updates the plugin identifier from
Confidence Score: 4/5Safe to merge; the plugin rename is correctly propagated in both Swift and Go implementations with proper legacy fallback handling The core changes are consistent between Swift and Go, the legacy cleanup and config fallback logic is correct, and the migration is backward-compatible. The only concern is that web documentation locale files were not updated with the new plugin name, leaving stale user-facing references to 'oh-my-opencode'. web/messages/uk.json and other locale files contain stale oh-my-opencode references in page titles and step descriptions (not in this PR's changeset) Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant cmux
participant ShadowDir as ~/.cmuxterm/omo-config
participant UserDir as ~/.config/opencode
participant pkg as npm/bun
User->>cmux: cmux omo
cmux->>ShadowDir: Create shadow config dir
cmux->>UserDir: Read opencode.json
cmux->>ShadowDir: Write opencode.json (plugin: oh-my-openagent, legacy oh-my-opencode removed)
cmux->>ShadowDir: Ensure package.json (oh-my-openagent: latest)
alt oh-my-openagent.json exists in UserDir
cmux->>ShadowDir: Symlink oh-my-openagent.json
else oh-my-opencode.json exists in UserDir (legacy fallback)
cmux->>ShadowDir: Symlink oh-my-opencode.json as oh-my-openagent.json
end
alt Plugin not installed
cmux->>pkg: install oh-my-openagent
pkg-->>ShadowDir: node_modules/oh-my-openagent
end
cmux->>ShadowDir: Write oh-my-openagent.json (tmux.enabled=true)
cmux->>cmux: Set OPENCODE_CONFIG_DIR=ShadowDir
cmux->>User: exec opencode
Reviews (1): Last reviewed commit: "fix: correct try?/?? operator precedence..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
CLI/cmux.swift (1)
10575-10575:⚠️ Potential issue | 🟠 MajorLocalize newly changed OMO user-facing install/error/status strings.
These updated stderr/error/status messages are user-facing and are still hardcoded string literals. Please switch them to
String(localized:..., defaultValue:...)keys and add entries inResources/Localizable.xcstrings(English/Japanese).As per coding guidelines
**/*.{swift,swiftui}: “All user-facing strings must be localized usingString(localized: "key.name", defaultValue: "English text")… Keys must go inResources/Localizable.xcstringswith translations for all supported languages (English and Japanese).”Also applies to: 10583-10583, 10593-10593, 10597-10597, 10704-10704, 10707-10707, 10709-10709
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@CLI/cmux.swift` at line 10575, Several user-facing error/status string literals in CLI/cmux.swift (around the messages at the referenced lines) must be localized; replace each hardcoded literal with String(localized: "omu.<key>", defaultValue: "<English text>") using distinct keys (e.g. omu.install.error, omu.install.status, omu.uninstall.error etc.) to match the message intent, update the call sites where those literals are emitted (search for the exact strings at the noted lines) and ensure the new keys are added to Resources/Localizable.xcstrings with English and Japanese translations; keep the original English text as the defaultValue for each key.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@daemon/remote/cmd/cmuxd-remote/agent_launch.go`:
- Around line 559-574: The code currently ignores json.Unmarshal errors for
omoConfig (and for userOmoConfig/legacyOmoConfig) and still removes
omoConfigPath, which hides malformed user config; update the logic around
omoConfigPath, omoConfig, userOmoConfig and legacyOmoConfig so that you check
and handle the error returned by json.Unmarshal (call sites referencing
json.Unmarshal), do not call os.Remove(omoConfigPath) when Unmarshal fails, and
instead surface or log the parsing error and abort/return it (or preserve the
existing file) so malformed JSON is not silently replaced by defaults.
- Around line 505-518: The loop currently skips creating a shadow symlink
whenever shadowFile exists, which leaves stale/broken symlinks pointing at
legacy targets; update the logic in the loop that processes newName/legacyName
to: if shadowFile exists, use os.Lstat to detect a symlink and os.Readlink to
inspect its target, and if the symlink is broken or points to the legacy path
(legacyFile) remove it (os.Remove) and recreate the symlink to the correct
userFile; otherwise leave valid symlinks alone; keep using
fileExists(userFile)/fileExists(legacyFile) and os.Symlink to create the new
link and propagate any errors appropriately.
---
Outside diff comments:
In `@CLI/cmux.swift`:
- Line 10575: Several user-facing error/status string literals in CLI/cmux.swift
(around the messages at the referenced lines) must be localized; replace each
hardcoded literal with String(localized: "omu.<key>", defaultValue: "<English
text>") using distinct keys (e.g. omu.install.error, omu.install.status,
omu.uninstall.error etc.) to match the message intent, update the call sites
where those literals are emitted (search for the exact strings at the noted
lines) and ensure the new keys are added to Resources/Localizable.xcstrings with
English and Japanese translations; keep the original English text as the
defaultValue for each key.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e5903e5f-a1c6-4812-86d0-fda750b02f75
📒 Files selected for processing (2)
CLI/cmux.swiftdaemon/remote/cmd/cmuxd-remote/agent_launch.go
| // Configure oh-my-openagent.json with tmux settings | ||
| 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 omoConfig == nil { | ||
| // Check if user had one we symlinked | ||
| userOmoConfig := filepath.Join(userDir, "oh-my-opencode.json") | ||
| // 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) // Remove symlink so we can write our own copy | ||
| os.Remove(omoConfigPath) | ||
| } else if data, err := os.ReadFile(legacyOmoConfig); err == nil { | ||
| json.Unmarshal(data, &omoConfig) | ||
| os.Remove(omoConfigPath) |
There was a problem hiding this comment.
Don't silently replace malformed OMO config.
Lines 563, 570, and 573 ignore json.Unmarshal errors. If the user's OMO config is malformed, the fallback branch still removes omoConfigPath at 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
Verify each finding against the current code and only fix it if needed.
In `@daemon/remote/cmd/cmuxd-remote/agent_launch.go` around lines 559 - 574, The
code currently ignores json.Unmarshal errors for omoConfig (and for
userOmoConfig/legacyOmoConfig) and still removes omoConfigPath, which hides
malformed user config; update the logic around omoConfigPath, omoConfig,
userOmoConfig and legacyOmoConfig so that you check and handle the error
returned by json.Unmarshal (call sites referencing json.Unmarshal), do not call
os.Remove(omoConfigPath) when Unmarshal fails, and instead surface or log the
parsing error and abort/return it (or preserve the existing file) so malformed
JSON is not silently replaced by defaults.
There was a problem hiding this comment.
Valid concern, but this is pre-existing behavior — the json.Unmarshal error handling pattern is identical on main (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.
@lark1115, that's a fair point — the json.Unmarshal error-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
Learnt from: lawrencecchen
Repo: manaflow-ai/cmux PR: 2525
File: Sources/GhosttyTerminalView.swift:481-513
Timestamp: 2026-04-02T10:13:39.235Z
Learning: Repo: manaflow-ai/cmux — In Sources/GhosttyTerminalView.swift, terminal file-link resolution trims trailing unmatched closing delimiters “) ] } >” only when they are dangling (more closers than openers), preserving wrapped tokens like “(file:///tmp/a.png)”. Implemented via terminalFileLinkTrailingClosingDelimiters and count comparison inside trimTrailingTerminalFileLinkPunctuation(_:) and exercised by a regression test (PR `#2525`, commit 3f5c5b6d).
Learnt from: lawrencecchen
Repo: manaflow-ai/cmux PR: 2564
File: CLI/cmux.swift:0-0
Timestamp: 2026-04-04T02:33:03.680Z
Learning: Repo: manaflow-ai/cmux — In CLI/cmux.swift, baseSSHArguments(_:, localCommand:) now percent-escapes LocalCommand by replacing "%" with "%%" to prevent OpenSSH percent-token expansion. A CLI regression test asserts that the emitted -o LocalCommand retains doubled percent signs.
Learnt from: outoftime
Repo: manaflow-ai/cmux PR: 1528
File: Resources/shell-integration/fish/vendor_conf.d/cmux-fish-integration.fish:541-546
Timestamp: 2026-03-17T13:59:10.665Z
Learning: Repo: manaflow-ai/cmux — The socket command `report_git_branch` (parsed in Sources/TerminalController.swift) expects the branch name as an **unquoted, bare token**. Wrapping the branch name in double quotes causes it to be silently discarded by the parser. This matches the bash/zsh shell integration convention. Do not suggest quoting the branch argument for this command; the fix was attempted in commit 829437c7 and immediately reverted because it broke branch reporting.
There was a problem hiding this comment.
No issues found across 2 files
You’re at about 83% of the monthly review limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
abf4bb8 to
07de1cf
Compare
…aflow-ai#2600) The npm package was renamed from oh-my-opencode to oh-my-openagent. The hardcoded old name in the shadow package.json causes a legacy-name warning on every startup and breaks symlinked opencode.json files via automatic migration.
- Update config filenames (oh-my-opencode.json → oh-my-openagent.json) - Update all user-facing error messages and status strings - Update all comments - Add legacy plugin name cleanup to prevent duplicate registration when upgrading from oh-my-opencode to oh-my-openagent
Existing users may only have oh-my-opencode.json in their config dir. Add fallback logic to symlink and read legacy filenames when the new oh-my-openagent.json is not present, in both Swift and Go paths.
try? Data(contentsOf: a) ?? Data(contentsOf: b) is parsed as try? (Data(...) ?? Data(...)), so the fallback never fires. Use explicit parentheses: (try? Data(...)) ?? (try? Data(...))
07de1cf to
47f4d28
Compare
Summary
oh-my-opencodereferences tooh-my-openagentinCLI/cmux.swiftanddaemon/remote/cmd/cmuxd-remote/agent_launch.gopackage.jsoncauses a legacy-name warning on every startup and triggers auto-migration that breaks symlinkedopencode.jsonfilesoh-my-opencodeplugin entries are automatically removed to prevent duplicate registrationoh-my-opencode.jsonfor existing users who haven't renamed their configFixes #2600
Testing
oh-my-opencodereferences (only intentional legacy cleanup literals)cmux omogeneratespackage.jsonwith"oh-my-openagent": "latest"oh-my-opencode.jsonconfig are handled via fallbackDemo Video
N/A — no UI changes
Review Trigger (Copy/Paste as PR comment)
Checklist
Summary by cubic
Rename OMO plugin from
oh-my-opencodetooh-my-openagentacross the CLI and remote agent to remove startup warnings, prevent duplicate plugin registration, and keep existing configs working. Fixes #2600.omoPluginName, config filenames, and all user-facing messages inCLI/cmux.swiftanddaemon/remote/cmd/cmuxd-remote/agent_launch.go.oh-my-opencodeentries frompluginlists to prevent duplicate registration.oh-my-openagent.{json,jsonc}with legacyoh-my-opencodefallback in both Swift and Go.oh-my-opencode.jsonis correctly loaded; updated bun/npm install and errors to referenceoh-my-openagent.Written for commit 47f4d28. Summary will update on new commits.
Summary by CodeRabbit