Skip to content

Clean up the FeedbackClassifierService + CustomizedCodeUpdateTool#14794

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/review-unresolved-conversations-13642
Draft

Clean up the FeedbackClassifierService + CustomizedCodeUpdateTool#14794
Copilot wants to merge 2 commits intomainfrom
copilot/review-unresolved-conversations-13642

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 27, 2026

Summary

Implements changes from the unresolved review conversations on PR #13642 plus a new bug fix.

Changes

Item 1 — FeedbackClassificationTemplate: language is now required

  • private readonly string? _languageprivate readonly string _language
  • Constructor parameter string? languagestring language
  • _language ?? "N/A"_language in the prompt (no null-coalescing needed)
  • FeedbackClassifierService.BatchClassifyAsync passes language ?? string.Empty to satisfy the non-null requirement

Item 5 — Remove plainTextFeedbackFile parameter

  • CustomizedCodeUpdateTool.GetFeedbackItems accepted a plainTextFeedbackFile path that read from disk. That parameter and its file-reading code are removed; only the plain text string is supported.

Item 6 — Move feedback gathering into FeedbackClassifierService

  • Added IAPIViewFeedbackService injection to FeedbackClassifierService
  • Added private GatherFeedbackItemsAsync(string? apiViewUrl, string? plainTextFeedback, ct) preprocess method (the gathering logic moved from the tool)
  • The gathering step is folded directly into ClassifyItemsAsync via two new optional parameters apiViewUrl and plainTextFeedback — no separate method needed. When the passed items list is empty and either source param is set, items are gathered first (mutating the caller's list) before classification proceeds.
  • CustomizedCodeUpdateTool.RunUpdateAsync now calls _classifierService.ClassifyItemsAsync for the first pass with an empty list and the source params (passing language from the resolved languageService), and removes the old GetFeedbackItems method entirely
  • Second-pass ClassifyItemsAsync call also now passes language

New — Detect already-applied TSP customizations

Fixes a bug where requesting a change that was already applied (e.g. running the same customization twice) returned TSP_APPLICABLE instead of SUCCESS.

Updated FeedbackClassificationTemplate prompt in three places:

  1. Task instructions: Added an explicit instruction to use grep_search/read_file tools to check TypeSpec files for the requested decorator before classifying as TSP_APPLICABLE
  2. Decision logic: Added a sub-step under "actionable items" to check files first; if already present → SUCCESS
  3. Non-actionable list: Added "Already applied in TypeSpec" as a SUCCESS condition

Tests

  • FeedbackClassifierServiceTests: added Mock<IAPIViewFeedbackService> field; passed to CreateMockedService() and CreateRealService() constructors
  • CustomizedCodeUpdateToolTests: unified single ClassifyItemsAsync mock handles both passes (items.Count == 0 for first pass, items.Count > 0 for second pass); updated all configureClassifier overrides across tests accordingly

Security Summary

No security vulnerabilities introduced or discovered. CodeQL skipped (database too large).

Copilot AI requested a review from swathipil March 27, 2026 23:22
@swathipil swathipil changed the title Address PR #13642 review items: language required, remove file param, move feedback gathering to service, detect already-applied TSP changes Clean up the FeedbackClassifierService + CustomizedCodeUpdateTool Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants