bug(ux): update context percentage when /clear command is run (#4162)

Co-authored-by: matt korwel <matt.korwel@gmail.com>
This commit is contained in:
Nick Salerni
2025-07-17 07:14:35 -07:00
committed by GitHub
parent ac8e98511e
commit 0d64355be6
4 changed files with 160 additions and 7 deletions

View File

@@ -133,6 +133,14 @@ export class UiTelemetryService extends EventEmitter {
return this.#lastPromptTokenCount;
}
resetLastPromptTokenCount(): void {
this.#lastPromptTokenCount = 0;
this.emit('update', {
metrics: this.#metrics,
lastPromptTokenCount: this.#lastPromptTokenCount,
});
}
private getOrCreateModelMetrics(modelName: string): ModelMetrics {
if (!this.#metrics.models[modelName]) {
this.#metrics.models[modelName] = createInitialModelMetrics();