Skip to content

fix(plugin): skip non-function exports in getLegacyPlugins - #1

Open
Cipher208 wants to merge 4 commits into
mainfrom
fix/plugin-legacy-load-skip-non-function-exports
Open

fix(plugin): skip non-function exports in getLegacyPlugins#1
Cipher208 wants to merge 4 commits into
mainfrom
fix/plugin-legacy-load-skip-non-function-exports

Conversation

@Cipher208

Copy link
Copy Markdown
Owner

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:

  • Constants ()
  • Configuration objects ()
  • Type re-exports
  • Utility functions that aren't plugins

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

  • already returns for non-plugin exports
  • The skips these, only collecting valid plugin functions
  • External plugins with mixed exports (functions + constants) now load correctly

Impact

  • Fixes external plugin loading for all MiMoCode users
  • Enables agentsys, skillforge, and other plugin-based tools to work
  • No breaking changes — only changes error behavior from crash-and-skip to skip

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

1 participant