[PR #1183] [CLOSED] serve: release batch control after terminal native ERR #3292

Closed
opened 2026-11-07 14:40:24 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1183
Author: @hulkbig
Created: 10/6/2026
Status: ❌ Closed

Base: main ← Head: fix/terminal-native-error-1059-20261006


📝 Commits (1)

  • 25fbebd serve: release batched control after terminal native ERR (#1059)

📊 Changes

2 files changed (+255 additions, -1 deletions)

View changed files

📝 serve/server.py (+10 -1)
➕ serve/test_engine_errors.py (+245 -0)

📄 Description

Fixes #1059

A native validation rejection emits ERR and returns to the input loop without DONE or BADM. With batch control active, the Python generator's cleanup then sends STOP and waits up to 300 seconds for a terminal line that will never arrive, holding the control lock and delaying the next request.

Raise a dedicated EngineRequestError (still a ValueError) for an ERR consumed by _control, and mark that command terminal before cleanup. Malformed protocol values still drain; cancellation, consumer close, fatal errors and restart cleanup retain their existing behavior. The production drain timeout is unchanged.

Regression tests use real HTTP and pipes with a scripted native process. A rejection is gated until a second request is queued; both requests must finish promptly, release the control lock and reserved slot, and preserve another active slot. They also exercise the existing malformed-protocol, consumer-close and fatal-error cleanup paths.

Validation on macOS arm64 / Python 3.12.12: python -m unittest serve.test_engine_errors serve.test_control_cancel serve.test_parallel serve.test_restart_waiters serve.test_fatal_recovery -v — 40 tests passed. git diff HEAD^ HEAD --check passed. The existing commit records a separate prior Linux run of 46 focused tests; its full suite retained six baseline missing-regex errors, so no full-suite pass is claimed. No GPU or real model was used.

Developed, tested and reviewed with OpenAI coding assistants.


🔄 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/Niko1221/Strata/pull/1183 **Author:** [@hulkbig](https://github.com/hulkbig) **Created:** 10/6/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/terminal-native-error-1059-20261006` --- ### 📝 Commits (1) - [`25fbebd`](https://github.com/Niko1221/Strata/commit/25fbebde7de24b4f92e821b64f52f9abb729eb5a) serve: release batched control after terminal native ERR (#1059) ### 📊 Changes **2 files changed** (+255 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `serve/server.py` (+10 -1) ➕ `serve/test_engine_errors.py` (+245 -0) </details> ### 📄 Description Fixes #1059 A native validation rejection emits `ERR` and returns to the input loop without `DONE` or `BADM`. With batch control active, the Python generator's cleanup then sends STOP and waits up to 300 seconds for a terminal line that will never arrive, holding the control lock and delaying the next request. Raise a dedicated `EngineRequestError` (still a `ValueError`) for an ERR consumed by `_control`, and mark that command terminal before cleanup. Malformed protocol values still drain; cancellation, consumer close, fatal errors and restart cleanup retain their existing behavior. The production drain timeout is unchanged. Regression tests use real HTTP and pipes with a scripted native process. A rejection is gated until a second request is queued; both requests must finish promptly, release the control lock and reserved slot, and preserve another active slot. They also exercise the existing malformed-protocol, consumer-close and fatal-error cleanup paths. Validation on macOS arm64 / Python 3.12.12: `python -m unittest serve.test_engine_errors serve.test_control_cancel serve.test_parallel serve.test_restart_waiters serve.test_fatal_recovery -v` — 40 tests passed. `git diff HEAD^ HEAD --check` passed. The existing commit records a separate prior Linux run of 46 focused tests; its full suite retained six baseline missing-regex errors, so no full-suite pass is claimed. No GPU or real model was used. Developed, tested and reviewed with OpenAI coding assistants. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 14:40:24 +07:00
Sign in to join this conversation.
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
Niko1221/Strata#3292
No description provided.