tangoai Code — VS Code coding agent
The agent is the asset. The model behind it is a setting.
One harness (tools, safety rules, approvals, context management, audit log) runs unchanged whether the model is
Qwen3.8‑27B on your own RTX 3090 or a frontier API.
Model (setting) Harness (this extension) Acts on
───────────────── ───────────────────────── ───────
local Qwen3.8-27B · Ollama ─┐ reads task, code, TANGOAI.md your workspace files
anthropic Claude · API ├─►plans + edits files (auto, diff/undo) ──► build / test commands
openai vLLM/LiteLLM/OpenAI ─┘ runs commands (you approve each) (deploy: not in v1)
verifies by running tests
1. GPU server (Ubuntu, 1× RTX 3080 + 2× RTX 3090) — once
cd ollama
sudo ./setup-agent-ollama.sh 192.168.1.0/24 # your LAN/VPN subnet
This creates a second Ollama instance for the agent, ollama-agent.service:
- It's pinned by UUID to one RTX 3090. Qwen3.8‑27B Q4_K_M needs about 18 GB, which a 3080 cannot hold.
- It listens on port 11435.
- The stock
ollama.service (port 11434, chat.tangoai.org) is moved to the 3080 plus the other 3090, so the two instances never contend for VRAM.
- It handles one request at a time, keeps the model resident, and uses a q8_0 KV cache, which gives a 49K context on 24 GB.
- If
ufw is active, port 11435 is opened to your subnet only. Ollama has no authentication, so never expose this port publicly.
At the end the script prints ollama ps. PROCESSOR must read 100% GPU. If it shows CPU, lower num_ctx in ollama/Modelfile.qwen38 to 40960 or 32768 and re-run ollama create. Then set tangoai.ollama.numCtx to the same number.
Qwen3.8 Ollama tag used: qwen3.8:27b (Q4_K_M). If you used the Unsloth GGUF instead, change the FROM line.
2. Install the extension: no settings needed
code --install-extension tangoai-code-0.6.2.vsix --force
Reload VS Code, open a folder, and click the tangoai icon. That's it:
- Finding Ollama: tangoai looks for Ollama on this PC by itself (ports 11435 and 11434). If Ollama runs on another PC, a box at the top of the panel asks for its address once and remembers it.
- Choosing a model: the dropdown lists the models on your Ollama server. Models that can't call tools are greyed out. Pick one and it's remembered.
- Context size: set automatically to 32K, or less if the model was trained for less.
- Thinking mode: used automatically when the model supports it.
- Claude: pick a Claude model in the same dropdown, and the first time it asks for your API key, which is stored securely in VS Code.
⟳ re-scans the server, for example after you ollama pull a new model. Everything in Settings → tangoai is optional and only needed to override the automatic choices.
Where your code goes
- Ollama models: prompts, file contents and command output go only to the Ollama server you connect to, on this PC or another PC you choose.
- Claude or OpenAI-compatible models: when you pick one, the same data is sent to that provider's API (
api.anthropic.com, or the endpoint in tangoai.openai.baseUrl) under your own API key.
- MCP servers: if you add any (see "Connect tools"), the arguments of each call you approve go to that server.
- API keys are kept in VS Code's secret storage. tangoai has no telemetry and sends nothing anywhere else.
3. Swap the model (the whole point)
Pick a different model in the dropdown, even mid-chat. The conversation continues on the new model, with the same tools and rules.
Skills and the helper (0.6)
Small local models have small context windows, so tangoai keeps knowledge out of the context until it's needed.
- Skills are folders with a
SKILL.md: a name, a one-line description saying when to use it, and
instructions. Only the name and description sit in the prompt (about 30 tokens each); the agent calls
load_skill to pull in the body when a task matches. Skills are found in, by precedence:
.tangoai/skills/ (this project), .agents/skills/ and .claude/skills/ (the same format, so existing Codex and
Claude Code skills work), ~/.tangoai/skills/ (yours, every project), then the built-in ones:
embedded-c-numerics, uds-diagnostics, log-triage-rca.
tangoai: New Skill creates one in the project; tangoai: Show Skills lists what the agent can load.
- The helper (
delegate tool) is a read-only second agent with its own empty context. The main agent gives it
one precise question ("find the first row where ilim_ma > 25000 in this 4,500-row log"); the helper searches and
reads, and only its short report comes back. Its reading never fills the main chat. It cannot edit files, run
commands or start another helper. Its steps show indented under the delegate card.
Turn either off with tangoai.skills.enabled / tangoai.delegate.enabled (both on by default).
The agent can use tools from any MCP server: mail, issue trackers, GitHub,
requirements and spec servers, HIL rigs. You add a server to a config file; there is no connector code per service.
Where servers come from (a server in an earlier file wins over one with the same name in a later file):
| File |
Scope |
.tangoai/mcp.json |
this project |
.mcp.json at the repo root |
this project, the same file Claude Code reads, so existing configs work unchanged |
~/.tangoai/mcp.json |
you, every project |
tangoai: Add MCP Server writes an entry for you. tangoai: Show MCP Servers shows each server's status and
tool count, and restarts one.
Example: GitHub (HTTP) and Gmail (local command) in .tangoai/mcp.json:
{
"mcpServers": {
"github": {
"url": "https://api.githubcopilot.com/mcp/",
"headers": { "Authorization": "Bearer ${env:GITHUB_TOKEN}" },
"description": "GitHub issues, pull requests and code search"
},
"gmail": {
"command": "npx",
"args": ["-y", "<your-gmail-mcp-server-package>"],
"env": { "GMAIL_CREDENTIALS": "${env:HOME}/.gmail-mcp/credentials.json" },
"description": "Read and search the team mailbox",
"readOnly": true
}
}
}
There are several Gmail MCP servers; put the package of the one you use in args, with the settings its README asks for.
command + args (+ env, cwd) runs a local server over stdio; url (+ headers) connects over streamable
HTTP. The old SSE transport is not supported.
- Keep tokens out of the file.
${env:VAR} (also ${VAR} and ${VAR:-default}) is filled in from your
environment when the server starts. Values from variables, env and headers are never written to logs or shown
in status.
- A local server gets only a minimal environment (PATH, HOME, ...) plus its own
env, not every variable you have set.
description is the one line the agent sees about the server. readOnly: true lets the read-only helper use it too.
"disabled": true turns a server off; timeoutSec sets the per-call timeout (default 120).
Small context, many tools. A 32K local model can't carry dozens of tool schemas on every turn, so the prompt gets
one line per server, and the agent calls mcp_tools to load a server's tools when a task needs them. Small servers
load in full; big ones list their tools first and the agent loads only the ones it needs. Once tangoai has seen a
server's tools, it remembers them; if all servers' tools together fit in tangoai.mcp.inlineSchemaTokens
(default 2000 tokens), they go in the prompt directly and mcp_tools isn't needed. Tool results are text only and
are cut to the same 15%-of-window limit as any other tool output.
Safety. MCP tools act outside your workspace, so every call asks for your approval in the panel, showing the
server, tool and arguments. To let some calls run without asking, allowlist them in .tangoai/policy.json:
{ "autoApproveMcp": ["github__get_*", "github__search_*", "gmail__read_*"] }
Patterns are <server>__<tool> with * as a wildcard. The agent cannot edit .tangoai/mcp.json, .mcp.json or
.tangoai/policy.json, so it can't add servers or approve itself. Every call is logged to .tangoai/logs with
server, tool, result and duration. Tokens and other values from your MCP config are never written to logs.
Servers start the first time the agent uses them, restart once if they crash (the agent is told a crashed call may or
may not have taken effect), and stop on New Chat. Turn MCP off with tangoai.mcp.enabled.
What the harness enforces (same for every model)
|
|
| Read / search / list |
automatic, workspace only |
| Edit / create files |
automatic, must read a file before editing it. Every change is listed with a diff button and Undo all |
| Shell commands |
you approve each one, except allowlisted prefixes (git status, git diff, ls, plus tangoai.autoApproveCommands). Chained or redirected commands always ask |
| Always blocked |
sudo, rm -rf //~, disk formatting, force-push, git reset --hard, curl … \| bash, fork bombs |
| Protected paths |
.git/, .env*, .tangoai/policy.json |
| Outside workspace |
refused |
| Loops |
the same call 3× in a row triggers a nudge to change approach; capped at tangoai.maxTurns (40) |
| Context |
each file read is at most 400 lines; each tool result at most 15% of the window; older output is condensed when the prompt reaches 60%, always leaving at least 6K tokens for thinking and the reply. A reply cut off mid-thinking is retried instead of ending the task |
| Local-model quirks |
tool calls that Qwen writes as <tool_call>…</tool_call> text are recovered automatically |
Extend the rules per repository in .tangoai/policy.json:
{ "blockedCommands": [{ "pattern": "npm publish", "reason": "Releases go through CI." }],
"protectedPaths": ["^migrations/"],
"autoApproveCommands": ["npm test", "pytest -q"] }
Add project instructions in a TANGOAI.md (or AGENTS.md) at the repository root, such as how to build, how to test, and conventions. They are injected into the system prompt.
Comparing Qwen vs. Claude on the same task
Every request, tool call, error and token count is appended to .tangoai/logs/YYYY-MM-DD.jsonl, tagged with profile and model. Run the same task under both profiles, then compare steps, failed tool calls and wall time:
jq -s 'group_by(.model) | map({model: .[0].model,
steps: map(select(.event=="tool")) | length,
failed: map(select(.event=="tool" and .ok==false)) | length,
ms: map(select(.event=="done").ms) | add})' .tangoai/logs/*.jsonl
Develop
npm install
npm test # compiles, then runs the agent loop, discovery and exam runner end-to-end against mock Ollama servers
npm run exam:selftest # proves every exam task fails as shipped and passes with its reference solution
npm run test:harnesses # Linux + bubblewrap: every installed harness runs sandboxed against a fake model
npm run package # bundles src/extension.ts into dist/ (esbuild) and builds tangoai-code-x.y.z.vsix
Press F5 in VS Code with this folder open to launch an Extension Development Host.
src/core/ model-agnostic harness, no VS Code imports (testable headless)
agent.ts loop, loop detection, context compaction, delegate helper
providers.ts Ollama (native /api/chat, streaming, thinking), Anthropic, OpenAI-compatible
tools.ts list_files, search, read_file, edit_file, write_file, run_command, load_skill, delegate spec
skills.ts skill discovery (project, .agents, .claude, user, built-in), index, load_skill
mcp.ts MCP client: config, server lifecycle, per-server index, mcp_tools, approval, result formatting
policy.ts blocked commands, protected paths, auto-approve rules (commands and MCP tools)
prompt.ts short rule-style system prompt + TANGOAI.md
discovery.ts finds Ollama, lists tool-capable models, picks context size
exam.ts exam runner: tasks, hidden-test grading, fingerprints, reports, leaderboard, holdout ledger
harnesses.ts other harnesses (Claude Code, Codex CLI, OpenCode, Pi, Qwen Code, Hermes, DeepSeek Harness, Aider, Harness²), bubblewrap sandbox, shared model
stats.ts Wilson intervals, exact McNemar test, per-harness scores
src/extension.ts sidebar view, approvals, diff/undo, model dropdown, MCP commands, secrets, audit log
skills/ built-in skills: embedded-c-numerics, uds-diagnostics, log-triage-rca
eval/ the exam (CLI only for now, not in the extension): tasks/, run.js, bench.sh, report.js, compare.js
media/ webview UI (plain JS/CSS)
ollama/ GPU-server setup + Modelfile
Next
- MCP client: connect Jira, RV&S, a spec server or HIL tools through
.tangoai/mcp.json instead of built-in
tools, each tool behind the same approval policy.
- Specialist skills from your team: MISRA review, ASPICE work products, your HIL log formats, as project skills.
Not in v1
- Deploy steps. Add them later as an approved command, or as a tool behind its own policy.
- Streaming for the Anthropic and OpenAI profiles. Ollama streams; the others return each step whole.
- Inline editor completions. This is a chat agent, not autocomplete.