Repository navigation
Conversation
Three performance improvements integrated: 1. Parallel setup: Agent setup scripts (claude, codex, opencode, gemini, databricks, mlflow) run concurrently via ThreadPoolExecutor after the sequential git+micro prerequisites. Cuts startup time ~5x. 2. WebSocket terminal I/O: Flask-SocketIO pushes PTY output in real-time via Socket.IO with automatic HTTP polling fallback. Adds join/leave room lifecycle, auth on connect, and session exit/close notifications. 3. Per-session locks: Replace global sessions_lock with per-session Lock for buffer access. Global lock only guards dict-level add/remove/iterate. Atomic buffer swap in get_output() reduces lock contention. Co-Authored-By: Claude Opus 4.6 <[email protected]>
datasciencemonkey
added a commit
that referenced
this pull request
Mar 9, 2026
Apply PR #47 from David O'Keeffe with the following enhancements: - Parallel setup via ThreadPoolExecutor (~5x faster startup) - Per-session locks (reduced contention vs global lock) - WebSocket terminal I/O via Flask-SocketIO (eliminates 50-200ms polling latency) Fixes applied on top of PR #47: - Fix session timeout: update last_poll_time on WS output emit - Vendor Socket.IO client to /static/lib/ (avoid CDN dependency) - Restrict CORS: cors_allowed_origins=[] (same-origin only) - Increase thread pool: 8→16 for WS connection headroom - Adjust gunicorn timeout: 120s→60s (balanced for WS + hung-worker detection) - Clear output buffer on WS join (prevent duplicate output on transport switch) Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
9 tasks done
Owner
|
Excellent stuff! Resolving a few merge conflict and closing out quick and dirty fixes here #48 (comment) |
Owner
|
Closing this, #48 builds on this. |
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.
Summary
Three performance improvements for the terminal app:
ThreadPoolExecutorafter sequential git+micro prerequisites. Cuts startup time ~5x.threading.Lock()— global lock only guards dict-level add/remove/iterate. Atomic buffer swap inget_output()reduces contention when running multiple terminals.Changes
app.py— All three features integrated (parallel setup, SocketIO handlers,_get_session()+ per-session lock pattern)gunicorn.conf.py— Timeout 30→120s for long-lived WebSocket connectionsrequirements.txt— Addedflask-socketio>=5.3,simple-websocket>=1.0static/index.html— Socket.IO client with WebSocket-first transport + HTTP polling fallbackdocs/prd/websocket-terminal-io.md— PRD for WebSocket featureTest plan
[ws] Connected)🤖 Generated with Claude Code