[PR #158] [CLOSED] fix: preserve buffered PTY output after EIO #143

Closed
opened 2026-10-18 21:11:11 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-terminal/pull/158
Author: @mikemikimike
Created: 8/22/2026
Status: ❌ Closed

Base: main ← Head: fix/pty-output-eio-145


📝 Commits (3)

  • 1b0f307 fix: preserve PTY output after child exit
  • 8026329 Merge branch 'main' into fix/pty-output-eio-145
  • f8e2eca Merge branch 'main' into fix/pty-output-eio-145

📊 Changes

2 files changed (+97 additions, -7 deletions)

View changed files

📝 open_terminal/utils/runner.py (+24 -7)
➕ tests/test_runner.py (+73 -0)

📄 Description

Summary

Fixes #145.

On Unix PTYs, a child exiting can make the next master-fd read raise EIO while output remains buffered. PtyRunner.read_output() previously stopped immediately, so /execute could report a successful command with an empty output array.

This change drains remaining PTY data after EIO, preserves the existing behavior for other OSError values, and centralizes output serialization. Regression coverage includes the EIO branch, non-EIO errors, and a real fast-command PTY check on Unix.

Compatibility

No API changes. Windows and pipe-based runners are unchanged.

Verification

  • python -m pytest -q tests/test_runner.py — 2 passed, 1 skipped on Windows (Unix PTY test)
  • python -m compileall -q open_terminal tests — passed
  • git diff --check — passed

The repository Docker image build was attempted using Dockerfile and Dockerfile.slim, but Docker Hub layer downloads stalled in this environment before the images could be built. The real Unix PTY test is therefore skipped on this Windows host and will run in Linux CI.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-terminal/pull/158 **Author:** [@mikemikimike](https://github.com/mikemikimike) **Created:** 8/22/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/pty-output-eio-145` --- ### 📝 Commits (3) - [`1b0f307`](https://github.com/open-webui/open-terminal/commit/1b0f3076aea80aad23f388839fc9e9f1801bb279) fix: preserve PTY output after child exit - [`8026329`](https://github.com/open-webui/open-terminal/commit/8026329f1b03f0d2351b344a9b9f112f40438d9c) Merge branch 'main' into fix/pty-output-eio-145 - [`f8e2eca`](https://github.com/open-webui/open-terminal/commit/f8e2eca58043a6474e499cd9e3d489b3a5ed7135) Merge branch 'main' into fix/pty-output-eio-145 ### 📊 Changes **2 files changed** (+97 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `open_terminal/utils/runner.py` (+24 -7) ➕ `tests/test_runner.py` (+73 -0) </details> ### 📄 Description ## Summary Fixes #145. On Unix PTYs, a child exiting can make the next master-fd read raise `EIO` while output remains buffered. `PtyRunner.read_output()` previously stopped immediately, so `/execute` could report a successful command with an empty output array. This change drains remaining PTY data after `EIO`, preserves the existing behavior for other `OSError` values, and centralizes output serialization. Regression coverage includes the EIO branch, non-EIO errors, and a real fast-command PTY check on Unix. ## Compatibility No API changes. Windows and pipe-based runners are unchanged. ## Verification - `python -m pytest -q tests/test_runner.py` — 2 passed, 1 skipped on Windows (Unix PTY test) - `python -m compileall -q open_terminal tests` — passed - `git diff --check` — passed The repository Docker image build was attempted using `Dockerfile` and `Dockerfile.slim`, but Docker Hub layer downloads stalled in this environment before the images could be built. The real Unix PTY test is therefore skipped on this Windows host and will run in Linux CI. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-18 21:11:11 +00:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/open-terminal#143
No description provided.