[Bug] A plugin saved as .js is silently ignored, and nothing shows which plugins loaded
Description
Only .mjs files in .nanocoder/plugins/ are loaded (source/plugins/host.ts:120). Any other file, such as a plugin named guard.js, is dropped without a message. /doctor has no plugins section and there is no startup line, so a user cannot tell whether a plugin loaded. This is easy to hit: the file looks valid, and a guard plugin that never loads protects nothing.
Environment
- OS: Windows 11 (10.0.26300)
- Node version: 22.22.3
- Nanocoder version: 1.31.0 (main at 9d88dda7)
- Provider: Ollama
- Model: qwen2.5:1.5b
Steps to Reproduce
- In a trusted project, create
.nanocoder/plugins/legacy.js(CommonJSmodule.exports = {apiVersion: 1, name: 'legacy', hooks: {...}}),legacy-esm.js(ESMexport default {...}) andok.mjs(a valid plugin). - Run
NANOCODER_LOG_LEVEL=debug nanocoder --trust-directory run "Reply with the single word OK". - Search stderr, stdout and the log folder for
legacy. - Run
/doctor.
Expected Behavior
Plugin legacy.js ignored: plugins must use the .mjs extension, and /doctor lists the loaded plugins (name, file, hooks).
Actual Behavior
ok.mjs loads (its marker file is created). legacy.js and legacy-esm.js do not appear anywhere, not even in the debug log. The /doctor report has these sections only: system, nanocoder, providers, lsp, mcp, hooks, formatters, daemon. Two tests for this fail today (a warning about legacy.js, and report.plugins).
Suggested Fix
source/plugins/host.ts:120: when a file in the plugins folder is not.mjs(ignore directories and dotfiles), calllogWarningwith the text above.- Add a Plugins section to
source/commands/doctor.tsx(name, file, hooks). - Optionally show a plugin count in the startup status.
Additional Context
- Plugins came from #1568. Related: #1652 / open PR #1665 (plugin load errors are hidden in
runmode). - [x] I have searched existing issues to ensure this is not a duplicate
- [x] I can reproduce this issue consistently
- [x] This issue occurs with the latest version of nanocoder
I'd like to work on this. I'll add the warning for unsupported plugin files and list the loaded plugins in /doctor, with tests for both.