Fix status usage ratio (#4584)
1. Removes "Token usage" line for chatgpt sub users 2. Adds the word "used" to the context window line
This commit is contained in:
@@ -152,7 +152,7 @@ impl StatusHistoryCell {
|
|||||||
Span::from(format!("{percent}% left")),
|
Span::from(format!("{percent}% left")),
|
||||||
Span::from(" (").dim(),
|
Span::from(" (").dim(),
|
||||||
Span::from(used_fmt).dim(),
|
Span::from(used_fmt).dim(),
|
||||||
Span::from(" / ").dim(),
|
Span::from(" used / ").dim(),
|
||||||
Span::from(window_fmt).dim(),
|
Span::from(window_fmt).dim(),
|
||||||
Span::from(")").dim(),
|
Span::from(")").dim(),
|
||||||
])
|
])
|
||||||
@@ -302,7 +302,10 @@ impl HistoryCell for StatusHistoryCell {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lines.push(Line::from(Vec::<Span<'static>>::new()));
|
lines.push(Line::from(Vec::<Span<'static>>::new()));
|
||||||
lines.push(formatter.line("Token usage", self.token_usage_spans()));
|
// Hide token usage only for ChatGPT subscribers
|
||||||
|
if !matches!(self.account, Some(StatusAccountDisplay::ChatGpt { .. })) {
|
||||||
|
lines.push(formatter.line("Token usage", self.token_usage_spans()));
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(spans) = self.context_window_spans() {
|
if let Some(spans) = self.context_window_spans() {
|
||||||
lines.push(formatter.line("Context window", spans));
|
lines.push(formatter.line("Context window", spans));
|
||||||
|
|||||||
@@ -14,6 +14,6 @@ expression: sanitized
|
|||||||
│ Agents.md: <none> │
|
│ Agents.md: <none> │
|
||||||
│ │
|
│ │
|
||||||
│ Token usage: 1.2K total (800 input + 400 output) │
|
│ Token usage: 1.2K total (800 input + 400 output) │
|
||||||
│ Context window: 100% left (1.2K / 272K) │
|
│ Context window: 100% left (1.2K used / 272K) │
|
||||||
│ Monthly limit: [██░░░░░░░░░░░░░░░░░░] 12% used (resets 07:08 on 7 May) │
|
│ Monthly limit: [██░░░░░░░░░░░░░░░░░░] 12% used (resets 07:08 on 7 May) │
|
||||||
╰────────────────────────────────────────────────────────────────────────────╯
|
╰────────────────────────────────────────────────────────────────────────────╯
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ expression: sanitized
|
|||||||
│ Agents.md: <none> │
|
│ Agents.md: <none> │
|
||||||
│ │
|
│ │
|
||||||
│ Token usage: 1.9K total (1K input + 900 output) │
|
│ Token usage: 1.9K total (1K input + 900 output) │
|
||||||
│ Context window: 100% left (2.1K / 272K) │
|
│ Context window: 100% left (2.1K used / 272K) │
|
||||||
│ 5h limit: [███████████████░░░░░] 72% used (resets 03:14) │
|
│ 5h limit: [███████████████░░░░░] 72% used (resets 03:14) │
|
||||||
│ Weekly limit: [█████████░░░░░░░░░░░] 45% used (resets 03:24) │
|
│ Weekly limit: [█████████░░░░░░░░░░░] 45% used (resets 03:24) │
|
||||||
╰─────────────────────────────────────────────────────────────────────╯
|
╰─────────────────────────────────────────────────────────────────────╯
|
||||||
|
|||||||
@@ -14,6 +14,6 @@ expression: sanitized
|
|||||||
│ Agents.md: <none> │
|
│ Agents.md: <none> │
|
||||||
│ │
|
│ │
|
||||||
│ Token usage: 750 total (500 input + 250 output) │
|
│ Token usage: 750 total (500 input + 250 output) │
|
||||||
│ Context window: 100% left (750 / 272K) │
|
│ Context window: 100% left (750 used / 272K) │
|
||||||
│ Limits: data not available yet │
|
│ Limits: data not available yet │
|
||||||
╰─────────────────────────────────────────────────────────────────╯
|
╰─────────────────────────────────────────────────────────────────╯
|
||||||
|
|||||||
@@ -14,6 +14,6 @@ expression: sanitized
|
|||||||
│ Agents.md: <none> │
|
│ Agents.md: <none> │
|
||||||
│ │
|
│ │
|
||||||
│ Token usage: 750 total (500 input + 250 output) │
|
│ Token usage: 750 total (500 input + 250 output) │
|
||||||
│ Context window: 100% left (750 / 272K) │
|
│ Context window: 100% left (750 used / 272K) │
|
||||||
│ Limits: send a message to load usage data │
|
│ Limits: send a message to load usage data │
|
||||||
╰─────────────────────────────────────────────────────────────────╯
|
╰─────────────────────────────────────────────────────────────────╯
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ expression: sanitized
|
|||||||
│ Agents.md: <none> │
|
│ Agents.md: <none> │
|
||||||
│ │
|
│ │
|
||||||
│ Token usage: 1.9K total (1K input + │
|
│ Token usage: 1.9K total (1K input + │
|
||||||
│ Context window: 100% left (2.1K / 272K) │
|
│ Context window: 100% left (2.1K used / │
|
||||||
│ 5h limit: [███████████████░░░░░] │
|
│ 5h limit: [███████████████░░░░░] │
|
||||||
│ (resets 03:14) │
|
│ (resets 03:14) │
|
||||||
╰────────────────────────────────────────────╯
|
╰────────────────────────────────────────────╯
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ fn status_context_window_uses_last_usage() {
|
|||||||
.expect("context line");
|
.expect("context line");
|
||||||
|
|
||||||
assert!(
|
assert!(
|
||||||
context_line.contains("13.7K / 272K"),
|
context_line.contains("13.7K used / 272K"),
|
||||||
"expected context line to reflect last usage tokens, got: {context_line}"
|
"expected context line to reflect last usage tokens, got: {context_line}"
|
||||||
);
|
);
|
||||||
assert!(
|
assert!(
|
||||||
|
|||||||
Reference in New Issue
Block a user