Conversation
The idle input thread parked itself on inputIdleSubmitted even for empty text, but empty text sets no queuedText, so the controller never unparked. Both threads spun in sleep-loops forever. Three layers, in order of importance: - onSubmit only parks when there's real text to consume (root cause) - consumeQueuedInput clears the park when nothing was found, so polling IS releasing - no call site can forget (withFile-style) - existing explicit releaseIdleSubmittedInput calls kept as belt-and-suspenders Regression test drives the stub under a PTY: fails against unpatched binary, passes with the fix.
The input thread used poll() with SA_RESTART on the SIGWINCH handler, so resize never caused EINTR and the editor/footer were never repainted at the new geometry. Now the input thread checks the shared resize flag on each poll cycle and surfaces it as IOError, reusing the existing redraw path in readLineWith. Adds a visual test for idle resize rewrap.
…n't hang The response head read used the same 500ms wake-bounded recv as the streaming body loop, but treated StreamTimeoutError as a stale-conn failure. Providers that hold the connection for seconds while the model warms up (z.ai GLM, ~7s to first byte) burned both stale-conn retries and then failed with "recv timed out", hanging every request on macOS where the head arrives after the 500ms window. Loop on the timeout (re-checking interrupt/quiet) like the body loop already does. Applies to both streamHttp and callHttp.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Loop on StreamTimeoutError during readResponseHead so providers that hold the connection for seconds while the model warms up (z.ai GLM ~7s to first byte) don't burn both stale-conn retries and hang. Reproduced on the stefani OSX VM against zaicode.glm-5.2; the macOS head read timed out at the 500ms wake window on every request.