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
+2 -2
View File
@@ -29,8 +29,8 @@ export async function resolveCallableAgents(
});
const dynamicAgents = agents
.filter((a) => a.mode !== "primary")
.map((a) => a.name.toLowerCase());
.filter((a) => a && typeof a.name === "string" && a.name.trim().length > 0 && a.mode !== "primary")
.map((a) => a.name.trim().toLowerCase());
const merged = new Set([...ALLOWED_AGENTS, ...dynamicAgents]);
return [...merged];