Prechádzať zdrojové kódy

Fix context size bug

paviko 4 mesiacov pred
rodič
commit
5b50dcf327

+ 1 - 0
hosts/jetbrains-plugin/CHANGELOG.md

@@ -3,6 +3,7 @@
 ## 2025.11.xx
 
 - Providers can be configured from Settings panel - can be added/removed, also OAuth
+- Fixed context size bug when session what aborted
 
 ## 25.11.19
 

+ 1 - 0
hosts/vscode-plugin/CHANGELOG.md

@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 ## [25.11.xx] - 2025-11-xx
 
 - Providers can be configured from Settings panel - can be added/removed, also OAuth
+- Fixed context size bug when session what aborted
 
 ## [25.11.19] - 2025-11-19
 

+ 2 - 0
packages/opencode/webgui/src/hooks/useSessionUsage.ts

@@ -57,6 +57,8 @@ function sumUsage(
     const uCacheRead = Number(usage.cache?.read || 0)
     const uCacheWrite = Number(usage.cache?.write || 0)
 
+    if (uInput + uOutput + uReasoning + uCacheRead + uCacheWrite <= 0) continue
+
     // contextUsed is the latest input value
     contextUsed = uInput + uCacheRead + uCacheWrite + uOutput