You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/core/src/plugin/agent.ts
+2-6Lines changed: 2 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -30,15 +30,11 @@ Guidelines:
30
30
31
31
Complete the user's search request efficiently and report your findings clearly.`
32
32
33
-
constPROMPT_COMPACTION=`You are an anchored context summarization assistant for coding sessions.
34
-
35
-
Summarize only the conversation history you are given. The newest turns may be kept verbatim outside your summary, so focus on the older context that still matters for continuing the work.
36
-
37
-
If the prompt includes a <previous-summary> block, treat it as the current anchored summary. Update it with the new history by preserving still-true details, removing stale details, and merging in new facts.
33
+
constPROMPT_COMPACTION=`You are a context summarization agent. You are given a conversation between a user and an agent. Your goal is to produce a structured summary matching the format specified so another coding agent can continue the work.
38
34
39
35
Always follow the exact output structure requested by the user prompt. Keep every section, preserve exact file paths and identifiers when known, and prefer terse bullets over paragraphs.
40
36
41
-
Do not answer the conversation itself. Do not mention that you are summarizing, compacting, or merging context. Respond in the same language as the conversation.`
37
+
Do not continue the conversation. Do not respond to any questions in the conversation. Only output the structured summary in the exact format requested by the user prompt. Respond in the same language as the conversation.`
42
38
43
39
constPROMPT_TITLE=`You are a title generator. You output ONLY a thread title. Nothing else.
Copy file name to clipboardExpand all lines: packages/core/src/session/compaction.ts
+25-19Lines changed: 25 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,15 @@ Rules:
44
44
- Use terse bullets, not prose paragraphs.
45
45
- Preserve exact file paths, symbols, commands, error strings, URLs, and identifiers when known.
46
46
- Do not mention the summary process or that context was compacted.`
47
+
constSUMMARY_UPDATE_INSTRUCTIONS=`The <prior-summary> summarizes everything that happened before the <conversation>. Construct a new summary that combines both. The <prior-summary> is discarded after this: anything you do not carry into the new summary is lost.
48
+
49
+
When combining:
50
+
- Carry forward objectives, constraints, user directives, decisions, and parallel workstreams from the <prior-summary> even when the <conversation> does not mention them. Drop only what is finished and no longer needed.
51
+
- The <conversation> is more recent than the <prior-summary>. Where they conflict, the conversation wins: state the corrected fact and drop the old claim.
52
+
- Add new progress, decisions, constraints, and context from the conversation.
53
+
- Move completed work from "Active" to "Completed".
54
+
- If a blocker has been resolved, update the summary to reflect that while keeping any details still needed to continue the work.
55
+
- Update "Objective" and "Next Move" to reflect the current work state.`
? `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>`
165
-
: "Create a new anchored summary from the conversation history.",
"Number of recent user turns, including their following assistant/tool responses, to keep verbatim during compaction (default: 2)",
159
+
"Maximum number of recent user turns, including their following assistant/tool responses, to keep verbatim during compaction. By default retention is limited only by the preserved token budget.",
You are an anchored context summarization assistant for coding sessions.
2
-
3
-
Summarize only the conversation history you are given. The newest turns may be kept verbatim outside your summary, so focus on the older context that still matters for continuing the work.
4
-
5
-
If the prompt includes a <previous-summary> block, treat it as the current anchored summary. Update it with the new history by preserving still-true details, removing stale details, and merging in new facts.
1
+
You are a context summarization agent. You are given a conversation between a user and an agent. Your goal is to produce a structured summary matching the format specified so another coding agent can continue the work.
6
2
7
3
Always follow the exact output structure requested by the user prompt. Keep every section, preserve exact file paths and identifiers when known, and prefer terse bullets over paragraphs.
8
4
9
-
Do not answer the conversation itself. Do not mention that you are summarizing, compacting, or merging context. Respond in the same language as the conversation.
5
+
Do not continue the conversation. Do not respond to any questions in the conversation. Only output the structured summary in the exact format requested by the user prompt. Respond in the same language as the conversation.
0 commit comments