()
| 153 | } |
| 154 | |
| 155 | export 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 | |
| 168 | export async function shouldAutoCompact( |
| 169 | messages: Message[], |
no test coverage detected