From 0a8318780179ec4ff2438fe3171bebeba25d56c7 Mon Sep 17 00:00:00 2001 From: Teknium Date: Fri, 17 Apr 2026 15:33:31 -0700 Subject: [PATCH] refactor(kimi): use _fixed_temperature_for_model helper in flush_memories Replace the hardcoded 'kimi-for-coding' string check with the helper from auxiliary_client so there is one source of truth for the list of models with fixed-temperature contracts. Adding a new entry to _FIXED_TEMPERATURE_MODELS now automatically covers flush_memories too. --- run_agent.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/run_agent.py b/run_agent.py index 18729709..34f7518a 100644 --- a/run_agent.py +++ b/run_agent.py @@ -7207,9 +7207,16 @@ class AIAgent: # Use auxiliary client for the flush call when available -- # it's cheaper and avoids Codex Responses API incompatibility. - from agent.auxiliary_client import call_llm as _call_llm + from agent.auxiliary_client import ( + call_llm as _call_llm, + _fixed_temperature_for_model, + ) _aux_available = True - _flush_temperature = 0.6 if str(self.model or "").strip().lower() == "kimi-for-coding" else 0.3 + # Use the fixed-temperature override (e.g. kimi-for-coding → 0.6) if + # the model has a strict contract; otherwise the historical 0.3 default. + _flush_temperature = _fixed_temperature_for_model(self.model) + if _flush_temperature is None: + _flush_temperature = 0.3 try: response = _call_llm( task="flush_memories",