Conversation
hiroTamada
approved these changes
Jan 29, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| case w.resizeChan <- &guest.WindowSize{Rows: resizeMsg.Resize.Rows, Cols: resizeMsg.Resize.Cols}: | ||
| default: | ||
| // Channel full, skip | ||
| } |
There was a problem hiding this comment.
Panic risk when sending to closed resize channel
Medium Severity
The resizeChan is closed via defer (line 129) before the WebSocket is closed (line 75), due to LIFO defer ordering. The wsReadWriter.Read method's select statement at lines 228-232 sends to w.resizeChan, but sending to a closed channel in Go causes a panic—even within a select with a default case. If a resize message arrives after ExecIntoInstance returns but before ExecHandler completes, the orphaned stdin goroutine could panic when processing that message.
Additional Locations (1)
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.


Fixes some terminal behavior:
terminal-behavior.mov
Note
Medium Risk
Touches the exec streaming path across API, gRPC client, and guest-agent, including concurrency around shared gRPC streams and protocol changes; regressions could break interactive shells or exec I/O.
Overview
Adds end-to-end terminal resize support for interactive
execsessions: the API now accepts initialrows/colsin the first WebSocket message and parses subsequent{"resize":{...}}control messages, forwarding them to the guest over gRPC.Updates the guest protocol (
guest.proto+ regeneratedguest.pb.go) and client/agent implementations to carry window dimensions (ExecStart.rows/colsandExecRequest.resize), apply them viapty.StartWithSize/pty.Setsize, and guard concurrent gRPC stream sends.Build tooling is adjusted to pin/install
protoc-gen-go/protoc-gen-go-grpcviatools.go/go.modand a newmake install-proto-toolsstep; adds a unit test covering TTY env defaults/overrides in the guest agent.Written by Cursor Bugbot for commit 6283407. This will update automatically on new commits. Configure here.