From f072801f38624ab1694ebac000c88a7718514617 Mon Sep 17 00:00:00 2001 From: teknium1 Date: Sun, 22 Feb 2026 02:17:33 -0800 Subject: [PATCH] refactor: remove unused compression model variable in AIAgent - Eliminated the `compression_model` variable from the AIAgent class, as it was not being utilized. - Cleaned up the context compressor initialization for improved clarity and maintainability. --- run_agent.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/run_agent.py b/run_agent.py index 3aa1df68..748f025f 100644 --- a/run_agent.py +++ b/run_agent.py @@ -390,15 +390,13 @@ class AIAgent: # Compresses conversation when approaching model's context limit # Configuration via environment variables (can be set in .env or cli-config.yaml) compression_threshold = float(os.getenv("CONTEXT_COMPRESSION_THRESHOLD", "0.85")) - compression_model = os.getenv("CONTEXT_COMPRESSION_MODEL", "google/gemini-3-flash-preview") compression_enabled = os.getenv("CONTEXT_COMPRESSION_ENABLED", "true").lower() in ("true", "1", "yes") self.context_compressor = ContextCompressor( model=self.model, threshold_percent=compression_threshold, - summary_model=compression_model, - protect_first_n=3, # Keep system, first user, first assistant - protect_last_n=4, # Keep recent context + protect_first_n=3, + protect_last_n=4, summary_target_tokens=500, quiet_mode=self.quiet_mode, )