wingmirror Download
Docs GitHub Copilot

Docs · Agents

Connecting GitHub Copilot

This is a first version: it shows Copilot's sessions and does not yet answer for them. It is written from GitHub's hooks reference and has not been tried against a real Copilot install; see Status and known limits.

The GitHub Copilot lines are in the setup window and the menu only if the folder ~/.copilot exists. The connection is written for Copilot CLI. VS Code's documentation says the GitHub Copilot app and agent sessions in VS Code with Copilot chosen as the session target read the same hooks folder in the same format, so their sessions should appear too; whether they send the notification that says a session is waiting is not stated. Copilot's cloud agent runs on GitHub's machines and never appears.

What is written

Press Connect in the setup window, or choose Connect GitHub Copilot… in the menu and confirm. One file is written, ~/.copilot/hooks/wingmirror.json, and nothing else of Copilot's is touched: Copilot loads every .json file in that folder as hooks, so Wingmirror keeps to a file of its own. The hooks folder is made if it is not there yet.

The file holds one entry for each of eight events. Each runs /bin/sh '~/Library/Application Support/Wingmirror/hooks/copilot-hook.sh' <path> (with the full path written out), which posts the event to http://127.0.0.1:7317/hooks/copilot/<path>, gives up after a second, prints nothing and always succeeds. Copilot is told to give each five seconds.

EventPathWhat it is for
SessionStartsession-startThe session appears, idle, with its project
SessionEndsession-endThe session is taken off the panel
UserPromptSubmit, StopturnWorking when a prompt is sent, idle when the turn ends
PostToolUse, PostToolUseFailuretool-doneThe tool that has just finished, whether it ran or failed
SubagentStophelper-doneA helper has finished
notificationnotificationLimited to permission_prompt and elicitation_dialog: the session is waiting for you

Copilot sends an event in one of two shapes, chosen by how the event's name is written in the file. The names with capitals give the shape Claude Code uses, which the app already reads. notification has the one name and the one shape.

What a Copilot card shows

A Copilot session shows from its start, with its project, whether it is running or idle, and the last tool it finished. When Copilot asks permission to run something the card turns to the accent colour and reads "Needs approval"; when it asks you a question it reads "Needs input". It goes back to running at the next tool that finishes or the next prompt, and to idle when the turn ends.

What it does not do yet:

  • Approve and Deny only if you switch it on, and only for risky commands. As connected, a request is answered in Copilot itself and the card only says that one is waiting. Copilot has a hook that can answer, but it is asked about every request before Copilot's own rules and saved approvals, including the ones Copilot would have allowed by itself. Tick Ask on the Panel Before Risky Commands under GitHub Copilot in the menu and that hook is registered too: the bus answers at once, leaving the request to Copilot, unless the command looks destructive (rm, sudo, git push, git reset --hard, --force, a deploy or a publish, terraform apply, kubectl delete, find … -delete, piping a download into a shell, and the like), and those wait up to five minutes for Approve or Deny on the panel. With no answer Copilot asks in its own way. The list is built in, and you can add words and phrases of your own to it: Edit Your Risky Commands… under GitHub Copilot opens risky-commands.txt, one to a line, and a command with any of them in it is asked about too. It still cannot catch everything: a file edit, or a command that overwrites a file with >, is not held. It is a convenience, so keep Copilot's own permission settings as the real guard. What that hook is sent is not laid out in Copilot's reference, so this part is the least certain of the connection until it has been tried against a real install. No hook is ever registered for the event that runs before each tool, where a command that fails refuses the tool.
  • A tool shows once it has finished, not while it runs, for the same reason. While a session is working its card reads "Working…".
  • No model and no context figure. No hook carries either.
  • No helpers line. A helper finishing is heard; a helper starting is not followed.
  • A request answered while another tool is running can show as running a moment early: with tools called together, one finishing is taken to mean the prompt was answered.
  • A turn that is interrupted may go on reading as running. Copilot's reference lists an event for a turn that ends and none for one that is stopped part-way; if nothing is sent, the card stays as it was until the next prompt or the session's end.
  • The Git widget does not follow Copilot sessions, and Terminal brings a terminal app forward without selecting a tab.

A Copilot session sends nothing between events, so it is kept on the panel through its silences until it says it has ended, or for a day without a word.

Things to know about Copilot's side:

  • Copilot gives each hook a time limit and reads what it prints, so it is taken to wait for each one: with the app running every event costs it the few milliseconds the post takes, and with the app not running the post is refused at once.
  • With COPILOT_HOME set, Copilot keeps its files there and not in ~/.copilot. The app follows the variable only if it is set for the app too, which a variable exported in a shell is not when the app is opened from the Finder. From a terminal the commands below see it.
  • In a sandboxed Copilot session hooks run inside the sandbox, which may not let the script be read from Wingmirror's folder or reach the app. Nothing is known to go wrong beyond the session not appearing and Copilot noting once that a hook failed.
  • disableAllHooks in Copilot's settings stops these as it stops any others.

Updating the GitHub Copilot connection

LineWhat to do
GitHub Copilot: ConnectedNothing.
GitHub Copilot: Connection Out of DateUpdate GitHub Copilot Connection…. The file is not what this version writes: it was left by another version or edited by hand. It is written again, and a copy of the file as it was is kept in Wingmirror's hooks folder.
GitHub Copilot: Not ConnectedConnect GitHub Copilot…

The app does not ask about this when it opens; the menu line is where it shows. The script the hooks run is brought up to date by itself.

Disconnecting GitHub Copilot

Choose Disconnect GitHub Copilot. wingmirror.json is deleted, and the hooks folder too if Wingmirror made it and nothing else is in it. From a terminal:

/Applications/Wingmirror.app/Contents/MacOS/Wingmirror hooks install copilot
/Applications/Wingmirror.app/Contents/MacOS/Wingmirror hooks uninstall copilot

With the app not running, Copilot behaves as if nothing were installed.

Edit source on GitHub README.md#connecting-github-copilot