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:
committed by
YeonGyu-Kim
parent
76c5356a80
commit
da91c53536
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user