()
| 145 | } |
| 146 | |
| 147 | export function isAutoCompactEnabled(): boolean { |
| 148 | if (isEnvTruthy(process.env.DISABLE_COMPACT)) { |
| 149 | return false |
| 150 | } |
| 151 | // Allow disabling just auto-compact (keeps manual /compact working) |
| 152 | if (isEnvTruthy(process.env.DISABLE_AUTO_COMPACT)) { |
| 153 | return false |
| 154 | } |
| 155 | // Check if user has disabled auto-compact in their settings |
| 156 | const userConfig = getGlobalConfig() |
| 157 | return userConfig.autoCompactEnabled |
| 158 | } |
| 159 | |
| 160 | export async function shouldAutoCompact( |
| 161 | messages: Message[], |
no test coverage detected