MCPcopy Create free account
hub / github.com/freecodexyz/free-code / getCompactUserSummaryMessage

Function getCompactUserSummaryMessage

src/services/compact/prompt.ts:337–374  ·  view source on GitHub ↗
(
  summary: string,
  suppressFollowUpQuestions?: boolean,
  transcriptPath?: string,
  recentMessagesPreserved?: boolean,
)

Source from the content-addressed store, hash-verified

335}
336
337export function getCompactUserSummaryMessage(
338 summary: string,
339 suppressFollowUpQuestions?: boolean,
340 transcriptPath?: string,
341 recentMessagesPreserved?: boolean,
342): string {
343 const formattedSummary = formatCompactSummary(summary)
344
345 let baseSummary = `This session is being continued from a previous conversation that ran out of context. The summary below covers the earlier portion of the conversation.
346
347${formattedSummary}`
348
349 if (transcriptPath) {
350 baseSummary += `\n\nIf you need specific details from before compaction (like exact code snippets, error messages, or content you generated), read the full transcript at: ${transcriptPath}`
351 }
352
353 if (recentMessagesPreserved) {
354 baseSummary += `\n\nRecent messages are preserved verbatim.`
355 }
356
357 if (suppressFollowUpQuestions) {
358 let continuation = `${baseSummary}
359Continue the conversation from where it left off without asking the user any further questions. Resume directly — do not acknowledge the summary, do not recap what was happening, do not preface with "I'll continue" or similar. Pick up the last task as if the break never happened.`
360
361 if (
362 (feature('PROACTIVE') || feature('KAIROS')) &&
363 proactiveModule?.isProactiveActive()
364 ) {
365 continuation += `
366
367You are running in autonomous/proactive mode. This is NOT a first wake-up — you were already working autonomously before compaction. Continue your work loop: pick up where you left off based on the summary above. Do not greet the user or ask what to work on.`
368 }
369
370 return continuation
371 }
372
373 return baseSummary
374}

Callers 3

compactConversationFunction · 0.85

Calls 1

formatCompactSummaryFunction · 0.85

Tested by

no test coverage detected