| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
This PR fixes a UTF-8 boundary bug in the .NET HeadTailBuffer used for bounded stdout/stderr capture, ensuring multi-byte runes are never reordered or silently dropped at the head/tail boundary and that truncation reporting matches actual byte loss.
Changes:
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| dotnet/src/Microsoft.Agents.AI.Tools.Shell/HeadTailBuffer.cs | Updates head/tail append and eviction logic to preserve UTF-8 rune order and correct truncation behavior. |
| dotnet/tests/Microsoft.Agents.AI.Tools.Shell.UnitTests/HeadTailBufferTests.cs | Adds regression tests for exact-cap and overflow cases involving 4-byte UTF-8 runes. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Motivation & Context
HeadTailBuffer can silently drop and reorder multi-byte UTF-8 output when a complete rune no longer fits the remaining head bytes but later smaller runes still do. At the exact overall byte cap, the previous logic could evict a tail rune and still report that the output was not truncated. This affects the bounded stdout and stderr capture shared by the local and Docker shell executors.
Description & Review Guide
Related Issue
Fixes #7112
Contribution Checklist