Skip to content

fix: update omoPluginName from oh-my-opencode to oh-my-openagent (#2600)#2603

Open
lark1115 wants to merge 4 commits intomanaflow-ai:mainfrom
lark1115:fix-2600-omo-package-rename
Open

fix: update omoPluginName from oh-my-opencode to oh-my-openagent (#2600)#2603
lark1115 wants to merge 4 commits intomanaflow-ai:mainfrom
lark1115:fix-2600-omo-package-rename

Conversation

@lark1115
Copy link
Copy Markdown
Contributor

@lark1115 lark1115 commented Apr 5, 2026

Summary

  • Update all oh-my-opencode references to oh-my-openagent in CLI/cmux.swift and daemon/remote/cmd/cmuxd-remote/agent_launch.go
  • The npm package was renamed from oh-my-opencode to oh-my-openagent in v3.13.0
  • The old name in the shadow package.json causes a legacy-name warning on every startup and triggers auto-migration that breaks symlinked opencode.json files
  • Constants, config filenames, user-facing messages, and comments updated
  • Legacy oh-my-opencode plugin entries are automatically removed to prevent duplicate registration
  • Fallback logic added to read legacy oh-my-opencode.json for existing users who haven't renamed their config

Fixes #2600

Testing

  • Verified no remaining functional oh-my-opencode references (only intentional legacy cleanup literals)
  • cmux omo generates package.json with "oh-my-openagent": "latest"
  • Existing users with only oh-my-opencode.json config are handled via fallback

Demo Video

N/A — no UI changes

Review Trigger (Copy/Paste as PR comment)

@codex review
@coderabbitai review
@greptile-apps review
@cubic-dev-ai review

Checklist

  • I tested the change locally
  • I added or updated tests for behavior changes
  • I updated docs/changelog if needed
  • I requested bot reviews after my latest commit (copy/paste block above or equivalent)
  • All code review bot comments are resolved
  • All human review comments are resolved

Summary by cubic

Rename OMO plugin from oh-my-opencode to oh-my-openagent across the CLI and remote agent to remove startup warnings, prevent duplicate plugin registration, and keep existing configs working. Fixes #2600.

  • Bug Fixes
    • Updated omoPluginName, config filenames, and all user-facing messages in CLI/cmux.swift and daemon/remote/cmd/cmuxd-remote/agent_launch.go.
    • Removed legacy oh-my-opencode entries from plugin lists to prevent duplicate registration.
    • Symlink and read oh-my-openagent.{json,jsonc} with legacy oh-my-opencode fallback in both Swift and Go.
    • Fixed Swift fallback read precedence so legacy oh-my-opencode.json is correctly loaded; updated bun/npm install and errors to reference oh-my-openagent.

Written for commit 47f4d28. Summary will update on new commits.

Summary by CodeRabbit

  • Chores
    • Migrated plugin naming from "oh-my-opencode" to "oh-my-openagent" across installs and messaging.
    • Preserves backward compatibility by reading legacy config when present.
    • Prevents duplicate plugin registration during updates.
    • Improves fallback and shadowing behavior for tmux/config files and installation instructions.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 5, 2026

@lark1115 is attempting to deploy a commit to the Manaflow Team on Vercel.

A member of the Team first needs to authorize it.

@chatgpt-codex-connector
Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: edbd8644-f1e2-4180-a667-19d40755d558

📥 Commits

Reviewing files that changed from the base of the PR and between 07de1cf and 47f4d28.

📒 Files selected for processing (2)
  • CLI/cmux.swift
  • daemon/remote/cmd/cmuxd-remote/agent_launch.go
✅ Files skipped from review due to trivial changes (1)
  • CLI/cmux.swift
🚧 Files skipped from review as they are similar to previous changes (1)
  • daemon/remote/cmd/cmuxd-remote/agent_launch.go

📝 Walkthrough

Walkthrough

Renames the OMO plugin and related artifacts from oh-my-opencode to oh-my-openagent across CLI and daemon code, updates user-facing install/error messages, removes legacy plugin entries during plugin-list handling, and implements config/symlink fallback to legacy filenames when needed.

Changes

Cohort / File(s) Summary
CLI & daemon OMO plugin rename
CLI/cmux.swift, daemon/remote/cmd/cmuxd-remote/agent_launch.go
Changed exported/const plugin name from oh-my-opencodeoh-my-openagent. Updated install/manual-install messages and tmux config filename references.
Legacy cleanup & fallback logic
daemon/remote/cmd/cmuxd-remote/agent_launch.go, CLI/cmux.swift
Remove legacy oh-my-opencode entries (exact and @... variants) before appending new plugin. Shadow config symlink/copy now prefers oh-my-openagent.{json,jsonc} and falls back to oh-my-opencode.{json,jsonc}. Tmux-enabled read/write uses new name with legacy fallback.

Sequence Diagram

sequenceDiagram
    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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🐰 A hop, a tweak, a package renamed,
From opencode to openagent I'm famed,
I tidy legacy bits and stitch a fallback seam,
Configs safe and snug — in moonlit beam. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 27.27% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and concisely summarizes the main change: updating omoPluginName from oh-my-opencode to oh-my-openagent, which is the primary objective of the changeset.
Description check ✅ Passed The description follows the template structure with Summary, Testing, and Checklist sections. It provides clear context about the package rename, the problems it solves, verification steps, and indicates testing was completed locally.
Linked Issues check ✅ Passed The PR meets all coding requirements from linked issue #2600: updates omoPluginName constant in both files, implements legacy plugin entry removal, adds fallback logic for legacy config files, and eliminates the startup warning by using the correct package name.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the objectives: renaming oh-my-opencode to oh-my-openagent in the two specified files, managing legacy entries, and implementing fallback logic. No unrelated changes are present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 5, 2026

Greptile Summary

This PR updates the plugin identifier from oh-my-opencode to oh-my-openagent across the Swift CLI and Go daemon relay, following the npm package rename in v3.13.0, and adds backward-compatible fallback handling for existing users.

  • omoPluginName constant updated to "oh-my-openagent" in both CLI/cmux.swift and agent_launch.go, propagating correctly to package.json generation, plugin installation commands, and node_modules path resolution
  • Legacy oh-my-opencode plugin entries are explicitly removed from opencode.json before adding the new name, preventing duplicate plugin registration
  • Config file fallback: if oh-my-openagent.json (or .jsonc) is not found in the user config dir, both implementations fall back to reading oh-my-opencode.json, ensuring a smooth migration for existing users
  • Stale documentation: Several web locale files (web/messages/uk.json, web/messages/zh-TW.json, web/messages/zh-CN.json, web/messages/ru.json, and others) still contain user-facing strings referencing the old oh-my-opencode name — including the docs page title ("title": "oh-my-opencode"), step descriptions, and nav labels. These were not updated in this PR and may confuse users reading the documentation.

Confidence Score: 4/5

Safe 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

Filename Overview
CLI/cmux.swift Updates omoPluginName constant to 'oh-my-openagent', adds legacy oh-my-opencode plugin entry cleanup, and adds fallback config reading from legacy oh-my-opencode.json for existing users
daemon/remote/cmd/cmuxd-remote/agent_launch.go Mirrors Swift changes in Go: updates omoPluginName to 'oh-my-openagent', removes legacy plugin entries from opencode.json, and adds config file fallback for users with oh-my-opencode.json

Sequence Diagram

sequenceDiagram
    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
Loading

Reviews (1): Last reviewed commit: "fix: correct try?/?? operator precedence..." | Re-trigger Greptile

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 | 🟠 Major

Localize 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 in Resources/Localizable.xcstrings (English/Japanese).

As per coding guidelines **/*.{swift,swiftui}: “All user-facing strings must be localized using String(localized: "key.name", defaultValue: "English text") … Keys must go in Resources/Localizable.xcstrings with 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

📥 Commits

Reviewing files that changed from the base of the PR and between 2bf4367 and 07de1cf.

📒 Files selected for processing (2)
  • CLI/cmux.swift
  • daemon/remote/cmd/cmuxd-remote/agent_launch.go

Comment on lines +559 to +574
// 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)
Copy link
Copy Markdown

@coderabbitai coderabbitai bot Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

Copy link
Copy Markdown
Contributor Author

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.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.

Copy link
Copy Markdown

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 — 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.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@lark1115 lark1115 force-pushed the fix-2600-omo-package-rename branch from abf4bb8 to 07de1cf Compare April 5, 2026 11:35
lark1115 added 4 commits April 5, 2026 20:41
…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(...))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cmux omo: shadow package.json uses renamed package name "oh-my-opencode"

1 participant