All pages
On this page

Cursor

The Cursor provider runs Cursor's agent on the relay's machine, through the Cursor Agent SDK. OAR starts one worker process per conversation. The agent works in the conversation's working folder, with your Cursor account's models. Unlike Claude, it does not use a login on the machine: you give OAR a Cursor API key.

This page covers what is particular to Cursor. The chat, the queue and the file browser work as for every provider; see Providers at a glance for how Cursor compares.

What you need #

  • A Cursor API key. You paste it into OAR once; see Switching it on.
  • Nothing to install. Cursor needs no CLI and no Cursor app on the machine, so the Cursor sub-tab has no CLI row.

Where things live:

What Where
The agent A worker process on the relay's machine, one per conversation, in the conversation's working folder.
The API key In the relay's database on that machine. The panel never shows it again, and it is not sent to browsers.
The agent's own state A folder per conversation, created on the conversation's first turn. Session in the file browser opens it.

By default the state folders are under cursor-agents in the relay's data folder: ~/.oar/data/cursor-agents (%APPDATA%\oar\data\cursor-agents on Windows) on a global install, server/data/cursor-agents in a git checkout. Added in 0.9.14 Before 0.9.14 a global install kept them inside the package folder, which an update replaces, so a conversation could lose its agent; a conversation whose folder is still there keeps using it. CURSOR_AGENT_STORE_DIR moves them; see Environment variables.

Switching it on #

Open Settings → Providers → Cursor. The panel is headed Cursor SDK.

Control Default What it does
Enable Cursor for New Chat model selection on once a key is saved Offers Cursor in New Chat. It cannot be ticked before a key is saved.
Cursor API key (the field shows Cursor API key…) empty Your key. Once saved, the field reads Saved API key (enter to replace). Leave it empty to keep the saved key.
Cursor model ID composer-2.5 The model a new Cursor conversation starts with. An empty field means composer-2.5.
Save Cursor settings Saves the key and the model. A new key switches Cursor on the first time.
Remove saved key Asks to confirm, then deletes the key, the discovered models and your Select Models choice, and switches Cursor off. The model ID stays.

The status line under the fields says where you are:

Status Meaning
Not configured. New conversations use GitHub Copilot. No key is saved.
API key saved but currently disabled. Enable it to allow Cursor selection in New Chat. A key is saved and the switch is off.
Cursor is enabled. Select Cursor in New Chat to use it. Ready.

What saving does:

  • Model discovery. When Cursor is switched on and you save a new key, or change the model, or switch it on again, OAR asks Cursor for the models your key can use, and for each model's reasoning options. The request gives up after 20 seconds. A failure shows as a warning in the notice, for example Cursor model discovery failed: …. Until a discovery succeeds, the list holds only the default model.
  • Changing the key. Saving a new key clears the discovered models and, if Cursor is on, runs discovery again. When a key was already saved, the relay also stops every Cursor worker, including one in the middle of a turn, so save a new key between turns. The workers start again with the new key on the next message.
  • Removing the key is refused while any Cursor conversation has sent a message or has messages queued: Cannot remove Cursor API key while N active Cursor conversation(s) still exist. Disable Cursor for new conversations instead. So no running turn is affected by a removal. Switch Cursor off instead. When the removal goes through, conversations that have not sent a message yet move back to Copilot. Switching Cursor off does not move them.

Then start a conversation as usual: in New Chat, pick the provider Cursor SDK. See Starting a conversation.

Models and effort #

Where the list comes from. From Cursor itself, through your key, at the moments listed above. 🤗 Select Models → Cursor SDK chooses which of them the composer offers; 💾 Save enabled models keeps the choice, and Refresh runs discovery again. With no choice made, all discovered models are offered. The model in Cursor model ID is always offered.

Per message. A conversation can change model and effort from one message to the next; Cursor model IDs are used as Cursor spells them. An ID that is not among the models offered to you (the enabled ones, plus Cursor model ID and the conversation's own model) is refused with Cursor model "…" is not available.

Effort. The effort choices come from the model, as it lists them. OAR knows these levels: none, low, medium, high, xhigh and max. Cursor's extra-high appears as xhigh. A level OAR does not know is not offered.

  • none is always in the list. If the model can switch reasoning off, none does that. If it cannot, the composer shows the entry as default, and the model runs as it normally does.
  • A model that lists no effort has only none, shown as default.
  • On a model that has a thinking switch, choosing a level turns thinking on and none turns it off.

Sub-agents on other models. Cursor's built-in sub-agent menu offers only a couple of models. OAR therefore declares one sub-agent per model you have enabled in Select Models, so the agent can hand a task to, say, a Grok or GPT model. Names use dashes (grok-4.5 becomes grok-4-5). A sub-agent runs its model's default variant: it cannot be given an effort. Changing the selection takes effect on the next message.

How OAR's features work on Cursor #

Feature On Cursor
Relay modes plan runs in the SDK's own plan mode. agent is the normal mode. ask and autopilot put a [Relay mode: …] line in front of your message when the mode changes. See Relay modes.
Question cards Through OAR's own ask_user tool, which the agent is told is the only way to ask you anything. Up to 4 questions, 2 to 6 options each, optional multi-select. A question written as plain reply text does not become a card. See ask_user.
Plan board Cursor has no exit-plan step. In plan mode, when the final reply has at least two bullet or numbered lines, OAR shows Plan ready for review with Implement in autopilot, Stop here and prompt myself and Stop here. A plan written as prose gets no board.
Steering and queueing No steering. A message sent during a turn waits behind it, and the send button reads Queue. See Turns and the queue. Stop ends the running turn, also while the agent waits for your answer to a question.
Background tasks No task panel. When the agent starts background work, an activity line reads Background task <status>: ….
Sub-agents Each shows as a sub-agent with its start and end, and its text, thoughts and tool calls appear in the viewer. One level only: a sub-agent's own sub-agents are not shown. Stop ends the whole turn, not one sub-agent.
Attachments Images up to 5 MB go to the agent inside the message. Larger images and other files are given as a path in the message for the agent to read.
Context display The 🧠 button shows a total and a percentage of the model's window, with no categories. When a turn made several model calls, the figure is an estimate and says so. The window comes from the model's listing, or from a built-in table when the listing has none.
Compaction OAR neither sets nor shows an automatic compaction. /compact works as on every provider. See Compacting a conversation.
Resuming The relay stores the Cursor agent's ID and resumes that agent after a restart or after the worker's handle was closed. If the agent cannot be resumed, a new one is created. See Restarts and resuming.
Agent tools preview and relay_tool are given to the agent as tools. relay_tool is there only when the relay has paired relays or agent sessions are switched on. See Agent tools and Agent sessions.

Cursor's own project rules, sub-agent files and MCP servers in the working folder's .cursor folder are not loaded. OAR defines the agent's tools and sub-agents itself.

A long-idle agent #

A Cursor agent that has not been used for 30 minutes is closed and reopened on the next message, because its sign-in goes stale after a few idle hours. You do not see this. If the sign-in has gone stale anyway, OAR rebuilds the agent and sends the message again, up to twice, and adds the activity line Cursor session re-authenticated; retrying this message on a fresh agent handle. A third failure ends the turn with the sign-in message in If it does not work.

Usage #

Cursor turns have no usage line under the reply. 📊 Check Usage has a Cursor card. While Cursor is off it reads Cursor is not enabled in provider settings. Its figures come from two sources, and the card says which one it used.

Spend from OAR, an estimate. After each turn OAR reads the agent's billed spend from Cursor and books the increase to the current billing cycle. It files each turn under the pool of the model that ran it:

Pool Models
Cursor Models Names that start with composer, cursor-, cheetah or sonic, or contain grok.
Other Models Names that contain claude, sonnet, opus, haiku, fable, codex, gemini, deepseek, kimi, qwen, llama, mistral or minimax, or start with gpt, glm, or o and a digit.
Unclassified auto, cost, balance, intelligence, any name containing router, and every name that fits neither pool above. Shown only when there is spend, with a note that Cursor does not say which pool served it.

Matching ignores case, and the router names are checked first.

Cursor does not tell the SDK what your plan includes. You enter that:

Control Default What it does
Cursor Models pool (USD) empty The monthly allowance of that pool. An empty field clears it, and the card shows spend only.
Other Models pool (USD) empty The same for the other pool.
Billing resets on day of month 1 The day the cycle restarts, 1 to 31. In a month with fewer days, the last day of the month is used.
Save allowances Saves the three fields.
Reset tracked spend Asks to confirm, saves the three fields, then clears the current cycle's totals. Use it after changing plan or account. OAR starts counting from the agent's current totals, so past spend is not counted twice.

The meters measure the raw model cost against your allowance. The card also lists what Cursor actually charged, which is often zero for plan-included use. All of these figures are estimates. A cost that Cursor reports late is booked with the turn that sees it. Cursor's own Spending dashboard is the authoritative source, and the card links to it.

Live plan bars, from the dashboard. With a dashboard session token, the card adds Plan usage (total), Auto + Composer and API bars read live from Cursor's dashboard, the plan name, the included and on-demand spend, and the cycle's real dates. The local pool meters then move back to secondary. The token is a session cookie, not the API key, and the API key cannot read these figures.

Control What it does
Dashboard session token (live plan bars) The WorkosCursorSessionToken cookie value from a logged-in cursor.com tab (in the browser's developer tools under Application → Cookies).
Save token Saves it. The field takes no spaces and at most 8192 characters.
Remove Asks to confirm, then deletes the token you saved. A token from the environment or the Cursor app stays in use.

OAR looks for a token in this order:

  1. The one you saved.
  2. CURSOR_SESSION_TOKEN in the relay's environment, for hosts with no Cursor app.
  3. The login of the Cursor app on the relay's machine, read from its local state with no setup.

The status line under the field names the source in use. The token stays on the relay and is never sent to a browser. If Cursor does not accept the token, the card falls back to the estimates and says which source was rejected, or that no token was found.

An agent can read the same figures with relay_tool's usage action.

Environment variables #

Set these in the environment the relay starts in.

Variable Effect
CURSOR_SESSION_TOKEN The dashboard session token for the live plan bars. A token you saved in the panel wins over it; it wins over the Cursor app's login.
CURSOR_AGENT_STORE_DIR The folder that holds the per-conversation agent state, instead of cursor-agents in the relay's data folder. The Session button follows it.
OAR_TURN_STALL_IDLE_MS, OAR_TURN_STALL_MODEL_MS, OAR_TURN_STALL_TOOL_MS How long a Cursor turn may be silent before it fails: 120 s with nothing in flight, 5 minutes during a model request, 30 minutes during a tool call; 0 means no limit. See Turns and the queue. Not handed on to the agent where sessions run under tmux: see which variables reach the agents.

The API key cannot be set this way: the relay passes its workers the key from the panel and ignores a CURSOR_API_KEY in its own environment.

Limits #

Beyond the gaps in the table above (no steering, no task panel, no compaction setting, one sub-agent level):

  • Question cards depend on the agent calling ask_user.
  • Spend and allowances are estimates. Only the dashboard bars come from Cursor.
  • A usage limit on your Cursor plan does not pause the conversation. The turn fails like any failed turn, and you send the message again.

If it does not work #

What you see Why, and what to do
The reply says System note: the Cursor runtime could not authenticate (…). Set or renew the Cursor API key in provider settings, then retry. Cursor refused the key, also after OAR rebuilt the agent twice. Paste a valid key under Settings → Providers → Cursor and save.
New Chat has no Cursor, or starting fails with Cursor API key is not configured No key is saved. Save one.
The status line reads API key saved but currently disabled. Tick Enable Cursor for New Chat model selection.
Cursor model discovery failed: … or Cursor model discovery returned no models after saving The key is wrong, or Cursor did not answer within 20 seconds. Check the key and save again, or use Refresh in 🤗 Select Models. A refresh that fails there says Cursor model discovery failed. Cached Cursor models were kept: ….
Cursor model "…" is not available The model is not on the list for your key. Refresh the list, or pick another model.
Invalid Cursor model ID Cursor model ID holds characters that are not allowed in a model ID. Copy the ID from the model list.
System note: the Cursor runtime sent nothing for Ns while a model request was running, so the relay ended the turn. The turn was silent past its window (see Environment variables) and OAR cancelled it. Send the message again. See Turns and the queue.
The same, … while a tool was running (…) A command ran silently for 30 minutes. Raise OAR_TURN_STALL_TOOL_MS, or set it to 0 for no limit.
System note: the turn completed without a text reply. The agent finished without writing anything. Ask it what it did.
Cannot remove Cursor API key while N active Cursor conversation(s) still exist. Archive or delete those conversations, or switch Cursor off instead.
The Cursor card in Check Usage shows only estimates, and says no token was found The relay's machine has no Cursor app login. Paste a token under Dashboard session token, or set CURSOR_SESSION_TOKEN.
Live plan bars unavailable — Cursor did not accept … The token has expired. Sign in to the Cursor app again, or save a fresh token.
That does not look like a WorkosCursorSessionToken cookie value The pasted text has a space or line break in it, or is longer than 8192 characters. Copy only the cookie's value.
The Session button is greyed out The conversation has not had a turn yet.