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: 4 additions & 0 deletions pkg/cli/add_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ func AddResolvedWorkflows(workflowStrings []string, resolved *ResolvedWorkflows,

// addWorkflows handles workflow addition using pre-fetched content
func addWorkflows(workflows []*ResolvedWorkflow, opts AddOptions) error {
addLog.Printf("Adding %d workflow(s) to repository", len(workflows))
// Create file tracker for all operations
tracker, err := NewFileTracker()
if err != nil {
Expand All @@ -242,6 +243,7 @@ func addWorkflows(workflows []*ResolvedWorkflow, opts AddOptions) error {

// addWorkflows handles workflow addition using pre-fetched content
func addWorkflowsWithTracking(workflows []*ResolvedWorkflow, tracker *FileTracker, opts AddOptions) error {
addLog.Printf("Adding %d workflow(s) with tracking: force=%v, disableSecurityScanner=%v", len(workflows), opts.Force, opts.DisableSecurityScanner)
// Ensure .gitattributes is configured unless flag is set
if !opts.NoGitattributes {
addLog.Print("Configuring .gitattributes")
Expand Down Expand Up @@ -284,6 +286,8 @@ func addWorkflowWithTracking(resolved *ResolvedWorkflow, tracker *FileTracker, o
sourceContent := resolved.Content
sourceInfo := resolved.SourceInfo

addLog.Printf("Adding workflow: name=%s, content_size=%d bytes", workflowSpec.WorkflowName, len(sourceContent))

if opts.Verbose {
fmt.Fprintln(os.Stderr, console.FormatInfoMessage("Adding workflow: "+workflowSpec.String()))
if opts.Force {
Expand Down
4 changes: 4 additions & 0 deletions pkg/cli/logs_report.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ func isValidToolName(toolName string) bool {
// buildToolUsageSummary aggregates tool usage across all runs
// Filters out invalid tool names that appear to be fragments or garbage
func buildToolUsageSummary(processedRuns []ProcessedRun) []ToolUsageSummary {
reportLog.Printf("Building tool usage summary from %d processed runs", len(processedRuns))
toolStats := make(map[string]*ToolUsageSummary)

for _, pr := range processedRuns {
Expand Down Expand Up @@ -419,6 +420,7 @@ func aggregateSummaryItems[TItem any, TSummary any](

// buildMissingToolsSummary aggregates missing tools across all runs
func buildMissingToolsSummary(processedRuns []ProcessedRun) []MissingToolSummary {
reportLog.Printf("Building missing tools summary from %d processed runs", len(processedRuns))
result := aggregateSummaryItems(
processedRuns,
// getItems: extract missing tools from each run
Expand Down Expand Up @@ -462,6 +464,7 @@ func buildMissingToolsSummary(processedRuns []ProcessedRun) []MissingToolSummary

// buildMissingDataSummary aggregates missing data across all runs
func buildMissingDataSummary(processedRuns []ProcessedRun) []MissingDataSummary {
reportLog.Printf("Building missing data summary from %d processed runs", len(processedRuns))
result := aggregateSummaryItems(
processedRuns,
// getItems: extract missing data from each run
Expand Down Expand Up @@ -505,6 +508,7 @@ func buildMissingDataSummary(processedRuns []ProcessedRun) []MissingDataSummary

// buildMCPFailuresSummary aggregates MCP failures across all runs
func buildMCPFailuresSummary(processedRuns []ProcessedRun) []MCPFailureSummary {
reportLog.Printf("Building MCP failures summary from %d processed runs", len(processedRuns))
result := aggregateSummaryItems(
processedRuns,
// getItems: extract MCP failures from each run
Expand Down
3 changes: 3 additions & 0 deletions pkg/cli/mcp_inspect_mcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ func buildConnectionString(config parser.MCPServerConfig) string {

// connectToMCPServer establishes a connection to the MCP server and queries its capabilities
func connectToMCPServer(config parser.MCPServerConfig, verbose bool) (*parser.MCPServerInfo, error) {
mcpInspectServerLog.Printf("Connecting to MCP server: name=%s, type=%s", config.Name, config.Type)
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()

Expand All @@ -129,6 +130,7 @@ func connectToMCPServer(config parser.MCPServerConfig, verbose bool) (*parser.MC

// connectStdioMCPServer connects to a stdio-based MCP server using the Go SDK
func connectStdioMCPServer(ctx context.Context, config parser.MCPServerConfig, verbose bool) (*parser.MCPServerInfo, error) {
mcpInspectServerLog.Printf("Connecting to stdio MCP server: command=%s, args=%d", config.Command, len(config.Args))
if verbose {
fmt.Fprintln(os.Stderr, console.FormatInfoMessage(fmt.Sprintf("Starting stdio MCP server: %s %s", config.Command, strings.Join(config.Args, " "))))
}
Expand Down Expand Up @@ -340,6 +342,7 @@ func extractRootsFromResources(resources []*mcp.Resource) []*mcp.Root {

// displayServerCapabilities shows the server's tools, resources, and roots in formatted tables
func displayServerCapabilities(info *parser.MCPServerInfo, toolFilter string) {
mcpInspectServerLog.Printf("Displaying server capabilities: tools=%d, resources=%d, toolFilter=%q", len(info.Tools), len(info.Resources), toolFilter)
// Display tools with allowed/not allowed status
if len(info.Tools) > 0 {
// If a specific tool is requested, show detailed information
Expand Down
3 changes: 3 additions & 0 deletions pkg/workflow/expression_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ func (p *ExpressionParser) advance() {
// for each ExpressionNode (literal expression) found in the tree
func VisitExpressionTree(node ConditionNode, visitor func(expr *ExpressionNode) error) error {
if node == nil {
expressionsLog.Print("VisitExpressionTree called with nil node")
return nil
}

Expand Down Expand Up @@ -410,6 +411,8 @@ func BreakAtParentheses(expression string) []string {
return []string{expression}
}

expressionsLog.Printf("Breaking expression at parentheses: length=%d", len(expression))

var lines []string
var current strings.Builder
parenDepth := 0
Expand Down
7 changes: 7 additions & 0 deletions pkg/workflow/tools_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,16 +257,19 @@ func parseBashTool(val any) *BashToolConfig {
if val == nil {
// nil is no longer supported - return nil to indicate invalid configuration
// The compiler will handle this as a validation error
toolsParserLog.Print("Bash tool configured with nil value (unsupported)")
return nil
}

// Handle boolean values
if boolVal, ok := val.(bool); ok {
if boolVal {
// bash: true means all commands allowed
toolsParserLog.Print("Bash tool enabled with all commands allowed")
return &BashToolConfig{}
}
// bash: false means explicitly disabled
toolsParserLog.Print("Bash tool explicitly disabled")
return &BashToolConfig{
AllowedCommands: []string{}, // Empty slice indicates explicitly disabled
}
Expand All @@ -292,8 +295,10 @@ func parseBashTool(val any) *BashToolConfig {
// parsePlaywrightTool converts raw playwright tool configuration to PlaywrightToolConfig
func parsePlaywrightTool(val any) *PlaywrightToolConfig {
if val == nil {
toolsParserLog.Print("Playwright tool enabled with default configuration")
return &PlaywrightToolConfig{}
}
toolsParserLog.Print("Parsing playwright tool configuration")

if configMap, ok := val.(map[string]any); ok {
config := &PlaywrightToolConfig{}
Expand Down Expand Up @@ -332,11 +337,13 @@ func parsePlaywrightTool(val any) *PlaywrightToolConfig {
// parseSerenaTool converts raw serena tool configuration to SerenaToolConfig
func parseSerenaTool(val any) *SerenaToolConfig {
if val == nil {
toolsParserLog.Print("Serena tool enabled with default configuration")
return &SerenaToolConfig{}
}

// Handle array format (short syntax): ["go", "typescript"]
if langArray, ok := val.([]any); ok {
toolsParserLog.Printf("Parsing Serena tool with short-syntax language list: %d languages", len(langArray))
config := &SerenaToolConfig{
ShortSyntax: make([]string, 0, len(langArray)),
}
Expand Down