refactor: replace channel-based AsciiTransportServer with io.ReadWriteCloser ServerSession#82
Draft
refactor: replace channel-based AsciiTransportServer with io.ReadWriteCloser ServerSession#82
Conversation
…er with ServerSession interface Replace AsciiTransportServer (which exposed channels like ResizeEvent(), InputEvent()) with a ServerSession interface implementing io.ReadWriteCloser plus NextResize() method. This makes the server session usable like a local file or pipe. - Add ServerSession interface with io.Reader, io.Writer, io.Closer, NextResize() - Add ResizeMsg type alias for ResizeEvent - Implement serverSession struct wrapping AsciiTransport internals - Update plugin_terminalserver.go to use new interface (direct io.Copy instead of WithReader/WithWriter opts) - Update third_party/cmd/ameniicsav1 to use new interface - Add unit tests for ServerSession Co-authored-by: btwiuse <54848194+btwiuse@users.noreply.github.com>
Co-authored-by: btwiuse <54848194+btwiuse@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor pkg/asciitransport to remove channels from public interface
refactor: replace channel-based AsciiTransportServer with io.ReadWriteCloser ServerSession
Feb 25, 2026
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.
Remove channels from the
pkg/asciitransportpublic server interface. The oldAsciiTransportServerleaked implementation details viaResizeEvent() <-chan *ResizeEventandInputEvent() <-chan *InputEvent.New interface
Channels remain internal. The session behaves like a standard file/pipe.
Changes
pkg/asciitransport/server.go— ReplaceAsciiTransportServerwithServerSession; implementserverSessionstruct withRead/Write/Close/NextResizepkg/asciitransport/event.go— Addtype ResizeMsg = ResizeEventpkg/agent/server/plugin_terminalserver.go— Useio.Copy+NextResize()instead of channel reads andApplyOpts(WithReader, WithWriter)third_party/cmd/ameniicsav1/main.go— Same migrationpkg/asciitransport/server_test.go— Tests for Read, Write, NextResize, Close, and post-Close behaviorConsumer migration
Before:
After:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.