Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

refactor(chatRuntimeSlice): extract runtime state helpers

Steven Enamakelc97fc64323a9
diff --git a/app/src/store/chatRuntimeSlice.ts b/app/src/store/chatRuntimeSlice.ts
index 394c910688..38ba346a63 100644
--- a/app/src/store/chatRuntimeSlice.ts
+++ b/app/src/store/chatRuntimeSlice.ts
@@ -2822,7 +2822,10 @@ const chatRuntimeSlice = createSlice({
lastTurnInputTokens: nonNeg(p.lastTurnInputTokens),
lastTurnOutputTokens: nonNeg(p.lastTurnOutputTokens),
contextWindow: nonNeg(p.contextWindow),
- lastTurnContextUsed: nonNeg(p.lastTurnInputTokens) + nonNeg(p.lastTurnOutputTokens),
+ lastTurnContextUsed:
+ nonNeg(p.lastTurnContextTokens) > 0
+ ? nonNeg(p.lastTurnContextTokens)
+ : nonNeg(p.lastTurnInputTokens) + nonNeg(p.lastTurnOutputTokens),
subAgents,
};
},