MCPcopy Index your code
hub / github.com/anomalyco/opencode / buildPrompt

Function buildPrompt

packages/core/src/session/compaction.ts:166–173  ·  view source on GitHub ↗
(input: { readonly previousSummary?: string; readonly context: readonly string[] })

Source from the content-addressed store, hash-verified

164}
165
166export const buildPrompt = (input: { readonly previousSummary?: string; readonly context: readonly string[] }) =>
167 [
168 input.previousSummary
169 ? `Update the anchored summary below using the conversation history above.\nPreserve still-true details, remove stale details, and merge in the new facts.\n<previous-summary>\n${input.previousSummary}\n</previous-summary>`
170 : "Create a new anchored summary from the conversation history.",
171 SUMMARY_TEMPLATE,
172 ...input.context,
173 ].join("\n\n")
174
175export const make = (dependencies: Dependencies) => {
176 const config = settings(dependencies.config)

Callers 2

compaction.tsFile · 0.90
makeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected