Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions pkg/parser/include_expander.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,6 @@ func expandIncludesForField(content, baseDir string, extractFunc func(string) (s
return results, nil
}

// ProcessIncludesForEngines processes import directives to extract engine configurations

// ProcessIncludesForSafeOutputs processes import directives to extract safe-outputs configurations

// processIncludesForField processes import directives to extract a specific frontmatter field
func processIncludesForField(content, baseDir string, extractFunc func(string) (string, error), emptyValue string) ([]string, string, error) {
scanner := bufio.NewScanner(strings.NewReader(content))
Expand Down
3 changes: 0 additions & 3 deletions pkg/parser/include_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ import (

var includeLog = logger.New("parser:include_processor")

// ProcessIncludes processes @include, @import (deprecated), and {{#import: directives in markdown content
// This matches the bash process_includes function behavior

// processIncludesWithVisited processes import directives with cycle detection
func processIncludesWithVisited(content, baseDir string, extractTools bool, visited map[string]bool) (string, error) {
scanner := bufio.NewScanner(strings.NewReader(content))
Expand Down
34 changes: 14 additions & 20 deletions pkg/workflow/compiler_orchestrator_tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ func (c *Compiler) processToolsAndMarkdown(result *parser.FrontmatterResult, cle
}

// Combine imported tools with included tools
var allIncludedTools string
if importsResult.MergedTools != "" && includedTools != "" {
allIncludedTools = importsResult.MergedTools + "\n" + includedTools
} else if importsResult.MergedTools != "" {
allIncludedTools = importsResult.MergedTools
} else {
allIncludedTools = includedTools
var toolsParts []string
if importsResult.MergedTools != "" {
toolsParts = append(toolsParts, importsResult.MergedTools)
}
if includedTools != "" {
toolsParts = append(toolsParts, includedTools)
}
allIncludedTools := strings.Join(toolsParts, "\n")

// Combine imported mcp-servers with top-level mcp-servers
// Imported mcp-servers are in JSON format (newline-separated), need to merge them
Expand All @@ -122,19 +122,13 @@ func (c *Compiler) processToolsAndMarkdown(result *parser.FrontmatterResult, cle
}

// Check if GitHub tool was explicitly configured in the original frontmatter
// This is needed to determine if permissions validation should be skipped
hasExplicitGitHubTool := false
if tools != nil {
if _, exists := tools["github"]; exists {
// GitHub tool exists in merged tools - check if it was explicitly configured
// by looking at the original frontmatter before any merging
if topTools != nil {
if _, existsInTop := topTools["github"]; existsInTop {
hasExplicitGitHubTool = true
orchestratorToolsLog.Print("GitHub tool was explicitly configured in frontmatter")
}
}
}
// This is needed to determine if permissions validation should be skipped.
// In Go, reading from a nil map returns zero-value, so these are nil-safe.
_, inMergedTools := tools["github"]
_, inTopTools := topTools["github"]
hasExplicitGitHubTool := inMergedTools && inTopTools
if hasExplicitGitHubTool {
orchestratorToolsLog.Print("GitHub tool was explicitly configured in frontmatter")
}
orchestratorToolsLog.Printf("hasExplicitGitHubTool: %v", hasExplicitGitHubTool)

Expand Down
Loading