Skip to content

Commit b633994

Browse files
committed
docs(session): preserve durable notes on completion
1 parent 1899d76 commit b633994

2 files changed

Lines changed: 18 additions & 5 deletions

File tree

src/services/session-mcp-runtime.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,12 @@ describe("session-mcp-runtime", () => {
812812
"fully",
813813
"complete",
814814
"empty `text`",
815+
"trivial",
816+
"evergreen",
817+
"learnings",
818+
"stale facts",
819+
"prior sessions",
820+
"same-project",
815821
]
816822
) {
817823
assertStringIncludes(write, phrase.toLowerCase());

src/services/session-mcp-runtime.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,18 @@ export const SESSION_NOTES_WRITE_DESCRIPTION = [
6262
" user. Approaching ~75% context usage counts as stopping mid-task: upsert",
6363
" with full detail so a post-compaction agent can resume without",
6464
" re-derivation.",
65-
"4. **Completing the task** → ONLY when the task is fully done, clear the",
66-
" note BEFORE reporting back. Clearing means deleting it: call this tool",
67-
' with empty `text` and `replace: <id>` (or `replace: "*"` with empty text',
68-
" to clear all notes for this scope). Do not clear a note for a paused,",
69-
" blocked, or partially complete task — upsert per step 3 instead.",
65+
"4. **Completing the task** → ONLY when the task is fully done, decide whether",
66+
" the note is merely operational or now contains durable learning. For trivial",
67+
" tasks or no lasting value, clear the note BEFORE reporting back. Clearing",
68+
" means deleting it: call this tool with empty `text` and `replace: <id>`",
69+
' (or `replace: "*"` with empty text to clear all notes for this scope). If',
70+
" the task produced evergreen facts, system details, issue findings, or other",
71+
" learnings that will help future sessions, replace the operational checklist",
72+
" with a concise durable note instead of deleting it. Do not clear a note for",
73+
" a paused, blocked, or partially complete task — upsert per step 3 instead.",
74+
" If `session_search` or `session_notes_read` revealed prior sessions with",
75+
" stale facts, delete those stale note ids too, even when they belong to another",
76+
" same-project root session.",
7077
"",
7178
"Also write/update a note:",
7279
"",

0 commit comments

Comments
 (0)