Commit 9901dc5
Add context_chars to ActionStep and Step log line
- Add field to dataclass
in memory.py — the natural carrier alongside token_usage and timing.
- In (monitoring.py), compute the context char
count once from , store it on
, and append it to the Step log line:
[Step N: Duration X.XX seconds| Input tokens: ... | Context: N chars]
- In (agents.py), prefer the already-stored
value (survives model_input_messages cleanup)
before falling back to re-computing from messages.
Zero code duplication: one calculation site, one storage location,
two consumers (Step log + Turn summary line).
Co-Authored-By: bpsa2 <241537330+bpsa2@users.noreply.github.com>1 parent 6eca91b commit 9901dc5
3 files changed
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
843 | 843 | | |
844 | 844 | | |
845 | 845 | | |
846 | | - | |
847 | | - | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
848 | 851 | | |
849 | 852 | | |
850 | 853 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
116 | 124 | | |
117 | 125 | | |
118 | 126 | | |
| |||
0 commit comments