nanocoder icon indicating copy to clipboard operation
nanocoder copied to clipboard

[Bug] Built-in sub-agent explore doesn't work

Open bfoz opened this issue 2 months ago • 7 comments

Description

When a model tries to use the explore sub-agent, the console shows the error Subagent 'explore' not found.

The problem appears to be that explore.md isn't being packaged, and therefore isn't installed. I'm not an npm expert, but it seems like adding source/subagents/built-in/ to the files array in package.json would fix the problem.

I confirmed that the file doesn't exist on my system. Adding the file to nanocoder/agents causes the agent to appear in /agents list when it didn't before.

Environment

  • OS: macOS 27
  • Node version: v26.8.1
  • Nanocoder version: 1.30.0 (installed via Homebrew)
  • Provider: Lemonade 11.9.0 on Ubuntu
  • Model: Qwen3.8-Flash-Next-GGUF-UD-IQ4_XS

Steps to Reproduce

  1. Load a model and give it a prompt that uses the explore agent. Something like "explore the project directory" should work.
  2. See the error

Logs/Screenshots

(base) 13:54 bfoz@mini:~% find $(brew --cellar)/nanocoder -name "*.md" | grep -i agent
/opt/homebrew/Cellar/nanocoder/1.30.0/libexec/lib/node_modules/@nanocollective/nanocoder/source/app/prompts/sections/subagents.md
/opt/homebrew/Cellar/nanocoder/1.30.0/libexec/lib/node_modules/@nanocollective/nanocoder/node_modules/@ai-sdk/provider-utils/node_modules/undici/docs/docs/api/Agent.md
/opt/homebrew/Cellar/nanocoder/1.30.0/libexec/lib/node_modules/@nanocollective/nanocoder/node_modules/@ai-sdk/provider-utils/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md
/opt/homebrew/Cellar/nanocoder/1.30.0/libexec/lib/node_modules/@nanocollective/nanocoder/node_modules/@ai-sdk/provider-utils/node_modules/undici/docs/docs/api/ProxyAgent.md
/opt/homebrew/Cellar/nanocoder/1.30.0/libexec/lib/node_modules/@nanocollective/nanocoder/node_modules/@ai-sdk/provider-utils/node_modules/undici/docs/docs/api/MockAgent.md
/opt/homebrew/Cellar/nanocoder/1.30.0/libexec/lib/node_modules/@nanocollective/nanocoder/node_modules/@ai-sdk/provider-utils/node_modules/undici/docs/docs/api/RetryAgent.md
/opt/homebrew/Cellar/nanocoder/1.30.0/libexec/lib/node_modules/@nanocollective/nanocoder/node_modules/undici/docs/docs/api/Agent.md
/opt/homebrew/Cellar/nanocoder/1.30.0/libexec/lib/node_modules/@nanocollective/nanocoder/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md
/opt/homebrew/Cellar/nanocoder/1.30.0/libexec/lib/node_modules/@nanocollective/nanocoder/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md
/opt/homebrew/Cellar/nanocoder/1.30.0/libexec/lib/node_modules/@nanocollective/nanocoder/node_modules/undici/docs/docs/api/ProxyAgent.md
/opt/homebrew/Cellar/nanocoder/1.30.0/libexec/lib/node_modules/@nanocollective/nanocoder/node_modules/undici/docs/docs/api/SnapshotAgent.md
/opt/homebrew/Cellar/nanocoder/1.30.0/libexec/lib/node_modules/@nanocollective/nanocoder/node_modules/undici/docs/docs/api/MockAgent.md
/opt/homebrew/Cellar/nanocoder/1.30.0/libexec/lib/node_modules/@nanocollective/nanocoder/node_modules/undici/docs/docs/api/RetryAgent.md
/opt/homebrew/Cellar/nanocoder/1.30.0/libexec/lib/node_modules/@nanocollective/nanocoder/node_modules/@agentclientprotocol/sdk/README.md
/opt/homebrew/Cellar/nanocoder/1.30.0/libexec/lib/node_modules/@nanocollective/nanocoder/node_modules/cheerio/node_modules/undici/docs/docs/api/Agent.md
/opt/homebrew/Cellar/nanocoder/1.30.0/libexec/lib/node_modules/@nanocollective/nanocoder/node_modules/cheerio/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md
/opt/homebrew/Cellar/nanocoder/1.30.0/libexec/lib/node_modules/@nanocollective/nanocoder/node_modules/cheerio/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md
/opt/homebrew/Cellar/nanocoder/1.30.0/libexec/lib/node_modules/@nanocollective/nanocoder/node_modules/cheerio/node_modules/undici/docs/docs/api/ProxyAgent.md
/opt/homebrew/Cellar/nanocoder/1.30.0/libexec/lib/node_modules/@nanocollective/nanocoder/node_modules/cheerio/node_modules/undici/docs/docs/api/SnapshotAgent.md
/opt/homebrew/Cellar/nanocoder/1.30.0/libexec/lib/node_modules/@nanocollective/nanocoder/node_modules/cheerio/node_modules/undici/docs/docs/api/MockAgent.md
/opt/homebrew/Cellar/nanocoder/1.30.0/libexec/lib/node_modules/@nanocollective/nanocoder/node_modules/cheerio/node_modules/undici/docs/docs/api/RetryAgent.md
(base) 13:55 bfoz@mini:~% find $(brew --cellar)/nanocoder -name "explore*"
/opt/homebrew/Cellar/nanocoder/1.30.0/libexec/lib/node_modules/@nanocollective/nanocoder/dist/commands/explorer.js.map
/opt/homebrew/Cellar/nanocoder/1.30.0/libexec/lib/node_modules/@nanocollective/nanocoder/dist/commands/explorer.d.ts.map
/opt/homebrew/Cellar/nanocoder/1.30.0/libexec/lib/node_modules/@nanocollective/nanocoder/dist/commands/explorer.d.ts
/opt/homebrew/Cellar/nanocoder/1.30.0/libexec/lib/node_modules/@nanocollective/nanocoder/dist/commands/explorer.js

Workaround

Manually adding explore.md seems to work (on a Mac).

curl -o ~/Library/Preferences/nanocoder/agents/explore.md  https://raw.githubusercontent.com/Nano-Collective/nanocoder/main/source/subagents/built-in/explore.md

bfoz avatar Sep 15 '26 21:09 bfoz

I can confirm I'm also missing the explore.md sub-agent file on macOS with the same versions.

I'm not sure if this is also an issue but I don't have the ~/Library/Preferences/nanocoder/agents/ folder already created.

% ls -lah ~/Library/Preferences/nanocoder/
total 456
drwxr-xr-x@   5 user  staff   160B Sep 16 17:14 .
drwx------+ 398 user  staff    12K Sep 16 18:33 ..
-rw-r--r--@   1 user  staff   216K Sep 16 18:29 .nano-coder-history
-rw-r--r--@   1 user  staff   501B Sep 16 17:14 agents.config.json
-rw-r--r--@   1 user  staff   806B Sep 16 18:27 nanocoder-preferences.json

LukeShortCloud avatar Sep 17 '26 00:09 LukeShortCloud

Confirmed, diagnosis in the report is right.

source/subagents/built-in/ isn't in the files array in package.json, so explore.md never ships. getBuiltInAgentsDir() resolves to ../../source/subagents/built-in from dist/, which silently resolves to nothing on a real install — hence Subagent 'explore' not found with no other signal.

Plan:

  1. Copy built-in agent .md files into dist/subagents/built-in/ at build time (same pattern as contributors.json), so the dist path is the real one.
  2. Harden the resolver, warn instead of failing silently when the dir is missing.
  3. Tests: resolver unit test + a packaging test asserting explore.md is in the pnpm pack output, so this can't regress.
  4. Verify end to end from the packed tarball in a clean install.

Happy to take this one.. @akramcodez, can you assign it to me? 🙏

addyCooks avatar Sep 18 '26 18:09 addyCooks

Picking this up - a fix will follow shortly.

awhite0030 avatar Sep 19 '26 22:09 awhite0030

It looks like this is fixed on main: source/subagents/built-in is now in the files array in package.json, so explore.md should ship in the next release. Can this be closed once that release is out?

iakshkhurana avatar Oct 01 '26 18:10 iakshkhurana

sure @addyCooks go for it 👍

akramcodez avatar Oct 02 '26 08:10 akramcodez

When I upgraded to 1.31.0, I got a warning message about the included explore.md conflicting with the copy I had put in nanocoder/agents. I removed the copy and the sub-agent still works. So it looks to me like the fix has shipped.

bfoz avatar Oct 02 '26 17:10 bfoz

Fixed in 40020735: built-in subagents are now included in the published package. Confirmed working on 1.31.0.

Closing as part of a backlog tidy-up. Reopen it if anything here is still broken.

will-lamerton avatar Oct 07 '26 10:10 will-lamerton