()
| 174 | } |
| 175 | |
| 176 | export function isAutoCompactEnabled(): boolean { |
| 177 | if (isEnvTruthy(process.env.DISABLE_COMPACT)) { |
| 178 | return false |
| 179 | } |
| 180 | // Allow disabling just auto-compact (keeps manual /compact working) |
| 181 | if (isEnvTruthy(process.env.DISABLE_AUTO_COMPACT)) { |
| 182 | return false |
| 183 | } |
| 184 | // Check if user has disabled auto-compact in their settings |
| 185 | const userConfig = getGlobalConfig() |
| 186 | return userConfig.autoCompactEnabled |
| 187 | } |
| 188 | |
| 189 | export async function shouldAutoCompact( |
| 190 | messages: Message[], |
no test coverage detected