mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
feat(subturn): implement token budget tracking for SubTurns
This commit is contained in:
@@ -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