Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

README.md

47 lines3.2 KB

MCP tool use

Replays small fake threads on Claude and Codex models and checks how they use T3's MCP tools: delegation, PR linking, previews, scheduling, and more. Each case reproduces a real mistake an agent made in T3 Code.

The model sees what it sees in T3 Code. A trimmed capture of a real harness turn supplies the harness prompt and native tools. T3's instructions, tool descriptions, and schemas come from this checkout. A cheap model plays the shell, so nothing runs on your machine.

Run

cd evals
pnpm mcp-tool-use --case review-round-uses-thread-send --samples 1 --out runs/check
pnpm mcp-tool-use --model claude-opus-5-5 --out runs/opus
  • ANTHROPIC_API_KEY in the repo root .env pays for Claude models and the Haiku shell simulator.
  • Codex models (gpt-* in MODELS in run.ts) go through a CLIProxyAPI server, set up as the vibeproxy model provider in ~/.codex/config.toml. Keep the proxy under about 12 samples in flight across all runs.
  • Flags: --case <ids>, --cases <file.ndjson>, --samples <n> (default 2, and a 3rd when the first 2 disagree), --concurrency <n> (samples in flight, default 8), --max-steps <n>, --effort <level>, --dry-run (prints request bodies, no model calls), and --context (prints the size of T3's text and schemas, no key needed).
  • --baseline <results.jsonl> --stop-on-regression stops as soon as a case that passed every baseline sample fails. Use it to test one copy change against a baseline run.
  • Cost: a full Sonnet run is about $9, and a full Opus run about $17. Codex models through the proxy cost only the shell simulator.

Add a case

Cases are JSON lines in cases/, one file per area. The case schema in run.ts (McpToolUseCase) documents every field.

  • kind: bad reproduces a mistake, guard protects correct behavior, control is ordinary work.
  • experience: the real mistake, in a sentence. source: where it happened.
  • setup: the fake thread, its world (repo, branch, files, PRs, pages), priorTurns, and mocks for tool results.
  • expect: the checks, such as calls, callsMustNot, maxCalls, order, textMust, and linked.

Check that the case builds with --dry-run --case <id>. Then run it on the text before your fix, where it must fail, and on the text after, where it must pass.

Where T3's text lives

  • packages/provider-core/src/server/runtimeInstructions.ts
  • packages/provider-core/src/server/orchestrationInstructions.ts
  • apps/server/src/provider/CodexDeveloperInstructions.ts
  • apps/server/src/mcp/toolkits/*/tools.ts (tool descriptions)
  • packages/contracts/src/*Mcp.ts (parameter descriptions and result text)

Templates

templates/ holds one trimmed capture per harness. Refresh them when a harness changes its prompt or native tools:

  1. Capture one T3 Code turn through CLIProxyAPI, with T3's MCP server connected.
  2. From evals/, run pnpm mcp-tool-use:trim-capture <claude|codex> <capture.json> mcp-tool-use/templates/<claude|codex>.json.gz. It keeps only what run.ts reads, and removes user instructions, the user's own skills and agents, account ids, and home paths.
  3. Read the output for user data before you commit it: zcat <file> | less.
  4. Run the full eval on the old and new templates, and compare.