Azure / Azure/azure-sdk-tools

DelegateAPIViewFeedbackTool: Issue body truncation when feedback has ML-unsafe characters

Open
#14,574 0 comments 0 reactions 1 assignee Assigned to @samvaity View on GitHub
Dominant language
C#
Stars
135
Forks
260
Avg merge
3d 1h
Merged PRs (30d)
143

Description

## Summary

The `DelegateAPIViewFeedbackTool` has a bug triggered when API review comments contain generic type signatures (e.g. `Mono`, `List`).

**Original issue where this was observed:** https://github.com/Azure/azure-rest-api-specs/issues/41536

---

## Bug — Issue body is silently truncated mid-table

### Root Cause

The tool generates a Markdown table of feedback comments. When a table cell contains an unescaped `<` character (e.g. `public Mono createOrUpdateTextBlocklist(...)`), the agent framework that processes the issue body interprets `` as an opening XML tag. It then misidentifies the next `` sequence it encounters (e.g. `` in the system prompt) as the closing tag, and everything after it is silently dropped.

### Impact

- Comments that appear after a row containing a generic type are never seen by the Copilot coding agent.
- The agent acts on an incomplete set of feedback without any warning.

### Repro

Add an APIView comment containing a Java/C# generic return type like:
`@Generated public Mono createOrUpdateTextBlocklist(...)`

The row containing that comment and all subsequent rows in the feedback table will be missing from the delegated issue.

---

## Proposed Fixes

Before inserting any user-supplied text (line text, comment text, code snippets) into a Markdown table cell, replace:
- `<` → `<`
- `>` → `>`

This prevents the agent framework's XML parser from misinterpreting generic type signatures.

---

## Additional Notes

- The escaping fix should be applied to all free-text columns in the feedback table (comment body, line text, suggested fix).
- Consider adding a server-side test that generates an issue body containing `` generic tokens and asserts the full body is preserved.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.