Skip to content

Route terminal replies after an async stream handoff - #168

Merged
tony merged 2 commits into
masterfrom
fix/109-successor-stream-replies
Dec 5, 2026
Merged

tony merged 2 commits into
masterfrom
fix/109-successor-stream-replies

Conversation

@tony

@tony tony commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Closes #109

What changed, and why:

A successor stream can be prepared before the current stream closes. When the successor starts, pumps, or sends, it claims the terminal's reply writer and delivers waiting replies ahead of new input.

Checks run:

On Linux, Ruff formatting and lint, ty for Python 3.12 through 3.15, the full pytest suite with doctests, compiled Ghostty comparisons, and the Sphinx warnings-as-errors build passed.

Tool use:

Codex prepared the change and ran the local checks. A separate Codex reviewer replayed the changed behavior and checked the publication tree against the reviewed patch.

tony added a commit that referenced this pull request Dec 3, 2026
why: Readers need the behavior and scope of this change at release.

what:
- Add the unreleased entry for PR #168
- Preserve previously published notes and the parent branch's entries
@tony
tony marked this pull request as ready for review December 3, 2026 01:39
@tony
tony force-pushed the fix/109-successor-stream-replies branch from 0e26bd5 to 74beb4e Compare December 3, 2026 23:58
tony added 2 commits December 5, 2026 07:43
why: Preparing a successor early can leave terminal replies unclaimed.

what:
- Claim the reply writer when a successor starts, pumps or sends.
- Flush pending terminal replies before outbound input.
- Exercise writer handoff and reply write failure.

Fixes #109
why: A terminal may have a pending reply when a successor stream takes
     over its writer.

what:
- Document when the successor sends replies ahead of new input.
@tony
tony force-pushed the fix/109-successor-stream-replies branch from 74beb4e to 8154152 Compare December 5, 2026 13:44
@tony
tony changed the base branch from master to fix/74-stream-shutdown December 5, 2026 13:44
@tony
tony changed the base branch from fix/74-stream-shutdown to master December 5, 2026 13:50
@tony
tony merged commit 6d03993 into master Dec 5, 2026
9 checks passed
@tony tony mentioned this pull request Dec 5, 2026
35 of 38 tasks
@tony
tony deleted the fix/109-successor-stream-replies branch December 5, 2026 20:41

This branch was successfully deployed

1 active deployment
docs — 81541523 Deployed Dec 5, 2026 by tony via build (3.14) #425
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.

Preparing a successor stream early can delay terminal replies

1 participant