Repository navigation
Commit 2041ee7
committed
fix(trae): 解析 TRAE 官方缓存字段 cache_read_input_tokens
实时请求验证:TRAE token_usage 真实返回
cache_read_input_tokens / cache_creation_input_tokens(未命中为 0),
此前解析器只找 OpenAI 惯例字段导致 cached_tokens 恒 NULL。
- _parse_usage 解析链:prompt_tokens_details.cached_tokens → 顶层
cached_tokens → TRAE cache_read_input_tokens(0 是有效值,保留)
- 补充 0/缺失/优先级测试;PROPOSAL 同步字段事实
- Credit 确认无此字段,TRAE 恒 None 不变1 parent 3b57273 commit 2041ee7
3 files changed
Lines changed: 21 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
139 | 141 | | |
140 | 142 | | |
141 | 143 | | |
142 | 144 | | |
| 145 | + | |
| 146 | + | |
143 | 147 | | |
144 | 148 | | |
145 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1127 | 1127 | | |
1128 | 1128 | | |
1129 | 1129 | | |
1130 | | - | |
| 1130 | + | |
1131 | 1131 | | |
1132 | 1132 | | |
1133 | 1133 | | |
| |||
1138 | 1138 | | |
1139 | 1139 | | |
1140 | 1140 | | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
1141 | 1155 | | |
1142 | 1156 | | |
1143 | 1157 | | |
0 commit comments