Copilot reference
See the GitHub Copilot guide for setup.
Remote windows
Copilot Chat runs on the remote extension host. Open a Remote-SSH or Dev Containers window and run Connect from its integrated terminal:
npx anyray-connect@latest --enroll https://app.anyray.ai/enroll/enl_… --tools copilot
A local terminal configures only your laptop. Plain SSH lacks the window's code launcher,
which Connect needs to hand the key to VS Code.
| Requirement | Detail |
|---|---|
| Anyray extension 0.1.17+ | Earlier versions ran in the wrong host. |
| Current Connect | Earlier releases refused remote shells. |
| VS Code 1.121+ on the server | Check with code --version in the integrated terminal. |
| Gateway reachable from the remote host | HTTPS, or loopback HTTP. A laptop gateway needs an SSH reverse tunnel. |
Enable retrieval MCP under Select Tools in the remote window. If VS Code has not confirmed setup, use Developer: Reload Window to apply the staged configuration.
Remote setup does not configure the Agents window. Run Connect on your laptop for local Agents; the remote agent host has no model bridge.
Input guardrails on Copilot seat chat
On a Copilot seat (subscription mode), the extension asks the gateway to optimize each turn, then sends the turn to GitHub itself. When an input guardrail can refuse or rewrite a request, the gateway runs your org's input guardrails on the turn first.
- A turn a guardrail refuses or rewrites is not optimized. VS Code sends it to GitHub unchanged, because the gateway cannot block or redact that call.
- A redaction that matches an earlier message matches every later turn of that chat, so the rest of the chat is not optimized.
- Guardrail time counts against the extension's 1.5 second optimize budget. A turn that runs past it goes to GitHub unoptimized.
- If a caller's
x-anyray-configwith such a guardrail breaks a config rule, the gateway answers400and the turn goes to GitHub unoptimized.
Seat-lane sign-in sources
Connect reads Copilot sign-ins from COPILOT_GITHUB_TOKEN, ~/.config/github-copilot,
OpenCode's github-copilot login, anyray-connect copilot-login, or ~/.copilot/config.json.
On macOS, run with --tools copilot-cli to permit a Keychain prompt. On Linux and Windows,
accept /login's offer to store credentials locally.
If a detected seat has no readable token, Connect leaves an unconfigured CLI on native GitHub inference without switching to org billing. If GitHub rejects a token, Connect names its source; sign in again with an account that has a Copilot seat, then rerun setup.
Which sign-in decides which models
Model access depends on the OAuth app that minted the token. One measured seat returned:
| Sign-in | Models served |
|---|---|
| Editor-plugin sign-in | 48 models, including claude-sonnet-5 |
CLI /login | 7 legacy ids; current models returned 400 |
For current-model access, run anyray-connect copilot-login, complete the browser sign-in,
then rerun anyray-connect --tools copilot-cli.
Choosing the CLI model
COPILOT_MODEL sets the startup default; copilot --model <id> overrides it per launch.
BYOK /models may show only the configured model. Use anyray-connect models to list available
models, or anyray-connect models <id> to validate and save a default with a live one-token chat.
| Lane | Default | Selection |
|---|---|---|
| Org | anyray-default | Follows the gateway's routing configuration. |
| Seat | Newest working Sonnet-class id | Connect probes the seat's available models through the gateway. Offline fallback: claude-sonnet-5. |
Setup writes the model's prompt/output token caps. To pin a default, use ANYRAY_COPILOT_MODEL
(shared with VS Code; the CLI takes the first id):
ANYRAY_COPILOT_MODEL=gpt-5-codex npx anyray-connect@latest --tools copilot-cli
Windows
Connect writes the user environment and retrieval MCP configuration automatically, for both
copilot.exe and npm's copilot.cmd. No admin shell or credential copying is needed.
After updating from 0.11.220 or an earlier manual-setup version, run
anyray-connect --tools copilot-cli once with your intended billing choice. Updating the binary
alone does not complete the old setup.
Quit and reopen your terminal and its parent app (Windows Terminal or VS Code), then run
anyray-connect doctor --json. Expect pointedAt: true and MCP registered. This checks saved
configuration, not live traffic. If the environment warning persists, check shell profiles and
machine-level overrides.
~/.anyray/copilot-cli-windows.json contains credentials; do not share it. Revert restores original
values only where settings still match Connect's last write. After an interrupted write, retry
setup before reverting; manual cleanup may be needed.
Reverting, and shells already open
npx anyray-connect@latest --tools copilot-cli --revert
On macOS/Linux, revert removes the managed block and ~/.anyray/copilot-cli.sh. Open a new terminal
or unset the variables Connect names; existing shells retain them. On Windows, restart the parent
app too. Inline completions and GitHub-hosted features are unaffected.