Skip to content

Guard more effectively against stdout truncation - #1520

Draft
Dom Giandinoto (daamenik) wants to merge 1 commit into
mainfrom
user/dgiandinoto/fix-stdout-potential-truncation
Draft

Dom Giandinoto (daamenik) wants to merge 1 commit into
mainfrom
user/dgiandinoto/fix-stdout-potential-truncation

Conversation

@daamenik

@daamenik Dom Giandinoto (daamenik) commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

📖 Description

Before this PR, we were draining stdout and stderr based on a fixed, short timeout, not based on the continuity of output. This PR adds a mechanism to allow for longer output draining based on if bytes are still coming in through the agent output read, checking for idle pipes periodically over a longer absolute timeout, and stopping before the timeout if no more data is coming through.

🔗 References

🔍 Validation

✅ Checklist

📋 Issue Type

  • Bug fix
  • Feature
  • Task

GitHub Actions runs the PR validation build automatically. The ADO pipeline
(MXC-PR-Build) is the Azure version of the PR pipeline, kept in parity with the GitHub
Actions build; it runs on merge to main, and Microsoft reviewers with write access can trigger it
on a PR with /azp run. See pull request builds.

If the dependency-feed-check check fails on a new dependency, the crate must be added to
the feed before the PR can pass. See pull request builds
for the steps.

Microsoft Reviewers: Open in CodeFlow

Copilot AI balanced review requested due to automatic review settings October 16, 2026 23:13
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
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.

🟡 Changes recommended

Synchronous warning delivery can block indefinitely on full stderr after bounded relay cleanup.

1 open issue
What changed in this PR

This PR reduces output truncation in IsolationSession relayed execution by extending draining while output continues.

Changes:

  • Track relay progress with idle and overall drain limits.
  • Report possible truncation through warnings.
  • Add drain tests and document cancellation limitations.
File Description
src/​mxc-sdk/​src/​core/​mxc_common/​process_util.rs Document cancellation-related data loss.
src/​mxc-sdk/​src/​backends/​isolation_session/​common/​state_aware.rs Forward relayed-execution warnings to stderr and test reporting.
src/​mxc-sdk/​src/​backends/​isolation_session/​common/​pipe_relay.rs Implement progress-aware draining and tests.
src/​mxc-sdk/​src/​backends/​isolation_session/​common/​manager.rs Integrate bounded draining into relay cleanup.
docs/​development/​architecture/​backends/​isolation-session/​state-aware-rust.md Explain drain limits and warning behavior.

Review effort: Balanced

mut stderr: impl Write,
) -> Result<ExecHandle, MxcError> {
for warning in logger.warnings() {
writeln!(stderr, "{warning}").map_err(|error| {

This branch has not been deployed

No deployments
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.

2 participants