(entry map[string]any, run WorkflowRun, verbose bool, experimentName, variant string, mcpFailures *[]MCPFailureReport)
| 762 | } |
| 763 | |
| 764 | func processMCPFailureEntry(entry map[string]any, run WorkflowRun, verbose bool, experimentName, variant string, mcpFailures *[]MCPFailureReport) { |
| 765 | entryType, ok := typeutil.LookupString(entry, "type") |
| 766 | if !ok || entryType != "system" { |
| 767 | return |
| 768 | } |
| 769 | |
| 770 | subtype, ok := typeutil.LookupString(entry, "subtype") |
| 771 | if !ok || subtype != "init" { |
| 772 | return |
| 773 | } |
| 774 | |
| 775 | mcpServers, ok := entry["mcp_servers"].([]any) |
| 776 | if !ok { |
| 777 | return |
| 778 | } |
| 779 | |
| 780 | timestamp, _ := typeutil.LookupString(entry, "timestamp") // Optional field, ignore if missing. |
| 781 | |
| 782 | for _, serverInterface := range mcpServers { |
| 783 | server, ok := serverInterface.(map[string]any) |
| 784 | if !ok { |
| 785 | continue |
| 786 | } |
| 787 | |
| 788 | serverName, hasName := typeutil.LookupString(server, "name") |
| 789 | status, hasStatus := typeutil.LookupString(server, "status") |
| 790 | if !hasName || !hasStatus || status != "failed" { |
| 791 | continue |
| 792 | } |
| 793 | |
| 794 | failure := MCPFailureReport{ |
| 795 | ServerName: serverName, |
| 796 | Status: status, |
| 797 | ReportProvenance: buildReportProvenance(run, timestamp, experimentName, variant), |
| 798 | } |
| 799 | |
| 800 | *mcpFailures = append(*mcpFailures, failure) |
| 801 | |
| 802 | if verbose { |
| 803 | fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("Found MCP server failure: %s (status: %s)", serverName, status))) |
| 804 | } |
| 805 | } |
| 806 | } |
no test coverage detected