Use the intended weighting order in ManageContext().

This commit is contained in:
Bartosz Taudul
2026-01-30 20:58:56 +01:00
parent d6e62b3c1f
commit b9a4bf4f7b
+1 -1
View File
@@ -903,7 +903,7 @@ void TracyLlm::ManageContext( std::unique_lock<std::mutex>& lock )
// exponentially increase sizes of old tool outputs to prefer the most recent
constexpr float K = 1.1f;
for( size_t i=0; i<toolOutputs.size(); i++ ) toolOutputs[i].first *= std::pow( K, i+1 );
for( size_t i=0; i<toolOutputs.size(); i++ ) toolOutputs[i].first *= std::pow( K, toolOutputs.size() - i );
// remove the largest tool output
std::ranges::stable_sort( toolOutputs, []( const auto& a, const auto& b ) { return a.first > b.first; } );