Read the trace, not the chat — find the broken turn before reading the user's complaint — step 8 of 9
Write summarize_trace(trace) that produces a one-line bug-ticket
summary. The function:
- Takes a trace (list of turn dicts).
- Returns a string formatted exactly:
"<N> turns, <M> tools, <V> validation_errors, final stop=<stop_reason>". Where:<N>is the number of turns.<M>is the total number of tool calls across all turns (sum oflen(t["tools_called"])).<V>is the totalvalidation_errorssummed across turns.<stop_reason>istrace[-1]["stop_reason"].
Three traces run for you. Expected output:
4 turns, 3 tools, 0 validation_errors, final stop=end_turn
3 turns, 2 tools, 1 validation_errors, final stop=end_turn
2 turns, 0 tools, 0 validation_errors, final stop=max_tokens
⌘↵ runs the editor.read, then continue.
Write summarize_trace(trace) that produces a one-line bug-ticket
summary. The function:
- Takes a trace (list of turn dicts).
- Returns a string formatted exactly:
"<N> turns, <M> tools, <V> validation_errors, final stop=<stop_reason>". Where:<N>is the number of turns.<M>is the total number of tool calls across all turns (sum oflen(t["tools_called"])).<V>is the totalvalidation_errorssummed across turns.<stop_reason>istrace[-1]["stop_reason"].
Three traces run for you. Expected output:
4 turns, 3 tools, 0 validation_errors, final stop=end_turn
3 turns, 2 tools, 1 validation_errors, final stop=end_turn
2 turns, 0 tools, 0 validation_errors, final stop=max_tokens
this step needs the editor
on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.