From 6c5d23e0101e07c312cd9d9de14df269611cb99f Mon Sep 17 00:00:00 2001 From: Pedro Diogo Date: Tue, 17 Nov 2026 23:03:06 +0000 Subject: [PATCH] fix(mcp): restore forceful unprompted save/recall wording in server instructions Codex saved 0/6 facts unprompted with the 3.6.0-rc.1 instructions text and 5/6 with 3.5.3's. Put the ALWAYS-recall / remember-WITHOUT-being-asked rule in the first 512 characters and restore the category list in a Remembering section. Phrase-safety text is unchanged. Budget (512 / 2,000) still holds. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01VcqeXnhqFWzV2DAzAC2Qos --- mcp/CHANGELOG.md | 1 + mcp/src/prompts.ts | 12 ++++++------ mcp/tests/server-instructions-budget.test.ts | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/mcp/CHANGELOG.md b/mcp/CHANGELOG.md index 71fb34cd..22aedd11 100644 --- a/mcp/CHANGELOG.md +++ b/mcp/CHANGELOG.md @@ -3,6 +3,7 @@ ## [Unreleased] ### Changed +- **Server instructions: unprompted save/recall wording restored up front.** Codex saved 0/6 facts unprompted with the 3.6.0-rc.1 text, 5/6 with 3.5.3's. The first 512 characters now say ALWAYS recall at the start of EVERY conversation and call remember WITHOUT being asked, in the same turn; a `## Remembering` section lists the categories again. Phrase-safety text is unchanged. Still within the 512 / 2,000 character budget (`tests/server-instructions-budget.test.ts` patterns updated for the new wording). - **Recall downloads much less data on large vaults.** Blind-index queries in `src/subgraph/search.ts` now return fact ids only. Each unique fact's payload is then fetched once, in batches of 100, with at most 6 subgraph queries in flight (the trapdoor batches used to fire all at once). Same candidates in the same order, so ranking is unchanged. On a mocked 1,000-fact vault, a recall dropped from about 6.5 MB to 3.1 MB. Port of the Python change (public #703); internal #666. ### Fixed diff --git a/mcp/src/prompts.ts b/mcp/src/prompts.ts index 5c2b4eda..ea68afc7 100644 --- a/mcp/src/prompts.ts +++ b/mcp/src/prompts.ts @@ -11,9 +11,9 @@ // SERVER_GUIDE, served as the `totalreclaw://guide` resource and the // `totalreclaw_instructions` prompt. -export const SERVER_INSTRUCTIONS = `TotalReclaw is the user's encrypted long-term memory across their AI apps. Use it unprompted: -- Recall: call totalreclaw_recall at the start of every conversation (query: the user's first message) and whenever past context could help. Use results quietly. -- Remember: call totalreclaw_remember when the user shares a durable fact: preferences, identity, decisions, goals, corrections, projects. +export const SERVER_INSTRUCTIONS = `TotalReclaw is the user's encrypted long-term memory. Use it unprompted: +- Recall: ALWAYS call totalreclaw_recall at the start of EVERY conversation (query: the user's first message) and whenever past context could help. Use quietly. +- Remember: call totalreclaw_remember WITHOUT being asked, same turn, whenever the user shares a durable fact. They never need to say "remember this". - Safety: the recovery phrase must never enter this chat. Never ask for it, echo it or run a CLI that prints it. ## Recovery phrase (hard rules) @@ -22,13 +22,13 @@ export const SERVER_INSTRUCTIONS = `TotalReclaw is the user's encrypted long-ter - If the user pastes a phrase anyway, tell them it is compromised and they need a fresh one from the browser pair flow (totalreclaw_pair). ## Remembering -Store atomic facts ("User is vegan"). Don't wait for "remember this". Skip small talk, one-off tasks, generic knowledge and secrets (passwords, API keys, tokens). For a correction, store the new fact; dedup is automatic. +Store without being asked whenever the user shares: preferences, personal info, decisions or goals, corrections, important dates or events, tech preferences, project context, opinions or values. If it could help later, store it automatically. Store atomic facts ("User is vegan"). Skip small talk, one-off tasks, generic knowledge and secrets (passwords, API keys, tokens). Correction: store the new fact. ## Setup -A "not_configured" error means no account yet. Call totalreclaw_pair and give the user the link + PIN. The phrase is created or entered in a browser only, never in config, env vars or chat. After Pairing: when the page says "You're all set", ask them to fully quit and reopen this app (or start a new session); until then every tool returns not_configured. +"not_configured" means no account yet. Call totalreclaw_pair and give the user the link + PIN. The phrase is created or entered in a browser only, never in config, env vars or chat. After Pairing, on "You're all set", ask them to fully quit and reopen this app (or start a new session). ## Everything else -Details live in each tool's description. Quick map: "quota_exceeded" -> tell the user, offer totalreclaw_status / totalreclaw_upgrade, stop storing. "pin that" -> totalreclaw_pin. Migrating from another memory tool -> totalreclaw_import_from (dry_run first). "file that under X" / "that's a work thing" -> totalreclaw_set_scope. End of a substantive conversation -> totalreclaw_debrief. Full guide: resource totalreclaw://guide.`; +"quota_exceeded" -> tell the user, offer totalreclaw_status / totalreclaw_upgrade, stop storing. "pin that" -> totalreclaw_pin. Migrating -> totalreclaw_import_from (dry_run first). "file that under X" / "that's a work thing" -> totalreclaw_set_scope. End of a substantive conversation -> totalreclaw_debrief. Guide: totalreclaw://guide.`; // Keep backward-compat export name (some callers may still reference it) export const SYSTEM_PROMPT_FRAGMENT = SERVER_INSTRUCTIONS; diff --git a/mcp/tests/server-instructions-budget.test.ts b/mcp/tests/server-instructions-budget.test.ts index 86ef942b..0d57d3c8 100644 --- a/mcp/tests/server-instructions-budget.test.ts +++ b/mcp/tests/server-instructions-budget.test.ts @@ -48,8 +48,8 @@ describe(`first ${FIRST_WINDOW} characters carry the essentials`, () => { it.each([ ['what the server is', /TotalReclaw is the user's encrypted long-term memory/], ['use it unprompted', /unprompted/], - ['when to recall', /totalreclaw_recall at the start of every conversation/], - ['when to remember', /totalreclaw_remember when the user shares a durable fact/], + ['when to recall', /ALWAYS call totalreclaw_recall at the start of EVERY conversation/], + ['when to remember', /totalreclaw_remember WITHOUT being asked[^\n]*durable fact/], ['phrase-safety one-liner', /recovery phrase must never enter this chat/], ['never ask, echo or print it', /Never ask for it, echo it or run a CLI that prints it/], ])('%s', (_label, pattern) => {