Commit 6ac00e3
fix(langgraph): sync tutorial span output stores final text, not usage [greptile]
The sync harness_langgraph tutorial set turn_span.output to
{"final_output": turn.usage().model_dump()} — token metrics under a key that
means the assistant's text, producing misleading AGENT_WORKFLOW trace data
versus the async tutorial. Accumulate text deltas during the yield loop (as the
030_langgraph tutorial does) and store {"final_output": final_text, "usage":
...} so the final output is the text and usage stays available under its own key.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 8ba11bd commit 6ac00e3
1 file changed
Lines changed: 8 additions & 1 deletion
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| 97 | + | |
96 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
97 | 104 | | |
98 | 105 | | |
99 | 106 | | |
100 | | - | |
| 107 | + | |
0 commit comments