fix(agent): filter discovery by spawn permissions
This commit is contained in:
1 parent
96fd887cad
commit
b8f4257cee
7 files changed
+170
-34
No files matched your search
@@ -26,7 +26,7 @@ type ContextBuilder struct {
|
||||
skillsLoader *skills.SkillsLoader
|
||||
memory *MemoryStore
|
||||
splitOnMarker bool
|
||||
agentDiscovery func(workspace string) []AgentDescriptor
|
||||
agentDiscovery func(agentID string) []AgentDescriptor
|
||||
promptRegistry *PromptRegistry
|
||||
|
||||
// Cache for system prompt to avoid rebuilding on every call.
|
||||
@@ -68,13 +68,14 @@ func (cb *ContextBuilder) WithSplitOnMarker(enabled bool) *ContextBuilder {
|
||||
}
|
||||
|
||||
func (cb *ContextBuilder) WithAgentDiscovery(
|
||||
discover func(workspace string) []AgentDescriptor,
|
||||
agentID string,
|
||||
discover func(agentID string) []AgentDescriptor,
|
||||
) *ContextBuilder {
|
||||
cb.agentDiscovery = discover
|
||||
if discover != nil {
|
||||
if err := cb.RegisterPromptContributor(agentDiscoveryPromptContributor{
|
||||
workspace: cb.workspace,
|
||||
discover: discover,
|
||||
agentID: agentID,
|
||||
discover: discover,
|
||||
}); err != nil {
|
||||
logger.WarnCF("agent", "Failed to register agent discovery prompt contributor", map[string]any{
|
||||
"error": err.Error(),
|
||||
|
||||
Reference in new issue
Block a user