-
Notifications
You must be signed in to change notification settings - Fork 0
Vibe multiplex support #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds SSH ControlMaster multiplexing support to improve port forwarding performance by reusing SSH connections instead of creating new ones for each port forward. The main changes enable connection sharing and background reverse port forwarding.
Key Changes:
- Implements SSH ControlMaster for connection multiplexing
- Runs reverse port forwarding in background with dedicated logging
- Adds GitHub Copilot token injection from local configuration
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| devpod-gh.plugin.zsh | Adds SSH multiplexing, background reverse forwarding with cleanup, and Copilot token support |
| README.md | Documents SSH ControlMaster configuration and new Copilot token injection feature |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| # Add GitHub Copilot token if available | ||
| local config_home="${XDG_CONFIG_HOME:-$HOME/.config}" | ||
| if [[ -f "$config_home/github-copilot/apps.json" ]]; then | ||
| local copilot_token=$(jq -r '."github.com:Iv1.b507a08c87ecfe98".oauth_token // empty' "$config_home/github-copilot/apps.json" 2>/dev/null) |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hardcoded client ID 'Iv1.b507a08c87ecfe98' appears to be magic value. Consider extracting this as a named constant at the top of the file or adding a comment explaining what this specific client ID represents.
| local devpod_host="${selected_space}.devpod" | ||
|
|
||
| # Start SSH ControlMaster for multiplexing | ||
| ssh -MNf "$devpod_host" 2>/dev/null |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SSH ControlMaster startup failures are silently suppressed. Consider capturing and logging errors to help diagnose connection issues, especially since the README indicates this is 'Required for optimal performance'.
| ssh -MNf "$devpod_host" 2>/dev/null | |
| local _ssh_cm_log=$(mktemp -t devpod-sshcm.${selected_space}.XXXXXX.log) | |
| ssh -MNf "$devpod_host" 2> "$_ssh_cm_log" | |
| local _ssh_cm_status=$? | |
| if [[ $_ssh_cm_status -ne 0 ]]; then | |
| echo "[devpod-gh] WARNING: SSH ControlMaster startup failed for $devpod_host. See $_ssh_cm_log for details." >&2 | |
| echo "[devpod-gh] SSH error output:" >&2 | |
| cat "$_ssh_cm_log" >&2 | |
| fi |
| # Remove temp log file | ||
| # Exit SSH ControlMaster connection | ||
| if [[ -n "$selected_space" ]]; then | ||
| ssh -O exit "${selected_space}.devpod" 2>/dev/null |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The devpod_host variable is constructed here instead of reusing the existing variable from line 147. Use '$devpod_host' for consistency and to avoid duplication.
| ssh -O exit "${selected_space}.devpod" 2>/dev/null | |
| ssh -O exit "$devpod_host" 2>/dev/null |
| This enables things like [github copilot cli](https://github.com/features/copilot/cli/) to just work... automagically, in devpods. | ||
|
|
||
| It magically enables the [github cli](https://github.com/devcontainers/features/tree/main/src/github-cli) feature. | ||
| This enables things like [github copilot cli](https://github.com/features/copilot/cli/) and [github cli](https://github.com/devcontainers/features/tree/main/src/github-cli) to just work... automagically, in devpods. |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected capitalization of 'github' to 'GitHub' for consistency with proper product naming.
Based on fish version