fix: terminal command execution via HTTP POST workaround

The WebSocket send mechanism fails with close code 1006 when client
tries to send data to server. Server never receives the message,
indicating a network/proxy layer issue that couldn't be fixed through
code changes or nginx configuration.

Solution: Bypass WebSocket send entirely by using HTTP POST to send
commands directly to the PTY.

Changes:
- Added sendTerminalInput() method to terminal-service.js that writes
  directly to PTY, bypassing WebSocket
- Added POST endpoint /claude/api/terminals/:id/input to server.js
- Modified launchCommand() in terminal.js to use fetch() with HTTP
  POST instead of WebSocket.send()

The WebSocket receive direction still works (server→client for output
display), only send direction (client→server for commands) is bypassed.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
uroma
2026-01-19 19:52:36 +00:00
Unverified
parent 990ea80edd
commit 815f7095fd
5 changed files with 130 additions and 38 deletions

Binary file not shown.