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
@@ -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())
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user