Skip to content

Author a purpose-built auto-build-repair skill for the cloud-agent repair flow #59697

@JoshLove-msft

Description

@JoshLove-msft

Context

Part of the epic #59658 — Auto-repair custom-code build failures in generated SDK PRs using the Generator Agent. Refines/amends #59653, which currently says to make the existing dpg-migration / mpg-migration skills available to the cloud agent.

Problem

The dpg-migration / mpg-migration skills are built for a full Swagger→TypeSpec migration, not for repairing an already-generated SDK PR. Reusing them in the cloud-agent repair flow is a poor fit and partly a failure mode:

  • Requires a spec repo and prompts the user for itdpg-migration states localSpecsPath is "always required" and instructs the agent to ask the user for it. The cloud agent runs non-interactively in an ephemeral env with no spec checkout; this is an immediate blocker.
  • Generation-mode + spec-edit logic (remote/local mode, client.tsp/tspconfig.yaml edits, commit_iteration) — irrelevant; the repair flow never edits the spec or regenerates from it.
  • Migration-only phasespregen_cleanup, migrate_test_samples, finalize_migration (runs Export-API.ps1 + Update-Snippets.ps1), generator-bug diagnosis. None belong in a bounded build-repair, and some would produce unwanted diffs.

Pointing the agent at all of this bloats context and invites wrong actions.

Proposal

Author a thin, purpose-built auto-build-repair skill scoped to exactly:

The SDK PR already exists; the build failed because of custom (non-generated) code; patch only custom code until the package builds; never modify Generated/; stop when bounded.

It reuses the same generator-agent MCP tools, but only the build-fix-loop subset:

build_and_classifyclassify_errorsbatch_fix (+ targeted fixers: add_using_directive, nullable_annotation_fix, add_codegen_suppress, rename_codegen_type, fetch_to_fromlro) → rebuild → verify_generated_unchanged.

Plus:

Structural options

  1. Standalone thin skill (recommended for MVP) — small duplication of the build-fix-loop section.
  2. Factor out a shared generator-agent-build-fix core skill that dpg-migration, mpg-migration, and this repair skill all compose (DRY, since both migration skills already embed this loop). Cleaner long-term; treat as Phase 2 hardening.

Sequencing

Author after the feasibility spike #59650 confirms the cloud-agent loop, tool subset, and bounds — so the skill reflects the validated flow rather than assumptions.

Acceptance criteria

--generated by Copilot

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClientThis issue is related to a non-management packageCodeGenIssues that relate to code generation

    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