Xena for VS Code
Xena — Xytro Labs' AI — inside your editor. It registers as a Language Model Chat
Provider, so it shows up in GitHub Copilot Chat's model picker alongside the
built-in models, and it adds an @xena chat participant plus a live balance meter.
Powered by the Xena gateway at https://ai.xytro.site.
What you get
| Feature |
Where |
| Xena in Copilot Chat |
Copilot Chat's model picker → Xena (Xytro Labs) |
@xena participant |
Chat: @xena explain this, @xena /review |
| Balance & usage |
Status bar → click for the full breakdown |
| Model switching |
Xena: Change Model |
| Sign in / out |
Xena: Set API Key / Xena: Sign Out |
Models
The picker is populated live from GET /v1/models, so whatever your key is entitled
to is what appears. Chat-capable rows only — the image, voice and embedding products
are filtered out.
- Xena — the flagship. 64K context, fast, 10x cheaper than the big models.
- Xael Turbo / Think / ThinkXL — 256K to 1M context, general reasoning.
- Yoshi Coder / Coder Plus / Coder Pro — agentic coding, up to 1M context.
- Xena Pro — the premium tier.
- WALLY — auto-router: picks a model per request and is 25% off whatever it picks.
Installation
Xena ships as a .vsix file. VS Code 1.104 or newer is required — that is the
release that exposes the LanguageModelChatProvider API, which is how Xena appears in
Copilot Chat's model picker.
The extension declares engines.vscode: ^1.104.0, so VS Code will refuse to install
it on anything older rather than install a broken copy. Upgrade VS Code first
(Help → About shows the version; Check for Updates to move forward).
Option A — install from the file (recommended)
- Download
xena-vscode-<version>.vsix.
- In VS Code: Extensions view → the
... menu at the top right →
Install from VSIX… → pick the file.
- Reload the window when prompted.
Or from a terminal, in the folder that holds the file (the version in the name
changes with each release, so * is deliberate):
code --install-extension xena-vscode-*.vsix
On a headless or remote setup, install it on the machine running VS Code Server:
code --install-extension xena-vscode-*.vsix --force
--force overwrites an existing install, which is what you want when upgrading.
Option B — build it yourself
From the folder containing this README:
npm install
npm run compile # tsc -> out/
npm run package # -> xena-vscode-<version>.vsix
Then install the generated .vsix as in Option A. The build needs only Node 20+ and
no runtime dependencies — the extension talks to the gateway with fetch.
Verify the install
Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and run
Xena: Manage API Key & Models. You should see the menu with Set API key,
Balance & usage and Change model. If the command is missing, the extension did
not load — check Extensions → Xena is enabled, and run Xena: Show Logs once
you can see it.
To confirm the Copilot Chat integration specifically, open Copilot Chat and click the
model picker: Xena (Xytro Labs) should be listed as a provider. If it is not,
run Xena: Refresh Model List and check the log for
"could not register the Copilot Chat provider" (that line means VS Code is too old).
Uninstall
Extensions view → Xena → Uninstall. To also remove the stored key:
run Xena: Sign Out (Clear API Key) first — uninstalling an extension can leave
its SecretStorage entry behind.
Getting started
- Get a key. Create one free at xena.xytro.site — it
starts with
xena_, and the first key comes with a $1 credit.
- Add it to VS Code. Run
Xena: Set API Key from the Command Palette and
paste it. The key is stored in VS Code's SecretStorage, not in settings.json.
- Use it. Open Copilot Chat, click the model picker, and choose a Xena model —
or type
@xena in any chat.
The status bar shows your balance as credits (1 credit = $0.0001, so $1 = 10,000
credits). Click it for spend, request counts and your weekly allowance.
Seeing what it did
Two things are surfaced so a long tool-using turn is not a black box.
Reasoning
When the model exposes a reasoning trace, it appears in a collapsed
💭 Reasoning block above the answer — expand it to see how the model got there.
It is collapsed because the trace is not the answer and should not push it down.
Availability comes from the model, not the extension (measured 2026-11-10):
| Model |
Trace |
| Xena Pro |
yes (~380 chars) |
| Xael Think |
yes |
| Xena |
yes (short) |
| Xael Turbo, Yoshi Coder Plus |
none |
So the feature is best-effort: it renders a trace when one arrives and says nothing
when it does not. Turn it off with xena.showReasoning.
What changed
A tool-using reply ends with an account of the work:
- a one-line note naming the files changed — Changed
src/a.ts, src/b.ts.
- a collapsed What I did list of every step, with repeats counted
(
read src/a.ts ×2) and failures marked failed.
It is derived from the tool calls that actually ran, not from asking the model for a
summary, so it cannot describe work that did not happen. Read-only turns print no
change note, and an edit that failed never claims the file was changed.
Turn it off with xena.explainChanges.
Commands
| Command |
What it does |
Xena: Manage API Key & Models |
One menu for everything |
Xena: Set API Key |
Paste a key; verifies it and shows the balance |
Xena: Sign Out (Clear API Key) |
Removes the key from this machine |
Xena: Show Balance & Usage |
Opens a report with requests, tokens and cache hit rate |
Xena: Change Model |
Sets the default model for @xena |
Xena: Refresh Model List |
Re-pulls the catalogue |
Xena: Pick Model for Copilot Chat |
Shows a model's context and pricing |
Xena: Open Dashboard / Get an API Key |
Opens the browser |
Xena: Show Logs |
The extension's diagnostic log |
Participant commands
@xena /explain, /fix, /test, /docs, /review — each operates on your
selection, or the active file when nothing is selected.
Model escalation
When @xena is getting nowhere, it asks before spending more.
Each model sits in a ladder. If a task fails in a way a bigger model can fix, Xena
offers the next rung — and shows the price change first:
Xena → Xena Pro
Xael Turbo → Xael Think → Xael Think XL
Yoshi Coder → Yoshi Coder Plus → Yoshi Coder Pro
You get a dialog like:
Xena: Xena is struggling — escalate to Xena Pro?
It produced tool calls that could not be executed.
xena: $0.15/1M in, $0.30/1M out → xena-pro: $0.25/1M in, $0.50/1M out
That is 1.67x the input rate and 1.67x the output rate, for the rest of this task.
It never upgrades silently. Approving applies to the rest of the task, so a long
agent loop asks once — not on every turn. You can decline, or say Don't ask again
this session.
What counts as "struggling"
There are two modes, because an agent can fail loudly or just go nowhere.
Hard failures — something actually broke:
| Trigger |
Strength |
The gateway reported a malformed tool call (MALFORMED_TOOL_CALL) |
hard |
| No tool-capable model could run the agentic request |
hard |
The task exceeds the model's context window (CONTEXT_TOO_LONG) |
hard |
| The same tool failed twice in one turn |
hard |
| The model said it could not complete the change and left tools unfinished |
soft |
No progress — every step "succeeds" but the task does not move:
| Trigger |
Strength |
| The same tool call repeated twice in a row with nothing new |
hard |
| A tool failed and the model did not retry |
soft |
| The same non-answer twice, after you asked for something different |
soft |
| Asked to change code, answered in prose or with only a stub/placeholder |
soft |
| A hedged non-answer ("that would depend on…", "there are many ways…") |
soft |
| The model says it could not make the change ("I'm having trouble applying…") |
soft |
The second group is the case with no error to detect. Re-reading the same file,
rewriting the same block, or repeating the same explanation all return HTTP 200 — so
the signal is repetition, not failure. Repeats are compared on normalised
arguments, so {a,b} and {b,a} count as the same work.
Code is assessed, not exempted. Showing a fenced block is not proof of work. A
reply containing only a TODO, "your code here", a pass/not implemented body, a
single trivial line, or a block cut off mid-way (an unclosed fence) counts as a stub,
and the offer still appears. Substantive code does not trigger escalation.
Why it leans eager
You approve every escalation, so a false positive costs one dismissed dialog —
while a late catch costs you another round of prompting a stuck agent. The detector is
therefore biased toward catching:
- one repeated step is enough (not three rounds);
- a single turn that ignored a request to change code is enough;
- the phrase list covers the common ways a model admits defeat, not one exact
sentence.
The precision that remains matters: a legitimate clarifying question ("which file
should I change?") is never a stall — the model is waiting, not stuck. A comparison
rule still requires two turns, because one turn cannot be "the same as before", and
ordinary statements like "I can't browse the web" still don't count.
Deliberately not triggers: quota (429), balance (402), bad key (401), network
errors and policy refusals. Escalating cannot fix a quota, and offering a paid handoff
that will also fail is worse than saying nothing.
Run Xena: Show Model Escalation Ladders to see the chains with live prices.
Switch it off with xena.escalation.enabled.
Settings
| Setting |
Default |
Notes |
xena.baseUrl |
https://ai.xytro.site/v1 |
Point at a self-hosted Xael gateway if you run one |
xena.defaultModel |
xena |
Used by @xena |
xena.maxOutputTokens |
16384 |
The gateway accepts up to 32768 |
xena.enableLightweightTools |
true |
Gives @xena VS Code's read_file, list_dir, file_search, grep_search |
xena.useManagedTools |
false |
Answer without the editor tool loop |
xena.reasoningEffort |
empty |
Leave empty to keep each model's tuned default |
xena.escalation.enabled |
true |
Offer a handoff to a more capable model when struggling |
xena.escalation.showPrice |
true |
Show the rate change in the escalation prompt |
xena.showReasoning |
true |
Show the reasoning trace, collapsed, above the answer |
xena.explainChanges |
true |
End a tool-using reply with an account of what changed |
xena.statusBar |
true |
Show the balance item |
xena.balancePollMinutes |
5 |
0 disables polling |
xena.requestTimeoutMs |
120000 |
|
xena.connectTimeoutMs |
15000 |
|
How it works
The gateway is OpenAI-compatible, and this extension is a thin, dependency-free
client over it — no SDK, no bundled runtime.
Copilot Chat ──► Xena LanguageModelChatProvider ──► POST /v1/chat/completions
▲ │ (SSE)
└──────────── LanguageModelTextPart / ToolCallPart ◄────────┘
Two translations are where this kind of extension usually breaks, so both are explicit:
- VS Code message parts → OpenAI messages. Tool results travel in user-role
messages in the VS Code API; they are collected first and re-emitted as
role: "tool" entries directly after the assistant turn that requested them, with
their original call ids. Get this wrong and the provider rejects the conversation.
- SSE → response parts. Tool calls stream index-keyed with fragmented argument
JSON, so fragments are accumulated per index and flushed on
finish_reason: "tool_calls". delta.reasoning_content is discarded — it is not
the answer.
The caller owns the tool loop: the model returns tool calls, VS Code executes
them, and the next request carries the results.
Troubleshooting
Models don't appear. Run Xena: Refresh Model List and check Xena: Show Logs.
If it says "could not register the Copilot Chat provider", your VS Code is older
than 1.104 — update it.
"Xena rejected the API key." Re-run Xena: Set API Key. Keys start with xena_.
"Xena could not bill this request." Your balance is exhausted. The weekly
allowance (shown in the status bar tooltip) may still cover you, and the dashboard
has the top-up options.
Replies stop mid-sentence. Hitting maxOutputTokens. Raise it, or ask for a
smaller change.
Development
npm install
npm run compile # tsc -> out/
node smoke.mjs # 17 live checks against the gateway
npm run package # -> xena-vscode-<version>.vsix
smoke.mjs needs an API key: set XENA_API_KEY, or have it in a sibling .env.
It verifies the catalogue, balance, streaming, a real tool call, and tool-result
replay — the four things that silently break.
MIT © Xytro Labs