Skip to content

Copilot

inksong edited this page Nov 9, 2026 · 5 revisions

Copilot

Copilot is the agent built into the desktop app, on pi. It runs in the app's main process and uses the same API as any other agent: it opens a session named copilot, claims the aircraft it is asked to fly and appears in the Agents workspace and the relay timeline.

Setup

  1. Open Settings → Copilot.
  2. Choose the interface type: openai-completions (any OpenAI-compatible endpoint), anthropic-messages or openai-responses.
  3. Enter the base URL, model ID and API key, then Test connection.
  4. Choose the tool scope: flight, flight+device or all (default).
  5. For reasoning models such as DeepSeek V4, set Thinking (auto leaves it to the endpoint; off, low, high) and Max output tokens (1024–131072, default 16384). Thinking shares the output limit with the answer: if a call runs out, the chat says so and suggests raising the limit or lowering Thinking.

Open it with the Copilot button or ⌘J / Ctrl+J. Copilot is a floating window that stays above other applications without blocking them; drag it anywhere and resize it. Each message carries the aircraft selected in the main window.

Watching a run

Every message gets a small red pixel aircraft under it. While Copilot works the aircraft flies and the line next to it names the phase and the time: waiting for the model, thinking (with the characters so far), writing, preparing a tool call (with the argument characters), a tool running, or waiting for your approval. When the line scrolls out of view, the same line sits above the input.

Click it to open the run trace:

  • one row per model call: time, input, output and thinking tokens, and why it stopped (reply, tool calls, output limit, error);
  • one row per tool: aircraft, time and outcome;
  • expand a model call for its full thinking, its reply and the tool calls it asked for (arguments as JSON); expand a tool for its arguments and full result;
  • the footer adds up model calls, tools, tokens and the total time.

Things to ask

  • "Start a six-aircraft free-for-all, four gunners and two rammers."
  • "Create three virtual aircraft: A flies a figure eight, evades first and may use global status; the other two only see, one rams A and one shoots A."
  • "Show the leaderboard by survival."
  • "Write a program that holds 1 m on SIM-1 and pass the hover challenge."
  • "Duel my hunter against hunter_hard over ten rounds."
  • "Switch the interface to Chinese and add two simulators."
  • At agent flight level Full: "Take off to 1 m, hover, go forward 1 m and back, turn 45° and land."

Keys and privacy

The key is stored encrypted in the app data folder (copilot-secrets.json, AES-256-GCM with a per-installation key, readable only by your user account) and never returns to the interface. The system keychain is an opt-in setting; Relay never asks for your login password. The endpoint receives only the conversation and tool results.

Copying and formatting

Replies render Markdown: headings, nested and task lists, tables with column alignment (they scroll sideways when wide), code blocks, quotes and links, which open in the system browser. Select any text in the conversation and copy it; right-click in any Relay window for Cut, Copy, Paste and Select All. Each reply has a copy button for its Markdown, tables copy as tab-separated text and code blocks copy their code.

Approvals

Every motion command and device write on a real aircraft (take-off, move, land, plans, re-fly, motor tests, calibration, arming, deploying a program and others) shows an approval card; nothing is sent until the operator approves, and 120 s without an answer counts as declined. Writing and testing programs needs no approval. Possession and stop work on Copilot exactly as on any agent.

Allow all

Allow all on an approval card (or Settings → Copilot → Allow all) approves that command and every later one on real aircraft without asking. The chat still records each one as approved automatically, and a red Allow all badge stays in the Copilot title bar while it is on; click it to turn it off. Relay's own gates do not change: preflight, Allow programs on this aircraft, possession and emergency stop. Hardware-in-the-loop starts and stops are never covered by Allow all: their approval card has no Allow all button.

Testing a program or a sequence with Copilot

Copilot can run the whole loop: write or copy a program (takeoff_hover_land is the plain take-off, hover and land), run its unit tests, deploy it with arm on a simulator, read the height, climb rate and motor output, retune its parameters live and deploy a new revision in the air. At the full flight level it also flies sequences with tuning {climb, hover} and retunes a flying sequence with relay_plan_tune. Ask for example: "Copy takeoff_hover_land, fly it to 2 m on sim-1 and raise hover until it holds height."

Timelines work the same way: relay_timeline_run flies an .ars timeline and reports its progress, relay_timeline_edit changes its trim or blocks in flight, relay_timeline_record turns a flight into a timeline and airframe_set {params: {level_trim_deg, with_assist: true}} gives a simulator the drift of the real aircraft. Ask for example: "Give sim-1 a 2° roll error in altitude hold, fly the take-off timeline and trim out the drift."

Clone this wiki locally