pipeline-fixer, that fixed a failed Bolt run of daily_production_build. The fix was right, but the session used 1,284 credits. The trace shows why, and what to change in the agent.
Prerequisites
- A DinoAI agent that has run at least once, for example from Bolt self-healing or a chat.
- Access to the agent’s session in the Agent app.
- To change the agent: edit access to its YAML file under
.dinoai/agents/, or to the agent in the agent builder.
Steps
1
Open the session's trace
Open the session from the Agent app, or from the Bolt run’s DinoAI tab with Open in agent. In the session header, click Trace.Read the header first. This session shows 1,284 credits, 9 model calls, 14 tool calls, 3m 42s wall clock, and 61K peak context. A peak context of 61K for a one-file fix is the first clue: one model call was sent a very large prompt.See Reading a trace for each part of the screen.
2
Find the expensive step
In the flight recorder at the bottom, click Credits. One bar stands far above the others. Click it to select its step.
The inspector shows a

model (main) call with 412 credits, 100% of top, and 61,240 / 920 tokens in and out. That one call used about a third of the session’s credits.3
Read what the model was given
Look at the call’s Input. A model call’s input shows what is new in its prompt since the previous call. Here it starts with the result of
read_file target/manifest.json: the agent read dbt™‘s whole manifest into its context. Click Show full text to see all of it.The step before it in the graph is the read_file call on target/manifest.json. The agent didn’t need the manifest: the run’s error was already in target/run_results.json.4
Spot failed and repeated tool calls
Switch the flight recorder back to Duration, and walk the steps with ↓. Two 
Its Status is
run_terminal_command steps in a row run dbt build -s fct_orders. Select the second one.
error, and its Output is the same database error as the first run. The agent ran the build again without changing anything. Each failed build took about 10 seconds and a model call to read the result.5
Check the internal steps
Switch on Internal steps in the header. Internal nodes appear under some model calls.
Here one call had a failed route try, marked

overloaded, before another route served it. A model warning with fell_back means another model answered that call. That explains a slow call, and a different model id on it. It isn’t a problem with the agent. If the agent must stay on its own models, set fallback: none. See Internal steps.6
Change the agent
Turn what the trace showed into changes in the agent’s YAML file,
.dinoai/agents/pipeline-fixer.yml:- Instructions (
backstory): tell the agent where to start, what not to read, and not to rerun a failing command. - Tools: allow only the tools the job needs.
- Model: if the trace shows a cheaper model would do, set
model_family. See Supported models.
7
Compare the next session
Let the agent run again, then open the new session’s trace. Compare the header numbers with the old session: credits, model calls, and peak context should go down, and the flight recorder should have no repeated failed builds.
The new session fixes the same kind of failure with fewer credits, a lower peak context, and no repeated failed tool calls.
Next steps
Traces
What a trace shows and where to open it.
Span reference
Every step type, its fields, and its status values.
Metrics
How credits, calls, wall clock, and peak context are counted.
YAML Configuration
Every field you can change in an agent.