Skip to main content
Back to timeline
langchain.comSource publication:

LangSmith ties coding-agent spend to pull requests: what each merged PR cost, and which spend produced none

Synopsis

LangSmith released spend reporting for coding agents that automatically attributes the cost of each trace to the GitHub pull requests or GitLab merge requests that agent contributed to, so teams can see what a merged PR cost and how much spend never led to one, with PR-less sessions tracked separately as unattributed. Previously teams relied on usage analytics and AI consumption, or on per-trace cost one trace at a time, which did not show what tokens produced. The feature is in public beta on LangSmith Cloud and supports Claude Code, Codex, Cursor, GitHub Copilot in VS Code and Deep Agents.

Source-provided article image: LangSmith for Coding Agents: Now track spend by outcome
langchain.com

Interpretation

Coding-agent spend can now be settled by outcome: LangSmith attributes the spend in each trace to the pull requests that agent contributed to, so a team can see what a merged PR cost and how much spend never led to one. Teams trying to understand coding-agent ROI previously looked at high-level data such as usage analytics and AI consumption, which does not show what tokens actually produce; LangSmith itself offered cost per trace one trace at a time, useful for manual debugging but not for trends across a team. A new coding agent overview page aggregates those costs and ties them to the pull requests the agents worked on, breaking spend down by PR state (open, closed or merged) and tracking sessions that never led to a PR separately as unattributed.

The attribution reflects how agents are actually used, covering both a single thread that opens several PRs and a PR that takes several threads to finish, so the data shows what agents accomplished and what it cost. Coding agents are the first specialized agent type on the LangSmith Agent Platform, where each agent has its own record and belongs to an agent type that determines its dashboard, connected data and evaluation. LangSmith already traced coding agents across model providers including Claude Code and Codex; the feature supports Claude Code, OpenAI Codex, Cursor, GitHub Copilot in VS Code and teams building custom agents with Deep Agents, rolling spend and PR outcomes into one dashboard.

The dashboard also labels each thread by the kind of work it asks for, such as features, bug fixes, investigation and code review, and shows the share of threads and cost for each type, which helps explain unattributed spend. Merged pull requests are a useful signal but not the only sign of productive work, since coding agents are also used to review code and investigate problems, work that does not always end in a PR. Every metric links back to the threads and sessions behind it so the exact conversation can be opened; the dashboard also shows which skills agents call, the most expensive PRs, and how cost scales with conversation length.

Perspective

The feature targets engineering teams tracing coding agents and is in public beta on LangSmith Cloud, with coding-agent traces counting toward regular LangSmith tracing usage; the material suggests starting with one agent and one repo, after which spend broken out by pull request appears as the first threads come in.

Merged pull requests are only one useful signal, and code review and investigation do not always end in a PR, so unattributed spend may still be useful work and a team with a high cost per merged PR may still be taking sound approaches; the material gives no quantified benefit for the feature.