Commit b7e901f38c77

Vincent Demeester <vincent@sbr.pm>
2026-02-07 08:31:14
fix(pi): corrected context usage display in custom footer
Fixed getContextInfo to use usage.contextWindow instead of non-existent usage.limit property. The footer now properly displays context usage (e.g., 45.2%/200k) instead of hiding it when data is available.
1 parent 2055893
Changed files (1)
dots
pi
agent
dots/pi/agent/extensions/custom-footer.ts
@@ -224,12 +224,12 @@ function getThinkingInfo(pi: any): { emoji: string; level: string } | null {
 function getContextInfo(ctx: any, autoCompact: boolean): string | null {
 	try {
 		const usage = ctx.getContextUsage?.();
-		if (!usage || !usage.limit || usage.limit === 0) return null;
+		if (!usage || !usage.contextWindow || usage.contextWindow === 0) return null;
 		
-		const percent = ((usage.tokens / usage.limit) * 100).toFixed(1);
+		const percent = ((usage.tokens / usage.contextWindow) * 100).toFixed(1);
 		const compactStatus = autoCompact ? " (auto)" : "";
 		
-		return `${percent}%/${formatNumber(usage.limit)}${compactStatus}`;
+		return `${percent}%/${formatNumber(usage.contextWindow)}${compactStatus}`;
 	} catch {
 		return null;
 	}