MCPcopy Index your code
hub / github.com/coder/mux / getPreferredCompactionModel

Method getPreferredCompactionModel

src/node/services/agentSession.ts:3224–3250  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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;

Callers 1

Calls 3

normalizeToCanonicalFunction · 0.90
isValidModelFormatFunction · 0.90
loadConfigOrDefaultMethod · 0.80

Tested by

no test coverage detected