fix(plugin): skip non-function exports in getLegacyPlugins - #1
Open
Cipher208 wants to merge 4 commits into
Open
Conversation
added 4 commits
July 27, 2026 15:12
External plugins fail to load because getLegacyPlugins throws TypeError when encountering any export that is not a function and doesn't have a 'server' property (e.g. constants, config objects, type re-exports). This causes the entire plugin to be silently skipped — the error is caught in applyPlugin's Effect.catch and logged, but hooks are never registered. Fix: change 'throw' to 'continue' so non-plugin exports are silently skipped, matching the behavior of getServerPlugin which already returns undefined for non-plugin values. This fixes the issue where external plugins (plugin: [...]) don't execute their module code in MiMoCode 0.38.9.
Replaces separate lint.yml, test.yml, typecheck.yml with unified ci.yml: - typecheck: bun typecheck - lint: oxlint + prettier check - test: sharded unit tests (4 shards) - security: skylos scan on plugin directory - quality: repowise health on plugin directory - python: auto-detects pyproject.toml, runs ruff/mypy/pytest - rust: auto-detects Cargo.toml, runs cargo check/test - go: auto-detects go.mod, runs go vet/test Multi-language: Python, Rust, Go jobs auto-detect and skip if no files found.
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.
Problem
External plugins () don't execute their module code in MiMoCode 0.38.9. The plugin module IS loaded (ES succeeds), but hooks are never registered.
Root Cause
in throws when it encounters ANY export that is not a function and doesn't have a property. This includes:
The throw is caught by 's handler (line 392), which silently swallows the error and returns . The plugin is never loaded, hooks are never registered.
Fix
Change to on line 178. Non-plugin exports are silently skipped, matching the behavior of which already returns for non-plugin values.
Testing
Impact