fix(tests): skip the inert OpenCode stub when loading plugin factories

This commit is contained in:
Ali Arslan committed 2026-10-28 22:50:14 +05:00
1 parent 6b11ffeb7d
commit 4ebe4c8bc3
1 file changed
+2 -1
@@ -40,7 +40,8 @@ try {
const loaded = [];
for (const name of fs.readdirSync(path.join(root, 'plugins')).filter(name => /\\.ts$/.test(name))) {
const mod = await import(pathToFileURL(path.join(root, 'plugins', name)).href);
for (const entry of new Set(Object.values(mod))) loaded.push(await entry(context));
// The inert stub is a V2 definition object, not a factory: it registers no hooks.
for (const entry of new Set(Object.values(mod))) loaded.push(typeof entry === 'function' ? await entry(context) : {});
}
const live = loaded.filter(hooks => typeof hooks['tool.execute.after'] === 'function');
assert.equal(live.length, 1, 'Local discovery must register exactly one live ECC plugin');