feat(coding-agent): add prompt cache miss tracking (#6427)
Detect prompt cache misses per turn by comparing each assistant message's cache reads against the previous request's prompt tokens (core/cache-stats.ts). Significant misses emit a warning-colored transcript notice at the turn they occur, noting idle gaps past the cache TTL and model switches when relevant. /session gained cache statistics: a compact token/cache breakdown with hit rate, a $-prefixed cost section with per-model cost breakdown, and the cumulative cost re-billed due to cache misses.
This commit is contained in:
@@ -92,6 +92,7 @@ export interface Settings {
|
||||
branchSummary?: BranchSummarySettings;
|
||||
retry?: RetrySettings;
|
||||
hideThinkingBlock?: boolean;
|
||||
showCacheMissNotices?: boolean; // default: false - show transcript notices for significant prompt-cache misses
|
||||
externalEditor?: string; // Command for Ctrl+G external editor; takes precedence over VISUAL/EDITOR
|
||||
shellPath?: string; // Custom shell path (e.g., for Cygwin users on Windows)
|
||||
quietStartup?: boolean;
|
||||
@@ -845,6 +846,10 @@ export class SettingsManager {
|
||||
return this.settings.hideThinkingBlock ?? false;
|
||||
}
|
||||
|
||||
getShowCacheMissNotices(): boolean {
|
||||
return this.settings.showCacheMissNotices ?? false;
|
||||
}
|
||||
|
||||
getExternalEditorCommand(): string | undefined {
|
||||
const configuredEditor = this.settings.externalEditor;
|
||||
if (typeof configuredEditor === "string" && configuredEditor.trim() !== "") {
|
||||
@@ -863,6 +868,12 @@ export class SettingsManager {
|
||||
this.save();
|
||||
}
|
||||
|
||||
setShowCacheMissNotices(show: boolean): void {
|
||||
this.globalSettings.showCacheMissNotices = show;
|
||||
this.markModified("showCacheMissNotices");
|
||||
this.save();
|
||||
}
|
||||
|
||||
getShellPath(): string | undefined {
|
||||
return this.settings.shellPath;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user