diff --git a/pkg/agent/core.go b/pkg/agent/core.go index 72e2f8e..0b7efa5 100644 --- a/pkg/agent/core.go +++ b/pkg/agent/core.go @@ -446,9 +446,9 @@ func (s *agentCore) Usage() string { if s.session == nil { return "no active session" } - str := fmt.Sprintf("%d in, %d out, %d requests, %d responses", + str := fmt.Sprintf("%d in, %d out, %d requests", s.session.TotalInputTokens, s.session.TotalOutputTokens, - s.session.TotalRequests, s.session.TotalResponses) + s.session.TotalRequests) if s.session.Estimated { str += " [estimated]" } @@ -604,10 +604,6 @@ func (s *agentCore) Submit(ctx context.Context, input string, handler EventHandl actCancel(nil) s.currentAction.CompareAndSwap(handle, nil) - if s.session != nil { - s.session.addResponse() - } - s.mu.Lock() s.reply = replyBuf.String() s.state = "idle" @@ -842,10 +838,10 @@ func (s *agentCore) handleCommand(ctx context.Context, input string, handler Eve } ctxEstimated := s.session.estimateTokens() pct := ctxEstimated * 100 / ctxLen - usageStr := fmt.Sprintf("~%d / %d tokens (%d%%) | %d in, %d out, %d requests, %d responses", + usageStr := fmt.Sprintf("~%d / %d tokens (%d%%) | %d in, %d out, %d requests", ctxEstimated, ctxLen, pct, s.session.TotalInputTokens, s.session.TotalOutputTokens, - s.session.TotalRequests, s.session.TotalResponses) + s.session.TotalRequests) if s.session.Estimated { usageStr += " [estimated]" } diff --git a/pkg/agent/session.go b/pkg/agent/session.go index 358b5a5..6a64566 100644 --- a/pkg/agent/session.go +++ b/pkg/agent/session.go @@ -73,7 +73,6 @@ type Session struct { TotalInputTokens int TotalOutputTokens int TotalRequests int - TotalResponses int Estimated bool // true if any usage was estimated rather than reported by the backend } @@ -101,10 +100,6 @@ func (s *Session) addUsage(u backend.Usage, estimated bool) { } } -func (s *Session) addResponse() { - s.TotalResponses++ -} - func (s *Session) update(assistant backend.Message, results []toolResult) error { s.messages = append(s.messages, assistant) for _, r := range results {