JetbrainsOlga BedrinaAnnouncement
Run AI Agents in TeamCity
Summary
The new experimental AI Agents plugin for TeamCity lets you run Codex and Claude Code directly in CI/CD builds. The plugin handles setup by connecting to LLM providers such as OpenAI, Anthropic, OpenRouter, LiteLLM, or JetBrains Air. It installs the coding agent on the build agent if needed and provides provider credentials only for the build duration. The plugin collects usage statistics including prompt, completion, cached, and total token counts, and records agent trajectories in HTML and JSON formats. Trajectories are available as hidden build artifacts and can be analyzed programmatically to debug agent behavior and improve prompts.
Context
AI coding agents are typically run on a developer’s machine, but the new experimental AI Agents plugin for TeamCity enables running Codex and Claude Code directly in CI/CD builds to review code, investigate failed builds, update documentation, or handle other repository tasks.
Approach / What changed
The plugin stores LLM provider credentials as a TeamCity connection, installs Codex or Claude Code on the build agent if needed, provides credentials only for the build duration, and collects usage statistics and agent trajectories as hidden build artifacts.
Takeaways
The AI Agents plugin stores LLM provider credentials as a TeamCity connection and provides them to the build agent only for the duration of the build, then removes them.
The plugin automatically installs Codex or Claude Code on the build agent if the selected client is not already available when a build starts.
Agent trajectories are recorded in HTML for readable inspection and JSON for programmatic analysis, enabling a feedback loop to adjust prompts based on multiple build runs.
FAQ
How does the plugin keep provider credentials secure?
The plugin stores your provider credentials as a TeamCity connection and provides them to the build agent only for the duration of the build, removing them afterward. This keeps credentials off reused build agents and reduces security risk.
How can I inspect what an AI agent did during a build?
The plugin records the agent trajectory in HTML for a readable view of messages, tool calls, and token usage, and in JSON for programmatic analysis. You can use a local coding agent with the TeamCity CLI to retrieve trajectories from multiple builds and analyze them in batches.
How does the plugin help track AI token usage and costs?
The plugin collects prompt, completion, cached, and total token counts as TeamCity statistical values. Because these are regular TeamCity statistics, you can track AI usage over time, create charts, and spot unexpected changes in token consumption to investigate possible cost anomalies.
Source and freshness
- Source
- blog.jetbrains.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.