Fix copilot CLI session termination in web terminal#7
Draft
Fix copilot CLI session termination in web terminal#7
Conversation
- session-picker.py: Wrap [c], [r], c<N> copilot launches in 'zsh -i -c "copilot ...; exec zsh"' so the tmux session survives when copilot exits (instead of destroying the session and bouncing the user back to the session picker) - Dockerfile: Add proxy_read_timeout/proxy_send_timeout 86400s to the /terminal/ nginx location to prevent 60s idle WebSocket disconnects - session-manager.py: Same nginx timeouts for per-session terminal configs; add --ping-interval 30 to ttyd; extract TTYD_PING_INTERVAL and NGINX_PROXY_TIMEOUT constants - entrypoint.sh: Add --ping-interval 30 to main ttyd process so WebSocket keepalive pings are sent every 30s Co-authored-by: TomProkop <4339668+TomProkop@users.noreply.github.com> Agent-Logs-Url: https://github.com/NETWORG/AgentBox/sessions/dc35a7d6-5103-4a66-92eb-b97e79dec300
…iles Co-authored-by: TomProkop <4339668+TomProkop@users.noreply.github.com> Agent-Logs-Url: https://github.com/NETWORG/AgentBox/sessions/dc35a7d6-5103-4a66-92eb-b97e79dec300
Copilot
AI
changed the title
[WIP] Fix issue with web terminal terminating copilot CLI session
Fix copilot CLI session termination in web terminal
Mar 24, 2026
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.
Copilot CLI sessions launched from the session picker were being destroyed when the copilot process exited, ejecting users back to the session picker. Long-running tasks also caused silent WebSocket disconnects due to nginx's default 60s proxy timeout.
Session persistence (
session-picker.py)Copilot was run as the direct initial tmux command — when the process exits (agent handoff, task phase completion, error), tmux destroys the window and session. Fix wraps the launch in a persistent shell:
Applied to
[c],[r], andc<N>(resume-by-id) options.WebSocket keepalive (
Dockerfile,session-manager.py,entrypoint.sh)proxy_read_timeout 86400s/proxy_send_timeout 86400sto all nginx terminal locations (main/terminal/and dynamically generated per-session configs)--ping-interval 30to allttydinvocations — default was 300s, well past nginx's 60s cutoffTTYD_PING_INTERVALandNGINX_PROXY_TIMEOUTconstants insession-manager.pyfor consistencyOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.