Repository navigation
Skip plugin hook and vendor dirs when loading local agents - #1553
yablokolabs wants to merge 2 commits into
Conversation
loadLocalAgents imports every executable file under .agents as an agent. A plugin installed under .agents/vendor has hook scripts such as hooks/ponytail-subagent.js; importing that hook runs its top-level code, and ponytail calls process.exit(0), so the CLI exits before the TUI. Skip hooks/ and vendor/ directories in listLocalAgentFiles, which also keeps the CLI trust gate consistent. Add regression coverage for both layouts and update the loader docs/changelog.
|
Verification on
Manual loader check against the real ponytail plugin installed under The hook was not imported and the process did not exit. |
|
Good find and a clean fix. The regression tests are solid - both the One thing worth flagging for the maintainers porting this: hardcoding Overall this is a focused, well-tested fix for a real startup-crash bug with a clear root cause - good first PR. |
…names A directory named vendor holding the user's own agents is now skipped, with no message. Naming that in the loader docs is cheaper than an ignore file and stops the silent loss from reading as a bug. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
Added the collision note as 9c480ab. I checked the rest of the port at c836ff5 as well:
No other changes to the skip list. |
Summary
loadLocalAgents/listLocalAgentFilesnow skiphooks/andvendor/directories under.agents, so plugin support scripts are not imported as agent definitions.hooks/ponytail-subagent.jsran on import and calledprocess.exit(0), exiting Freebuff before the TUI.Why
A third-party plugin installed at
~/.agents/vendor/ponytailcontainshooks/ponytail-subagent.js, which is executable support code, not an agent. The recursive loader imported it, ran its top-level code, and the hook'sprocess.exit(0)killed the CLI with status 0. The CLI trust inventory uses the same file list, so skipping these support directories keeps the trust prompt consistent.Refs #1009 (closed duplicate; this is the underlying bug).
Test Plan
cd sdk && bun test src/__tests__/load-agents.test.ts— 39 pass, 0 failcd sdk && bun run test— 1039 pass, 43 skip, 0 fail.agents/vendorloads 0 agents and does not exitNotes
cd sdk && bun run typecheckis currently red on untouched AI SDKproviderOptionserrors (common/src/util/messages.ts,packages/agent-runtime,sdk/src/impl/llm.ts); the changed files are not in the error list.