File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed
tui/internal/components/status Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -547,7 +547,7 @@ export namespace Session {
547547 // return step
548548 // },
549549 toolCallStreaming : true ,
550- maxTokens : model . info . limit . output || undefined ,
550+ maxTokens : Math . max ( 0 , model . info . limit . output ) || undefined ,
551551 abortSignal : abort . signal ,
552552 maxSteps : 1000 ,
553553 providerOptions : model . info . options ,
Original file line number Diff line number Diff line change @@ -100,16 +100,18 @@ func (m statusComponent) View() string {
100100 contextWindow := m .app .Model .Limit .Context
101101
102102 for _ , message := range m .app .Messages {
103- if message .Metadata .Assistant .Cost > 0 {
104- cost += message .Metadata .Assistant .Cost
105- usage := message .Metadata .Assistant .Tokens
106- if usage .Output > 0 {
107- tokens = (usage .Input +
108- usage .Cache .Write +
109- usage .Cache .Read +
110- usage .Output +
111- usage .Reasoning )
103+ cost += message .Metadata .Assistant .Cost
104+ usage := message .Metadata .Assistant .Tokens
105+ if usage .Output > 0 {
106+ if message .Metadata .Assistant .Summary {
107+ tokens = usage .Output
108+ continue
112109 }
110+ tokens = (usage .Input +
111+ usage .Cache .Write +
112+ usage .Cache .Read +
113+ usage .Output +
114+ usage .Reasoning )
113115 }
114116 }
115117
You can’t perform that action at this time.
0 commit comments