Skip to content

fix: discard workload output after the output cap is hit - #749

Merged
Pedro Henrique Penna (ppenna) merged 2 commits into
microsoft:devfrom
akhil9tiet:fix/737-output-limit-forwarding-gap
Oct 23, 2026
Merged

Pedro Henrique Penna (ppenna) merged 2 commits into
microsoft:devfrom
akhil9tiet:fix/737-output-limit-forwarding-gap

Conversation

@akhil9tiet

Copy link
Copy Markdown
Contributor

Fixes #737.

After the 1 MiB output cap was hit, the agent dropped the triggering chunk but left the leftover room uncounted, so later chunks that fit the room were forwarded — the client received a stream with a silent gap instead of a clean prefix. On the cap hit, both streams are now marked discarding (via the existing Execution::discard API) before the workload is terminated.

Includes a loopback regression test that fails without the fix ("output after a dropped chunk was forwarded") and passes with it. fmt and clippy clean.

Signed-off-by: akhil <akhil9tiet@gmail.com>
Signed-off-by: akhil <akhil9tiet@gmail.com>
Copilot AI balanced review requested due to automatic review settings October 22, 2026 06:57

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.

🟢 Approval recommended

The localized fix uses the existing discard API, includes targeted regression coverage, and has no identified blocking issues.

No open issues 🎉

What changed in this PR

Fixes #737 by stopping all output forwarding once the managed guest agent hits the combined 1 MiB cap, preserving a clean prefix rather than forwarding later chunks after a gap.

Changes:

  • Marks stdout and stderr as discarding before terminating an output-limited workload.
  • Adds a loopback regression test covering buffered output after a dropped chunk and confirming the existing output-limit exit result.
File Description
nvx-rs/​src/​guest/​managed_agent/​loopback.rs Adds regression coverage for output-prefix preservation after the cap is hit.
nvx-rs/​src/​guest/​managed_agent/​exec.rs Discards both streams on a cap hit and updates the forwarding documentation.

Review effort: Balanced

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.

Track guest managed agent bugs: output limit forwards later output after a dropped chunk

3 participants