()
| 3222 | } |
| 3223 | |
| 3224 | private getPreferredCompactionModel(): string | null { |
| 3225 | try { |
| 3226 | const maybeConfig = this.config as Config & { |
| 3227 | loadConfigOrDefault?: () => { |
| 3228 | agentAiDefaults?: Record<string, { modelString?: string }>; |
| 3229 | } | null; |
| 3230 | }; |
| 3231 | if (typeof maybeConfig.loadConfigOrDefault !== "function") { |
| 3232 | return null; |
| 3233 | } |
| 3234 | |
| 3235 | const compactModelString = |
| 3236 | maybeConfig.loadConfigOrDefault()?.agentAiDefaults?.compact?.modelString; |
| 3237 | if (typeof compactModelString !== "string") { |
| 3238 | return null; |
| 3239 | } |
| 3240 | |
| 3241 | const normalized = normalizeToCanonical(compactModelString.trim()); |
| 3242 | if (!isValidModelFormat(normalized)) { |
| 3243 | return null; |
| 3244 | } |
| 3245 | |
| 3246 | return normalized; |
| 3247 | } catch { |
| 3248 | return null; |
| 3249 | } |
| 3250 | } |
| 3251 | |
| 3252 | private buildAutoCompactionRequest(params: { |
| 3253 | followUpContent: CompactionFollowUpRequest; |
no test coverage detected