Repository navigation
refactor(pty): structure Windows PTY startup - #1682
Conversation
✅ Deploy Preview for devsydev canceled.
|
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Command and environment preparation pkg/pty/start_windows.go |
startPty uses helpers to resolve the command and directory and to build the environment block. SSH requests add SSH_TTY; non-SSH requests preserve a nil environment. |
Console process startup and pipe closure pkg/pty/start_windows.go |
Helpers set the console attribute, create the process with extended startup and Unicode environment flags, and close both child pipe ends. Pipe closure returns the output-close error first, if present. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Refactor
Suggested labels: size/m, surface-refactor
Merge Risk: 
Minimal · up to 1cb69
-
No actionable startup regression is established. The change is mergeable after normal checks, though Windows runtime behavior has not been tested.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Description check
-
Explanation
The description clearly explains what changed, why it changed, and how it was validated. It identifies the refactor, test results, pre-existing findings, and the missing Windows runtime verification. It does not use the repository template headings or include explicit AI-assistance, issue-link, or checklist declarations, but the core required information is present.
-
-
Finishing Touches
-
✨ Simplify code
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
✅ Deploy Preview for images-devsy-sh ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
098724c to
1cb6980
Compare
|
@greptileai review |
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
[Low impact] The refactor appears safe to merge; no actionable issues were found. SummarySplits Windows PTY startup into five private helpers without changing the public API.
Reviews (1) · Last reviewed commit: "refactor(pty): trim restating comments i..." · Reviewed by Greptile |
|
@coderabbitai full review |
|
|
Coordinator gate update at head 1cb6980: CI is green, both commits are verified, Greptile reviewed this head at 5/5 with no actionable issues, and the local CodeRabbit CLI completed with 0 findings on this head. GitHub CodeRabbit has not completed review coverage; its status remains "Review rate limited" even after the stated 40-minute reset window and one manual full-review request. Leaving this PR ready and unmerged until GitHub CodeRabbit review completes. |
|
@coderabbitai full review |
✅ Action performed
|
Summary
startPtyinpkg/pty/start_windows.gointo named private steps:resolveCommand,newConsoleAttrList,processEnvBlock,createConsoleProcess, andcloseChildPipeEnds.startPtykeeps everydefer, the error-return order, and both goroutine starts (waitInternal, thenkillOnContextwhen a context is set).startPtydrops from cyclomatic complexity 21 to 11.Why
startPtymixed command resolution, ConPTY attribute setup, environment construction, process creation, and pipe hand-off in one 116-line function. Each step is now a function with one job, which makes the Windows start path reviewable in isolation. Defers and goroutine starts stay instartPtybecause defer LIFO order determines handle and kill ordering.Validation
mise run cli:format: no changes.mise run cli:lint:ci: exit 0,0 issues.go test ./pkg/pty/...:okforpkg/ptyandpkg/pty/ptytest(native, not Windows runtime).GOOS=windows go test -c -o /dev/null ./pkg/pty/: compiles, exit 0.GOOS=windows golangci-lint run ./pkg/pty/...: 22 issues, same count as HEAD before this refactor (all pre-existing, on moved code).GOOS=windows go vet ./pkg/pty/: only the pre-existingunsafe.Pointerfinding (line 116). Kept the conversion; it is the documented HPCON-as-lpValue pattern.StartWindowsSuite(pkg/pty/start_windows_test.go) executescmd.exeand needs a Windows host. Windows runtime behavior is unverified in this PR.CodeRabbit CLI
098724c9e, baseda973e6b738533fdcf40e2b625b65c2e25d3a43f:coderabbit review --agent --fresh --committed --base-commit da973e6b738533fdcf40e2b625b65c2e25d3a43fcompleted, 0 findings, reviewedpkg/pty/start_windows.go.1cb69807537a7038f179e0f488d230ca28757aaf, basedf78ff317a1c698388924d553d7ee69b910c528c, attempt 1:coderabbit review --agent --fresh --committed --base-commit df78ff317a1c698388924d553d7ee69b910c528cfailed withrate_limit("Rate limit exceeded", recoverable; 3 of 3 free OSS reviews used, 42 minute wait).1cb69807537a7038f179e0f488d230ca28757aaf, basedf78ff317a1c698388924d553d7ee69b910c528c, attempt 2: same command completed,review_completed, 0 findings, reviewedpkg/pty/start_windows.go.Auto-merge
Not enabled. Draft; coordinator owns ready/merge.
Next
Run
StartWindowsSuiteon a Windows runner to confirm runtime behavior.Summary by CodeRabbit
SSH_TTYenvironment variable.