Skip to content

Slai Agent Runtime:Improve Linux PTY output draining for large command logs - #60

Open
Slai.life (huong8373tt-beep) wants to merge 1 commit into
microsoft:mainfrom
huong8373tt-beep:slai-linux-pty-output-drain
Open

Slai.life (huong8373tt-beep) wants to merge 1 commit into
microsoft:mainfrom
huong8373tt-beep:slai-linux-pty-output-drain

Conversation

@huong8373tt-beep

@huong8373tt-beep Slai.life (huong8373tt-beep) commented Oct 14, 2026 •

Copy link
Copy Markdown

Summary

Slai Agent Runtime encountered a performance bottleneck while running Linux container workloads through RepoLaunch: large PTY transcripts were repeatedly reprocessed as each output chunk arrived.

This change makes PTY-output draining incremental:

  • Stop re-normalizing and regex-scanning the full accumulated transcript for every read.
  • Detect the PS1 completion delimiter incrementally, retaining only the suffix needed to handle delimiters split across reads.
  • Parse command metadata once, after the completion delimiter is observed.

Problem

LinuxRuntime._read_raw_output appended each new output chunk and then rescanned the entire transcript. With large build or test logs, this produced quadratic host-side work. The command inside the container could finish successfully while the evaluator was still processing terminal output and had not yet advanced to its result artifacts.

Validation

  • Added regression coverage for large PTY output and completion delimiters split across reads.

  • Verified the targeted output-drain tests with:

    python -m unittest tests/linux_output_drain_test.py

Context

Developed and validated by Slai Agent Runtime during Linux container-based evaluation workloads.

@huong8373tt-beep Slai.life (huong8373tt-beep) changed the title Fix Linux runtime PTY output drain performance Slai Agent Runtime:Fix Linux runtime PTY output drain performance Oct 14, 2026
@huong8373tt-beep Slai.life (huong8373tt-beep) changed the title Slai Agent Runtime:Fix Linux runtime PTY output drain performance Improve Linux PTY output draining for large command logs Oct 14, 2026
@huong8373tt-beep Slai.life (huong8373tt-beep) changed the title Improve Linux PTY output draining for large command logs Slai Agent Runtime:Improve Linux PTY output draining for large command logs Oct 14, 2026

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.

1 participant