feat(subturn): implement token budget tracking for SubTurns
This commit is contained in:
1 parent
01c2f8d608
commit
99b189d3fb
4 files changed
+92
-10
No files matched your search
@@ -1460,6 +1460,10 @@ func (al *AgentLoop) runLLMIteration(
|
||||
// Save finishReason to turnState for SubTurn truncation detection
|
||||
if ts := turnStateFromContext(ctx); ts != nil {
|
||||
ts.SetLastFinishReason(response.FinishReason)
|
||||
// Save usage for token budget tracking
|
||||
if response.Usage != nil {
|
||||
ts.SetLastUsage(response.Usage)
|
||||
}
|
||||
}
|
||||
|
||||
go al.handleReasoning(
|
||||
|
||||
Reference in new issue
Block a user