GitHub Copilot
GitHub Copilot is the provider OAR starts with: it is always available, and it uses the Copilot CLI that is signed in on the relay host. The relay runs it on one of two engines. The SDK engine is the default and gives you steering, a panel for background tasks and multi-select questions. The Extension engine runs the real Copilot CLI in a terminal you can watch.
OpenAI with your own key runs on the same two engines, so the engine sections of this page apply to it as well. Its key and models are on the OpenAI page.
What you need #
- The Copilot CLI, signed in, on the relay host. Install it with
npm install -g @github/, runcopilot copilotonce and sign in. Your GitHub account needs a Copilot plan that includes Copilot CLI. - A relay restart after you install or upgrade the CLI. The relay looks for the CLI's runtime when it starts and does not see a later install.
- The GitHub CLI (
gh), signed in, foroar copilot, Extension-engine sessions on Windows, and the Copilot card in Check Usage. - tmux (optional, Linux and macOS) if you want to watch a session's terminal with 🖥️ Inspect tmux console.
The relay does not install or update the Copilot CLI. In Settings → Providers → Copilot, the GitHub Copilot CLI row at the top only reports its state.
How OAR finds the CLI #
The SDK engine drives the runtime that comes with the Copilot CLI. At startup the relay looks in the CLI's package cache and takes the newest version there:
| System | Folder |
|---|---|
| Linux | ~/. and ~/. |
| macOS | ~/ |
| Windows | %LOCALAPPDATA%\ |
On Linux the two folders follow XDG_ and XDG_ when you
set them. Set COPILOT_ to add a folder to search, or COPILOT_ to name
the runtime's copilot- directory directly. If nothing is found, the SDK
engine is not available (see Choosing the engine).
Using oar copilot #
oar copilot starts the relay in the background if none answers on its port,
then opens the Copilot CLI (gh copilot) in your shell. A relay that it
started stops again when the session ends. Arguments after -- go to
gh copilot.
oar copilot
oar copilot --port 3400 -- --help
Each run also writes or refreshes a small wrapper in
~/., a user-global extension that loads OAR's
extension into the Copilot CLI. oar copilot --install- does only
that and exits (it needs no gh); --no- skips it for one
run. If gh is missing, oar copilot says so and stops; install the GitHub
CLI or run only the relay with oar start.
The two engines #
| SDK engine | Extension engine | |
|---|---|---|
| What runs | A headless worker per conversation, driving the Copilot CLI's bundled runtime | The Copilot CLI in a terminal session, with OAR's extension loaded |
| Default | Yes, since 0.9.2 | Used when the relay cannot run the SDK engine |
| Needs | An installed, signed-in Copilot CLI | The same, plus gh on Windows |
| Message sent during a turn | Steer: it goes into the running turn Added in 0.9.3 | Waits in the queue until the turn ends |
| Background tasks | Listed in the composer's task panel, each with a working Stop Added in 0.9.3 | Not in the panel |
| Multi-select questions | Yes: the model can mark a question as multi-select, and choice cards have a Select several switch Added in 0.9.3 | Not on a plain choice card. A form with a field that takes several values offers several |
| Question wait | 8 hours | 2 hours |
| 🖥️ Inspect tmux console | Shows the worker's log, not the Copilot screen | Shows the live Copilot terminal (Linux and macOS, with tmux) |
| Agent tools | relay_ is a tool; for preview the agent is told how to call the relay's preview API |
relay_ and preview through OAR's MCP server |
| Relay modes | Native plan and autopilot modes; plan refuses anything not read-only, ask asks before each such action | A prompt instruction only |
| Compacting | The runtime compacts in the background at 80% of the context window and blocks at 95% | OAR sets and shows nothing |
| Stuck-turn watch | Fails a turn after 120 s of silence, 300 s during a model request, 30 min during a tool | A turn is limited to 2 hours; 45 s inactivity window while the relay considers the CLI offline |
| Usage | Adds Last SDK worker turn to the Copilot card in Check Usage | The card's account meters only |
Both engines show the same transcript, question cards, plan boards, model list and per-reply usage line. See Turns and the queue for Steer, Queue and the stuck-turn windows, Relay modes and Compacting for those rows, and ask_user for question cards.
On the SDK engine, Stop ends only the reply. Background agents the turn started keep running under their own Stop in the task panel.
Choosing the engine #
The choice is one setting for the whole relay: Settings → Providers → Copilot → Copilot engine, with the options Extension and SDK — default. Press Save Copilot settings after you change it.
- It applies to conversations whose worker starts afterwards. A session that is already running keeps its engine until its worker restarts.
- If nobody has saved a choice, the relay uses SDK whenever it can and Extension when it cannot. A choice you saved always wins. That includes a saved SDK: if a later restart no longer finds the CLI, the relay does not switch back by itself, and the worker of a new conversation cannot start until the CLI is found again or you save Extension.
- The panel says which engine is set: New Copilot conversations run on the headless SDK worker. No tmux inspector for these sessions. or New Copilot conversations run on the Copilot CLI with the web-relay extension.
To tell which engine a running conversation uses, look at its composer and its tmux console. During a turn the send button reads Steer on the SDK engine (it reads Queue there while a question card or approval is open, the turn is compacting or a tool call is running) and always Queue on the Extension engine. The tmux console shows a Copilot screen only on the Extension engine. The conversation itself does not carry an engine label.
When saving SDK is refused #
The relay refuses to save SDK when it could not run it, and shows the reason in place of the engine description. The stored setting does not change, and the select goes back to the engine the relay actually runs.
| Message starts with | What to do |
|---|---|
| The Copilot SDK was not found when the relay started (COPILOT_SDK_PATH did not resolve) | The relay found no Copilot CLI runtime. Install or upgrade the CLI, run copilot once, and restart the relay. See How OAR finds the CLI. |
| The SDK engine requires session worker routing, which is disabled on this relay (SESSION_WORKER_ROUTING_ENABLED) | Turn Session worker routing back on in Settings → Features (it is on by default) and restart the relay. |
Settings #
Under Settings → Providers → Copilot:
| Control | Default | What it does |
|---|---|---|
| GitHub Copilot CLI | A status row. Read-only: you manage this CLI with npm on the relay host. | |
| Copilot engine | SDK | Which engine runs new Copilot conversations. See Choosing the engine. |
| Save Copilot settings | Saves the engine. |
Other settings that touch Copilot sessions live elsewhere:
| Setting | Default | Effect on Copilot |
|---|---|---|
| Settings → General → Background task timeout | 4 h | How long background agents and detached shells alone may keep a session running after its reply. Then they are stopped. 0 means no limit; the largest value is 10 h. |
| Settings → General → Max turn duration | 60 min | The longest one turn may run before the relay requeues it. |
| Settings → Features → Session worker routing | on | The SDK engine needs it. A change applies after a relay restart. |
Models #
The relay reads the model list from the installed Copilot CLI runtime a few
seconds after it starts. Each model
shows the reasoning efforts and the context window the runtime reports. The
list starts with auto, then groups models by vendor (OpenAI, Anthropic,
Google, xAI, Microsoft, Azure OpenAI, Moonshot AI, then others alphabetically),
newest version first.
Until the first discovery, a new relay offers gpt-, gpt- (the
default), gpt-, claude- and claude-.
Use 🤗 Select Models → Copilot in a conversation's ⋯ menu to choose which
models appear in the composer, then 💾 Save enabled models. Refresh
reads the list again. If the list looks old, press Refresh.
Usage #
- Under a reply, a Copilot turn shows what it used:
+Nfor the credits, with the share of your monthly plan in brackets, andmonth N% left. Astaletag means the numbers could not be refreshed for that turn. Only Copilot turns get this line; other providers, OpenAI included, do not use Copilot credits. - In the header, a session line adds up the conversation, for example
Session: 1..25 AIC used - In Check Usage, open 📊 Check Usage in the
⋯menu and pick the Copilot tab for the live quota (AI credits or premium requests, chat and plan). On the SDK engine it adds Last SDK worker turn: the credits that turn actually spent, its tokens and model calls. These are one turn's numbers, not a running total, and the section disappears after seven days.
The Copilot card reads your account through gh. If you do not use gh, set
GH_ or GITHUB_ in the relay's environment.
Importing sessions you already have #
When the relay starts, it imports the Copilot sessions stored on the host, so they appear in your list with their history. It reads them through the installed Copilot runtime. If the runtime is not available, the import is reported as failed. The relay does not guess from the files.
Deleting such a session only hides it: the Copilot CLI's own session stays, because the relay never ran it.
Environment variables #
Set these in the environment of the relay process, then restart the relay.
| Variable | What it does |
|---|---|
COPILOT_ |
The Copilot CLI runtime's copilot- directory, instead of the newest one in the package cache |
COPILOT_ |
An extra package cache to search for the runtime |
GH_, GITHUB_ |
A GitHub token for the Copilot card in Check Usage, instead of gh auth token |
OAR_ |
Do not attach OAR's MCP server to the Extension engine; it gets the preview instructions as text, and no relay_ tool |
COPILOT_ |
Pins Session worker routing off, which makes the SDK engine unavailable |
Limits #
- The relay needs a restart to notice a Copilot CLI that was installed or upgraded after it started.
- On the SDK engine there is no terminal to attach to.
- Messages during a turn queue on the Extension engine; they cannot be steered.
- On the SDK engine the relay gives a turn 2 minutes of silence with nothing running, 5 minutes during a model request and 30 minutes while a tool runs before it fails the turn. A turn that waits on a question card is never treated as stuck. The windows are in Turns and the queue.
- An OpenAI conversation on your own key uses these engines too, but spends your key, so its turns carry no Copilot usage line.
If it does not work #
| What happens | Why, and what to do |
|---|---|
| Copilot does not start, or the SDK engine is refused with COPILOT_SDK_PATH did not resolve | No Copilot CLI runtime was found at startup. Install or upgrade the CLI, run copilot once, restart the relay. |
| On the SDK engine, the reply says the Copilot runtime could not authenticate | Run copilot on the relay host, sign in, and send the message again. |
| New conversations run on Extension although you wanted SDK | Nobody saved a choice and the relay cannot run SDK, or you saved Extension. Set Copilot engine to SDK and save; the refusal message names the cause if there is one. |
| A running conversation did not change engine | The engine is read when its worker starts. ☠️ Kill session in the ⋯ menu stops the worker; the next message starts it on the current engine. |
| The reply says GitHub Copilot has no AI credits left for this billing window | The plan is used up. Open Check Usage for the reset time and retry after it, or switch the conversation to another provider. The relay does not retry this. |
oar copilot says the GitHub CLI is missing |
It runs gh copilot. Install the GitHub CLI, or run only the relay. |
| The model list is old or wrong | 🤗 Select Models → Refresh. |
| No usage line under a reply | Only Copilot turns record it. |
| 🖥️ Inspect tmux console shows log lines, not a Copilot screen | The conversation runs on the SDK engine. |
Agent sessions, relay modes and other behaviour that does not depend on the engine work as described on the pages for sessions and agents together.