Your AI Agent Isn't Done When the Trace Turns Green
LangSmith Engine's new Goals feature points at a habit any agent team can copy: record whether the agent's work got used, right next to the run that made it
Most AI agents are graded on whether they finished the task. Almost none are graded on whether anyone kept the result.
That gap is easy to miss because everything looks green. The eval suite (the scored test cases you run before a release) passes. The trace (the step-by-step log of the run) shows every tool call returning cleanly. The agent said "done." And somewhere downstream, a pull request sits unmerged, a draft email gets rewritten from scratch, a generated video never gets posted.
On December 3, LangChain shipped a feature built around exactly that gap. It is called Goals, it lives inside LangSmith Engine, and the most useful idea in it does not require LangSmith at all. The number that tells you whether an agent works is usually recorded somewhere other than the agent's own logs, and you have to carry it back.
This piece explains what LangChain shipped, walks through the bug it found in its own agent, and shows how to wire one outcome signal to your traces this week with whatever tools you already run.
What a trace is, and what it is missing
A trace is the step-by-step record of one agent run: the prompt that came in, each model call, each tool the agent used, and what it returned. Tools like LangSmith, LangChain's observability product, store these so you can replay what the agent did.
Traces are good at answering "what happened." They are bad at answering "did it matter," because the answer arrives later and somewhere else. A coding agent's run ends when it opens the PR. Whether a human merged that PR shows up in GitHub hours later. A support agent's run ends when it sends the reply. Whether the customer wrote back angry shows up in the help desk tomorrow.
Think of a restaurant that counts plates leaving the kitchen but never looks at what comes back. The kitchen's numbers look great. The diners left half the food.
What LangChain shipped on December 3
LangSmith Engine is an agent that reads your agent's production traces, looks for problems and suggests changes. The December 3 post adds Goals on top of it.
You describe an outcome in plain words, such as "resolve more support tickets on the first try" or "get more PRs merged." You can do it in LangSmith or by sending Engine a Slack message. Engine then helps you turn that sentence into a metric and checks whether the signal already exists in your trace data or feedback. If it does not, the post says Engine can help instrument your agent to capture it, "including opening a PR to record the outcome as feedback on the relevant traces."
Once the metric exists, Engine focuses its investigations on it, groups its recommendations under the Goal and tracks the metric as your team ships changes. LangChain says Engine still runs broader analysis outside your Goals, just less often.
The pricing line matters if you plan to try it: the post says Engine is free for new LangSmith Plus users through the end of the year (that is, 2026).
The bug that only an outcome metric could find
The best part of the post is LangChain admitting a flaw in its own product.
Content Studio is LangChain's internal design agent. People ask it in Slack for videos, social graphics and slide decks. The team set a Goal: "Generated content gets used in marketing campaigns," measured as the share of generated content that actually got posted to LinkedIn or X.
The first thing Engine found was that the signal did not exist on the traces. Content Studio recorded what got posted somewhere else, so Engine opened a PR to attach that publication signal to the matching traces as feedback.
With the outcome sitting next to each run, a pattern showed up. Videos that went through follow-up edits were less likely to be posted, even when every edit completed without an error. Comparing those traces with the ones that ended in a published video, Engine found that a small request like "change the closing slide" regenerated the entire video. The slide changed, and so did scenes, timing and visuals the user had already approved. That set off another round of corrections, and per the post, users would abandon their projects.
Look at what each layer of measurement saw:
- The eval suite saw requests completed correctly. Every edit was applied.
- The trace saw clean runs with no errors.
- The outcome metric saw people giving up.
Only the third one was true about the product. Engine's fix kept the existing video project and applied revisions only to the scenes involved. It added the revision requests that exposed the problem to Content Studio's regression dataset (the fixed set of test cases a team reruns before shipping) and checked the fix against the full dataset before it shipped.
Notice the wording in LangChain's own post. It says Engine looks for differences "associated with better outcomes." That is honest, and it is the right frame: an outcome metric shows you where to look, and a human or a test still has to confirm the cause.
Why evals miss this, and why that is not the evals' fault
Offline evals, the scored test cases you run before a release, answer a narrow question: given this input, did the agent produce an acceptable output? They should keep doing that. LangChain is clear that its own evals stay "critical to Engine's own development."
The trouble is that "acceptable output for one request" and "finished, usable work" are different targets. The post gives two examples worth stealing: a coding agent that solves harder and harder benchmark problems while producing PRs "users rarely merge," and a sales agent whose outreach drafts pass every check while reps rewrite or abandon them.
Here is the plain version of the insight. Evals measure the agent against your expectations. Outcome metrics measure the agent against your users' behavior. You need both, and most teams only have the first.
Put this into practice this week
You do not need Engine to start. You need one outcome, one join key and one place to store the result. Here is the lowest-friction path.
1. Pick one outcome a human already produces
Choose a behavior that already happens and already gets recorded:
- Coding agent: the PR was merged (not just opened).
- Writing or outreach agent: the draft was sent without heavy edits.
- Support agent: the ticket closed without a reopen within seven days.
- Content agent: the asset was published.
Pick the one your team already argues about. One is enough.
2. Stamp every artifact with the trace ID
The join key is the trace ID, the ID of the top-level run that started the agent's work. Put it somewhere the downstream system keeps. For a coding agent, a git trailer (a Key: value line at the end of a commit message) works well:
git commit -m "Fix pagination off-by-one" -m "Agent-Trace-Id: 3f2c9a1e-..."
Git has built-in support for reading these lines back with git interpret-trailers. For a PR, a short footer line in the description does the same job. For a support reply, a hidden field on the ticket.
3. Collect the outcome on a schedule
A nightly job is plenty. For merged PRs, the GitHub CLI can list them with their bodies so you can pull the trace ID back out (gh pr list):
gh pr list --state merged --limit 200 --json number,mergedAt,body
Do the same for PRs closed without merging. That gives you both sides of the comparison.
4. Write the outcome back next to the trace
If you use LangSmith, outcome signals go in as feedback on the run. The feedback docs show create_feedback() in Python and createFeedback in TypeScript, and note you can attach feedback to runs that are still in progress. The Python reference says passing the trace ID lets feedback be batched in the background, and that when the run you are scoring is the top-level run, the trace ID alone is enough:
from langsmith import Client
client = Client()
client.create_feedback(trace_id=trace_id, key="pr_merged", score=1) # 0 when closed unmerged
If you use something else, the principle holds: store the outcome in the same system as the trace, keyed by the same ID, so a single query can split runs into "used" and "not used."
5. Read the two piles side by side
Now compare. Pull ten runs that ended in a merge and ten that did not. Look for what differs: more tool calls, longer runs, a particular kind of request, more back-and-forth turns. That is the manual version of what Engine automates, and ten minutes of it is often enough to spot the Content Studio kind of bug.
When you find one, turn the failing examples into eval cases. That is how the outcome metric makes your evals better instead of replacing them.
What to expect on the first pass: the signal will be noisy, a chunk of artifacts will be missing their trace ID, and the first "pattern" you see will probably be something boring like request length. Fix the stamping first. The interesting findings come on the second week.
Honest limitations
Outcomes arrive late. A merge can take days, a ticket reopen a week. Your feedback loop slows down to match, so do not expect same-day answers.
Correlation is not cause. Runs that ended unmerged might simply be harder tasks. LangChain's own phrasing ("associated with") is the right level of confidence. Confirm a suspected cause with a test before you rewrite the agent.
The metric can be gamed. An agent tuned to maximize merges could drift toward tiny, safe PRs that always get merged and never fix anything hard. Keep a second signal (size of change, task difficulty) next to the first.
People change their behavior. If reviewers know merges are counted, some will merge to be nice. Measure without announcing it and look at the trend, not single numbers.
Engine itself is a hosted product. Goals only work inside LangSmith, the free offer is for new Plus users through the end of the year, and Engine's recommendations still need a person to review them before they ship. The habit in this article costs nothing; the automation around it does.
Privacy. Outcome data often lives in systems with customer information. Copy only the yes-or-no signal and the trace ID into your trace store, not the ticket text.
What to do Monday
Write down, in one sentence, what "the agent's work got used" means for your product. Then check whether you could answer that question for yesterday's runs. If you cannot, you have found your first piece of instrumentation, and it is probably one git trailer and one nightly script away.
The agent that finishes every task is not the goal. The agent whose work people keep is.
Sources: LangChain, "Toward goal-oriented agent improvement with LangSmith Engine" (December 3, 2026) · LangSmith Engine · LangSmith docs, Log user feedback using the SDK · LangSmith Python reference, create_feedback · LangSmith observability concepts · git interpret-trailers · GitHub CLI, gh pr list