MCPcopy Create free account
hub / github.com/Noumena-Network/code / isAutoCompactEnabled

Function isAutoCompactEnabled

src/services/compact/autoCompact.ts:155–166  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

153}
154
155export function isAutoCompactEnabled(): boolean {
156 if (isEnvTruthy(process.env.DISABLE_COMPACT)) {
157 return false
158 }
159 // Allow disabling just auto-compact (keeps manual /compact working)
160 if (isEnvTruthy(process.env.DISABLE_AUTO_COMPACT)) {
161 return false
162 }
163 // Check if user has disabled auto-compact in their settings
164 const userConfig = getGlobalConfig()
165 return userConfig.autoCompactEnabled
166}
167
168export async function shouldAutoCompact(
169 messages: Message[],

Callers 7

queryLoopFunction · 0.85
TokenWarningFunction · 0.85
analyzeContextUsageFunction · 0.85
shouldAutoCompactFunction · 0.85
initSessionMemoryFunction · 0.85

Calls 2

isEnvTruthyFunction · 0.90
getGlobalConfigFunction · 0.50

Tested by

no test coverage detected