fix(call-omo-agent): address cubic review findings and add requirement-based tests

- Fix agent-resolver.ts: add defensive validation on agent name (typeof, trim, filter)
- Fix tools.test.ts: correct mock to return {data: agents} matching SDK contract
- Fix agent-config-handler.ts: include opencode global/project agents in customAgentSummaries
- Add agent-resolver.test.ts: 14 requirement-based tests covering R1-R7 behavioral specs
- Add tools-edge-cases.test.ts: 5 integration tests for rollback, whitespace, dedup, session_id
This commit is contained in:
Brandon Webb
2026-03-26 10:31:57 -04:00
committed by YeonGyu-Kim
parent 76c5356a80
commit da91c53536
5 changed files with 465 additions and 6 deletions
+4 -3
View File
@@ -96,6 +96,8 @@ export async function applyAgentConfig(params: {
const includeClaudeAgents = params.pluginConfig.claude_code?.agents ?? true;
const userAgents = includeClaudeAgents ? loadUserAgents() : {};
const projectAgents = includeClaudeAgents ? loadProjectAgents(params.ctx.directory) : {};
const opencodeGlobalAgents = loadOpencodeGlobalAgents();
const opencodeProjectAgents = loadOpencodeProjectAgents(params.ctx.directory);
const rawPluginAgents = params.pluginComponents.agents;
const pluginAgents = Object.fromEntries(
@@ -113,6 +115,8 @@ export async function applyAgentConfig(params: {
...Object.entries(configAgent ?? {}),
...Object.entries(userAgents),
...Object.entries(projectAgents),
...Object.entries(opencodeGlobalAgents),
...Object.entries(opencodeProjectAgents),
...Object.entries(pluginAgents).filter(([, config]) => config !== undefined),
]
.filter(([, config]) => config != null)
@@ -139,9 +143,6 @@ export async function applyAgentConfig(params: {
disableOmoEnv,
);
const opencodeGlobalAgents = loadOpencodeGlobalAgents();
const opencodeProjectAgents = loadOpencodeProjectAgents(params.ctx.directory);
const disabledAgentNames = new Set(
(migratedDisabledAgents ?? []).map(a => a.toLowerCase())
);