mirror of
https://mirror.skon.top/github.com/code-yeongyu/oh-my-opencode
synced 2026-04-23 10:39:11 +08:00
fix(agent-restrictions): restore EXPLORATION_AGENT_DENYLIST as default fallback for unknown agents
This commit is contained in:
committed by
YeonGyu-Kim
parent
da91c53536
commit
1e85a88db0
@@ -47,6 +47,8 @@ const AGENT_RESTRICTIONS: Record<string, Record<string, boolean>> = {
|
||||
}
|
||||
|
||||
export function getAgentToolRestrictions(agentName: string): Record<string, boolean> {
|
||||
// Custom/unknown agents get no restrictions (empty object), matching Claude Code's
|
||||
// trust model where project-registered agents retain full tool access including bash.
|
||||
const stripped = stripInvisibleAgentCharacters(agentName)
|
||||
return AGENT_RESTRICTIONS[stripped]
|
||||
?? Object.entries(AGENT_RESTRICTIONS).find(([key]) => key.toLowerCase() === stripped.toLowerCase())?.[1]
|
||||
@@ -54,8 +56,6 @@ export function getAgentToolRestrictions(agentName: string): Record<string, bool
|
||||
}
|
||||
|
||||
export function hasAgentToolRestrictions(agentName: string): boolean {
|
||||
const stripped = stripInvisibleAgentCharacters(agentName)
|
||||
const restrictions = AGENT_RESTRICTIONS[stripped]
|
||||
?? Object.entries(AGENT_RESTRICTIONS).find(([key]) => key.toLowerCase() === stripped.toLowerCase())?.[1]
|
||||
return restrictions !== undefined && Object.keys(restrictions).length > 0
|
||||
const restrictions = getAgentToolRestrictions(agentName)
|
||||
return Object.keys(restrictions).length > 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user