Skip to content

Fix hanging on exec for missing command#33

Merged
sjmiller609 merged 1 commit intomainfrom
fix-hang
Dec 10, 2025
Merged

Fix hanging on exec for missing command#33
sjmiller609 merged 1 commit intomainfrom
fix-hang

Conversation

@sjmiller609
Copy link
Collaborator

@sjmiller609 sjmiller609 commented Dec 10, 2025

Note

Prevents hangs when a command is missing by sending binary error output and a JSON exitCode=127 over WebSocket, improving client close handling, and adding regression tests.

  • Exec API (cmd/api/api/exec.go):
    • On exec error, write binary error output with \r\n and send JSON {"exitCode":127} via text message.
    • Clarify message types/comments; keep stdout binary streaming via wsReadWriter.
  • CLI (cmd/exec/main.go):
    • In interactive mode, treat unexpected WebSocket closes as errors; normal closes default to exit code 0.
    • Non-interactive path: minor close-handling tidy-up; continues to parse {"exitCode":...} messages.
  • Tests (lib/instances/exec_test.go):
    • Add regression tests ensuring non-existent commands fail quickly (TTY and non-TTY) without hanging and report "executable file not found".

Written by Cursor Bugbot for commit 8a93f85. This will update automatically on new commits. Configure here.

@sjmiller609 sjmiller609 requested a review from rgarcia December 10, 2025 16:57
@sjmiller609 sjmiller609 merged commit fddc707 into main Dec 10, 2025
4 checks passed
@sjmiller609 sjmiller609 deleted the fix-hang branch December 10, 2025 19:02
sjmiller609 pushed a commit that referenced this pull request Feb 28, 2026
Replace HOMEBREW_TAP_GITHUB_TOKEN PAT with kernel-internal app token
for GoReleaser Homebrew tap updates.

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
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.

2 participants