Skip to content

Add CS2001 to Infrastructure Error Detection #2840

@nielsbosma

Description

@nielsbosma

Problem

The RepeatedInfrastructureErrorAnalyser in Ivy-Agent does not recognize CS2001 errors as infrastructure errors. In session 9588ed22, the build failed with:

CS2001:0 - Source file 'D:\Repos\_Ivy\Ivy-Framework\src\Ivy.Agent.Filter\bin\Debug\net10.0\Ivy.Agent.Filter.xml' could not be found.

This CS2001 error occurs because Ivy.Agent.Filter.csproj has <GenerateDocumentationFile>true</GenerateDocumentationFile> enabled, causing the build to expect an XML documentation file in the output. During concurrent or partial builds, this file may be missing, triggering the transient CS2001 error. XML documentation is not needed for this filter library.

Because the analyser doesn't classify CS2001 as infrastructure, the agent wastes tokens investigating and retrying instead of aborting early.

The session burned 480K input tokens and $2.48 with 0 files written and 0/7 spec requirements met, all due to infrastructure build failures.

Solution

Part 1: Eliminate the Root Cause (Ivy-Framework)

Disable XML documentation generation for the filter project so the CS2001 error never occurs:

  1. Open src/Ivy.Agent.Filter/Ivy.Agent.Filter.csproj

  2. Remove or set to false the <GenerateDocumentationFile> and the associated <NoWarn>CS1591</NoWarn> (CS1591 suppresses missing-XML-comment warnings, which are no longer relevant):

    Before:

    <NoWarn>CS1591</NoWarn>
    ...
    <GenerateDocumentationFile>true</GenerateDocumentationFile>

    After:

    <GenerateDocumentationFile>false</GenerateDocumentationFile>

Part 2: Add CS2001 to Infrastructure Error Detection (Ivy-Agent - Safety Net)

Even with the root cause fixed, CS2001 can occur in other projects. This requires changes in the Ivy-Agent repository:

  1. In RepeatedInfrastructureErrorAnalyser.cs, add CS2001 to the IsImplicitInfrastructureError() method (around line 79):

    e.ErrorCode == "CS2001" || // Source file not found — transient when referencing missing output files
  2. In BaseDotnetBuilder.cs, add CS2001 detection where infrastructure errors are flagged via buildResult.IsInfrastructureError = true, to ensure the build pipeline also treats CS2001 as retryable.

Notes

  • Part 1 (this repo) fixes the immediate cause
  • Part 2 (Ivy-Agent repo) provides a safety net for CS2001 errors elsewhere
  • A corresponding issue/PR should be created in Ivy-Agent repository for Part 2

Context

Source: D:\Temp\IvyAgentTestManager\2026-03-26\00260-Feature-Request-Tracker\Feature-Request-Tracker\.ivy\
Session: 9588ed22-e7a5-4799-8004-2cea4a122445
Workflow: CreateConnection, GenerateDbConnection

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions