GitHub/Copilot: Difference between revisions

From Omnia
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 6: Line 6:


  https://github.com/settings/copilot
  https://github.com/settings/copilot
== Troubleshooting Connection Issues ==
ERR_HTTP2_STREAM_CANCEL
Verify HTTP 200:
curl --verbose https://copilot-proxy.githubusercontent.com/_ping
If using proxy:
curl --verbose -x http://YOUR-PROXY-URL:PORT -i -L https://copilot-proxy.githubusercontent.com/_ping
reference:
Troubleshooting network errors for GitHub Copilot - GitHub Docs
https://docs.github.com/en/copilot/troubleshooting-github-copilot/troubleshooting-network-errors-for-github-copilot
== Self Signed Certificate in Certificate Chain ==
self signed certificate in certificate chain on github copilot
https://stackoverflow.com/questions/71367058/self-signed-certificate-in-certificate-chain-on-github-copilot
* VSCode extension ‘Win-CA’ (must be set to ‘append’ mode)
-
monkey patch the Copilot extension
monkey-patch-copilot.sh
<pre>
_VSCODEDIR="$HOME/.vscode/extensions"
_COPILOTDIR=$(ls "${_VSCODEDIR}" | grep -E "github.copilot-[1-9].*" | sort -V | tail -n1) # For copilot
_COPILOTDEVDIR=$(ls "${_VSCODEDIR}" | grep "github.copilot-nightly-" | sort -V | tail -n1) # For copilot-nightly
_COPILOTCHATDIR=$(ls "${_VSCODEDIR}" | grep -E "github.copilot-chat-*" | sort -V | tail -n1) # For copilot-chat
_EXTENSIONFILEPATH="${_VSCODEDIR}/${_COPILOTDIR}/dist/extension.js"
_DEVEXTENSIONFILEPATH="${_VSCODEDIR}/${_COPILOTDEVDIR}/dist/extension.js"
_CHATEXTENSIONFILEPATH="${_VSCODEDIR}/${_COPILOTCHATDIR}/dist/extension.js"
if [[ -f "$_EXTENSIONFILEPATH" ]]; then
    echo "Found Copilot Extension, applying 'rejectUnauthorized' patches to '$_EXTENSIONFILEPATH'..."
    perl -pi -e 's/,rejectUnauthorized:[a-z]}(?!})/,rejectUnauthorized:false}/g' ${_EXTENSIONFILEPATH}
    sed -i.bak 's/d={...l,/d={...l,rejectUnauthorized:false,/g' ${_EXTENSIONFILEPATH}
else
    echo "Couldn't find the extension.js file for Copilot, please verify paths and try again or ignore if you don't have Copilot..."
fi
if [[ -f "$_DEVEXTENSIONFILEPATH" ]]; then
    echo "Found Copilot-Nightly Extension, applying 'rejectUnauthorized' patches to '$_DEVEXTENSIONFILEPATH'..."
    perl -pi -e 's/,rejectUnauthorized:[a-z]}(?!})/,rejectUnauthorized:false}/g' ${_DEVEXTENSIONFILEPATH}
    sed -i.bak 's/d={...l,/d={...l,rejectUnauthorized:false,/g' ${_DEVEXTENSIONFILEPATH}
else
    echo "Couldn't find the extension.js file for Copilot-Nightly, please verify paths and try again or ignore if you don't have Copilot-Nightly..."
fi
if [[ -f "$_CHATEXTENSIONFILEPATH" ]]; then
    echo "Found Copilot-Chat Extension, applying 'rejectUnauthorized' patches to '$_CHATEXTENSIONFILEPATH'..."
    perl -pi -e 's/,rejectUnauthorized:[a-z]}(?!})/,rejectUnauthorized:false}/g' ${_CHATEXTENSIONFILEPATH}
    sed -i.bak 's/d={...l,/d={...l,rejectUnauthorized:false,/g' ${_CHATEXTENSIONFILEPATH}
else
    echo "Couldn't find the extension.js file for Copilot-Chat, please verify paths and try again or ignore if you don't have Copilot-Chat..."
fi
</pre>
note: If you are using the SSH plugin for vscode, make sure to change the first line to _VSCODEDIR="$HOME/.vscode-server/extensions"


== keywords ==
== keywords ==

Latest revision as of 23:31, 1 September 2024

Copilot

https://github.com/features/copilot

Settings

https://github.com/settings/copilot

Troubleshooting Connection Issues

ERR_HTTP2_STREAM_CANCEL

Verify HTTP 200:

curl --verbose https://copilot-proxy.githubusercontent.com/_ping

If using proxy:

curl --verbose -x http://YOUR-PROXY-URL:PORT -i -L https://copilot-proxy.githubusercontent.com/_ping

reference:

Troubleshooting network errors for GitHub Copilot - GitHub Docs
https://docs.github.com/en/copilot/troubleshooting-github-copilot/troubleshooting-network-errors-for-github-copilot

Self Signed Certificate in Certificate Chain

self signed certificate in certificate chain on github copilot
https://stackoverflow.com/questions/71367058/self-signed-certificate-in-certificate-chain-on-github-copilot
  • VSCode extension ‘Win-CA’ (must be set to ‘append’ mode)

-

monkey patch the Copilot extension

monkey-patch-copilot.sh

_VSCODEDIR="$HOME/.vscode/extensions"
_COPILOTDIR=$(ls "${_VSCODEDIR}" | grep -E "github.copilot-[1-9].*" | sort -V | tail -n1) # For copilot
_COPILOTDEVDIR=$(ls "${_VSCODEDIR}" | grep "github.copilot-nightly-" | sort -V | tail -n1) # For copilot-nightly
_COPILOTCHATDIR=$(ls "${_VSCODEDIR}" | grep -E "github.copilot-chat-*" | sort -V | tail -n1) # For copilot-chat
_EXTENSIONFILEPATH="${_VSCODEDIR}/${_COPILOTDIR}/dist/extension.js"
_DEVEXTENSIONFILEPATH="${_VSCODEDIR}/${_COPILOTDEVDIR}/dist/extension.js"
_CHATEXTENSIONFILEPATH="${_VSCODEDIR}/${_COPILOTCHATDIR}/dist/extension.js"

if [[ -f "$_EXTENSIONFILEPATH" ]]; then
    echo "Found Copilot Extension, applying 'rejectUnauthorized' patches to '$_EXTENSIONFILEPATH'..."
    perl -pi -e 's/,rejectUnauthorized:[a-z]}(?!})/,rejectUnauthorized:false}/g' ${_EXTENSIONFILEPATH}
    sed -i.bak 's/d={...l,/d={...l,rejectUnauthorized:false,/g' ${_EXTENSIONFILEPATH}
else
    echo "Couldn't find the extension.js file for Copilot, please verify paths and try again or ignore if you don't have Copilot..."
fi
if [[ -f "$_DEVEXTENSIONFILEPATH" ]]; then
    echo "Found Copilot-Nightly Extension, applying 'rejectUnauthorized' patches to '$_DEVEXTENSIONFILEPATH'..."
    perl -pi -e 's/,rejectUnauthorized:[a-z]}(?!})/,rejectUnauthorized:false}/g' ${_DEVEXTENSIONFILEPATH}
    sed -i.bak 's/d={...l,/d={...l,rejectUnauthorized:false,/g' ${_DEVEXTENSIONFILEPATH}
else
    echo "Couldn't find the extension.js file for Copilot-Nightly, please verify paths and try again or ignore if you don't have Copilot-Nightly..."
fi
if [[ -f "$_CHATEXTENSIONFILEPATH" ]]; then
    echo "Found Copilot-Chat Extension, applying 'rejectUnauthorized' patches to '$_CHATEXTENSIONFILEPATH'..."
    perl -pi -e 's/,rejectUnauthorized:[a-z]}(?!})/,rejectUnauthorized:false}/g' ${_CHATEXTENSIONFILEPATH}
    sed -i.bak 's/d={...l,/d={...l,rejectUnauthorized:false,/g' ${_CHATEXTENSIONFILEPATH}
else
    echo "Couldn't find the extension.js file for Copilot-Chat, please verify paths and try again or ignore if you don't have Copilot-Chat..."
fi

note: If you are using the SSH plugin for vscode, make sure to change the first line to _VSCODEDIR="$HOME/.vscode-server/extensions"

keywords