Skip to content

Fix custom-code repair without local TypeSpec path#16459

Merged
JoshLove-msft merged 2 commits into
Azure:mainfrom
JoshLove-msft:fix/customcode-null-tsp-path
Jul 23, 2026
Merged

Fix custom-code repair without local TypeSpec path#16459
JoshLove-msft merged 2 commits into
Azure:mainfrom
JoshLove-msft:fix/customcode-null-tsp-path

Conversation

@JoshLove-msft

Copy link
Copy Markdown
Member

Summary

  • allow FeedbackClassifierService to classify CustomCode repairs without a local TypeSpec checkout
  • omit spec-repo tools and their prompt instructions when no spec path is available
  • preserve fail-fast validation for SpecInputs and All scopes
  • add regression coverage for the production failure from TEST: validate auto-build-repair workflow azure-sdk-for-net#61234

Fixes #16456.

--generated by Copilot

Make spec-repo guidance and tools optional for CustomCode-only repair while preserving the TypeSpec path requirement for scopes that edit spec inputs.

Fixes Azure#16456.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 018c878c-dc5e-43fa-bccb-31ed333ed489
Copilot AI review requested due to automatic review settings July 22, 2026 22:24
@JoshLove-msft
JoshLove-msft requested a review from a team as a code owner July 22, 2026 22:24
@github-actions github-actions Bot added the azsdk-cli Issues related to Azure/azure-sdk-tools::tools/azsdk-cli label Jul 22, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
64 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a crash in azsdk tsp client customized-update when running CustomCode-only repairs without a local TypeSpec checkout, by making spec-repo inspection optional while preserving fail-fast validation when spec inputs are in scope.

Changes:

  • Allow FeedbackClassifierService to run classification with a null/empty tspProjectPath when editScope=CustomCode, avoiding spec-repo path resolution.
  • Make spec-repo tools + reference-doc prompt sections conditional on whether spec inspection is available.
  • Add regression tests covering the production failure and the new “no spec inspection” prompt behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tools/azsdk-cli/CHANGELOG.md Documents the custom-code-only repair fix.
tools/azsdk-cli/Azure.Sdk.Tools.Cli/Services/FeedbackClassifierService.cs Avoids dereferencing/using spec repo paths when tspProjectPath is omitted and spec inputs aren’t in scope; gates spec tools accordingly.
tools/azsdk-cli/Azure.Sdk.Tools.Cli/Prompts/Templates/FeedbackClassificationTemplate.cs Adds a specInspectionAvailable switch to remove spec-tool and spec-inspection instructions when unavailable.
tools/azsdk-cli/Azure.Sdk.Tools.Cli.Tests/Services/FeedbackClassifierServiceTests.cs Adds regression coverage ensuring CustomCode-only classification doesn’t touch spec repo when tspProjectPath is null, and still fails fast for SpecInputs/All.
tools/azsdk-cli/Azure.Sdk.Tools.Cli.Tests/Prompts/Templates/FeedbackClassificationTemplateTests.cs Adds coverage to ensure spec tools aren’t advertised when spec inspection is unavailable.

Avoid referring to omitted TypeSpec reference documentation when custom-code-only repair runs without spec inspection tools.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 018c878c-dc5e-43fa-bccb-31ed333ed489

@samvaity samvaity left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@JoshLove-msft
JoshLove-msft merged commit bfd053b into Azure:main Jul 23, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

azsdk-cli Issues related to Azure/azure-sdk-tools::tools/azsdk-cli

Projects

None yet

Development

Successfully merging this pull request may close these issues.

customized-update CustomCode scope crashes when tspProjectPath is omitted

3 participants