Skip to content

armgit / ECC

Public Imported from GitHub
0

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

test(opencode): require non-empty agent catalog

dajiaohuang1b212b2e9a85
diff --git a/tests/opencode-config.test.js b/tests/opencode-config.test.js
index 3669870d1..6fa7f9a00 100644
--- a/tests/opencode-config.test.js
+++ b/tests/opencode-config.test.js
@@ -33,7 +33,15 @@ if (
assert.ok(!Object.hasOwn(config, 'model'), 'Root config must not pin a provider-specific model');
assert.ok(!Object.hasOwn(config, 'small_model'), 'Root config must not pin a provider-specific small model');
- for (const [agentId, agent] of Object.entries(config.agent || {})) {
+ assert.ok(
+ config.agent &&
+ typeof config.agent === 'object' &&
+ !Array.isArray(config.agent) &&
+ Object.keys(config.agent).length > 0,
+ 'Reference config must define registered agents'
+ );
+
+ for (const [agentId, agent] of Object.entries(config.agent)) {
assert.ok(!Object.hasOwn(agent, 'model'), `Agent "${agentId}" must inherit the selected OpenCode model`);
}
})