From 5009ddbb3ad61a284ec3329d0c399a557e6bb0f1 Mon Sep 17 00:00:00 2001 From: PQ32 Developer Date: Sun, 10 May 2026 15:18:07 -0700 Subject: [PATCH] Patch 3: Make CONTEXT_RESERVE_RATIO configurable via AGENT_CONTEXT_RESERVE_RATIO env var Default reduced from 0.25 to 0.05. Reserving 25% of context for response was excessive, leaving too little for file content in legal document analysis. Configure via AGENT_CONTEXT_RESERVE_RATIO in .env to override. --- server/utils/agents/aibitat/plugins/filesystem/lib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/utils/agents/aibitat/plugins/filesystem/lib.js b/server/utils/agents/aibitat/plugins/filesystem/lib.js index faf1e5d0..f5f2a3be 100644 --- a/server/utils/agents/aibitat/plugins/filesystem/lib.js +++ b/server/utils/agents/aibitat/plugins/filesystem/lib.js @@ -11,7 +11,7 @@ const { humanFileSize } = require("../../../../helpers"); */ class FilesystemManager { static FILE_READ_CHUNK_SIZE = 1024; - static CONTEXT_RESERVE_RATIO = 0.25; + static CONTEXT_RESERVE_RATIO = Number(process.env.AGENT_CONTEXT_RESERVE_RATIO) || 0.05; static IMAGE_EXTENSIONS = [ ".png", ".jpg",