feat(execd): add WebSocket PTY support#590
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 67a29319a2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Could you provide some manual test cases or screenshots for reference? |
9beee69 to
8dc470f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8dc470f9dd
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Done. https://gist.github.com/ctlaltlaltc/930aedb331caadd7fc1bffea74003a0a my xtermjs client connect to execd endpoint directly integrate. |
Great Job. You can rebase main and fix the interface definition issue. #577 |
Add interactive terminal sessions over WebSocket to execd: - REST endpoints to create/resize/close PTY sessions - WebSocket handler with output replay on reconnect - Circular replay buffer (1 MiB) for session history - Windows stubs for cross-platform build compatibility Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
8dc470f to
e48c639
Compare
|
@Pangjiping Done, thanks review. |




Summary
For context regarding API separation and integration, Ref #455
/pty/*REST endpoints to create, inspect, and delete PTY sessions (independent of existing/session/*flow)GET /pty/:id/wsWebSocket endpoint for bidirectional interactive terminal acce?since=<offset>for exact-once output delivery?pty=0) both supportedChanges
pkg/runtime/replay_buffer.gopkg/runtime/pty_session.go!windows)pkg/runtime/pty_session_windows.gopkg/web/model/pty.go/pty_ws.gopkg/web/controller/pty_controller.gopkg/web/controller/pty_ws.gopkg/runtime/ctrl.goptySessionMap sync.Map(only change)pkg/web/router.go/pty/*routes (only change)Zero modifications to existing
bashSession,RunInSession, or/session/*endpoints.Test coverage
replay_buffer_test.go— write/read, circular eviction, caught-up offset, large gap, concurrent (-race)pty_session_test.go— basic execution, PTY resize, ANSI sequences, pipe mode, reconnect replaypty_ws_test.go— 404 before upgrade, 409 already connected, ping/pong, stdin forwarding, replay on reconnect, exitframe, resize frame
Verified manually
POST /pty→ session createdGET /pty/:id→{"running":true,"output_offset":18}wscatPTY mode and pipe mode (?pty=0)?since=0delivers prior outputTesting
Breaking Changes
Checklist