@echomem/mcp 1.4.70 → 1.4.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -7,12 +7,13 @@ import { ZodError } from "zod";
7
7
  import { acknowledgeWorkspaceTicketReviewSchema, applyWorkspaceTicketActionSchema, bindSourceSessionSchema, canonicalToolNames, completeGroupPublicationSchema, createGroupInviteSchema, createGroupSchema, deleteMemorySchema, flagPublicationAttentionSchema, findWorkspaceTicketCandidatesSchema, getGroupSessionSharingSchema, getByContextSchema, groupContextSchema, joinGroupSchema, keywordsSchema, listFriendsSchema, listToolSpecs, linkWorkspaceTicketSessionSchema, othersSchema, publishBatchToGroupSchema, publishToGroupSchema, prepareGroupPublicationSchema, publicMemorySchema, recordMemoryCitationsSchema, recordWorkspaceTicketProposalSchema, requestGroupSessionSharingSchema, reviewWorkspaceTicketSessionSchema, resolveCanonicalToolName, saveConversationSchema, searchMemoriesSchema, searchUsersSchema, sendFriendRequestSchema, timeRangeSchema, updateGroupProfileSchema, setGroupSessionSharingSchema, } from "./v1-contract.js";
8
8
  import { KeyStore } from "./keystore.js";
9
9
  import { EventLogger, hashText } from "./events.js";
10
+ import { requestFailureDetails } from "./request-failure.js";
10
11
  import { contextHealthMarkdown, recomposeCapsuleMarkdown } from "./hud/api.js";
11
12
  import { refreshInstalledLifecycleHooks } from "./hud/hooks.js";
12
13
  import { createHash, randomUUID } from "node:crypto";
13
14
  import { AsyncLocalStorage } from "node:async_hooks";
14
15
  import { fetchEncryptionConfig, decryptMemoryFields, verifyKeyB64, } from "./encryption.js";
15
- import { refreshInstalledMemoryGuidance, runCli } from "./setup.js";
16
+ import { refreshInstalledCodexSkills, refreshInstalledMemoryGuidance, runCli } from "./setup.js";
16
17
  import { MCP_PACKAGE_VERSION, MCP_SERVER_INSTRUCTIONS, MEMORY_CITATION_INSTRUCTION, SAVED_MEMORY_RECEIPT_INSTRUCTION, GROUP_SESSION_SHARING_DISABLED_NOTE, GROUP_SESSION_SHARING_PROMPTS_ENABLED, } from "./package-metadata.js";
17
18
  import { clearBillingAlert, writeBillingAlert } from "./billing-alert.js";
18
19
  import { checkLatestUpdateStatus, formatUpdateNotice, formatUpdateStatusText, startBackgroundUpdateCheck, } from "./update-check.js";
@@ -23,6 +24,12 @@ const ECHO_API_BASE_URL = process.env.ECHO_API_BASE_URL || "https://echo-mem-chr
23
24
  const ECHO_PRICING_URL = process.env.ECHO_PRICING_URL || "https://echoknows.com/dashboard/account";
24
25
  const ECHO_MEMORY_WEB_URL = (process.env.ECHO_MEMORY_WEB_URL || "https://echoknows.com/memory").replace(/\/$/, "");
25
26
  const DESKTOP_MANAGED = process.env.ECHO_DESKTOP_MANAGED === "1";
27
+ // No Echo API route may run past Vercel's 300s function limit, so a request
28
+ // still unanswered after this is a dead connection (sleep, network change).
29
+ // Without a limit, such a request waited until the OS gave up (~30 minutes).
30
+ const API_REQUEST_TIMEOUT_MS = 310_000;
31
+ // The routine ticket-fit review is a single database read (p95 under 2s).
32
+ const TICKET_REVIEW_TIMEOUT_MS = 30_000;
26
33
  const CONNECT_DEVICE_INSTRUCTION = DESKTOP_MANAGED
27
34
  ? "Open Echo Desktop, sign in, and choose Connect MCP, then retry this action."
28
35
  : "Run `echomem-mcp login` in a terminal to reconnect this device, then retry this action.";
@@ -154,21 +161,24 @@ function formatUpgradeRequiredResult(error) {
154
161
  const data = error.response?.data;
155
162
  if (!isRecord(data))
156
163
  return null;
164
+ const code = readString(data, "error") ?? readString(data, "code");
165
+ const normalizedCode = String(code || "").toUpperCase();
166
+ // Billing answers are a 402 *_REQUIRES_PLAN or a *_QUOTA_EXCEEDED code. Any
167
+ // other 403 (session not owned, no workspace access) and the per-minute
168
+ // rate limit are ordinary errors and must not ask the user to upgrade.
169
+ const quotaExceeded = normalizedCode.includes("QUOTA");
170
+ const planRequired = status === 402 || normalizedCode.includes("REQUIRES_PLAN");
171
+ if (!quotaExceeded && !planRequired)
172
+ return null;
157
173
  const upgradeUrl = readString(data, "upgradeUrl")
158
174
  ?? readString(data, "pricingUrl")
159
175
  ?? readString(data, "url")
160
176
  ?? ECHO_PRICING_URL;
161
177
  const message = readString(data, "message")
162
178
  ?? "Memory search and recall require an Echo Pro or Power plan.";
163
- const code = readString(data, "error") ?? readString(data, "code");
164
179
  const plan = readString(data, "plan");
165
180
  const pricingUrl = appendDesktopClientHint(appendPricingSource(upgradeUrl, "mcp_search"));
166
- const normalizedCode = String(code || "").toUpperCase();
167
- const kind = status === 429 || normalizedCode.includes("QUOTA") || normalizedCode.includes("LIMIT")
168
- ? "quota_exceeded"
169
- : status === 402 || normalizedCode.includes("REQUIRES_PLAN")
170
- ? "plan_required"
171
- : "billing_attention";
181
+ const kind = quotaExceeded ? "quota_exceeded" : "plan_required";
172
182
  writeBillingAlert({
173
183
  kind,
174
184
  code,
@@ -744,6 +754,7 @@ class EchoMemApiClient {
744
754
  this.activeToken = store.getToken();
745
755
  this.axios = axios.create({
746
756
  baseURL: ECHO_API_BASE_URL.replace(/\/$/, ""),
757
+ timeout: API_REQUEST_TIMEOUT_MS,
747
758
  headers: {
748
759
  "Content-Type": "application/json",
749
760
  "X-Echo-Client": "mcp",
@@ -933,6 +944,7 @@ class EchoMemApiClient {
933
944
  groupId: parsed.groupId,
934
945
  memoryThreshold: parsed.memoryThreshold,
935
946
  },
947
+ timeout: TICKET_REVIEW_TIMEOUT_MS,
936
948
  });
937
949
  return response.data;
938
950
  }
@@ -1427,6 +1439,7 @@ class EchoMemApiClient {
1427
1439
  endDate: parsed.endDate,
1428
1440
  limit: parsed.limit,
1429
1441
  requestId: randomUUID(),
1442
+ sessionId: this.sessionId,
1430
1443
  });
1431
1444
  return enc.enabled ? await this.decryptResult(response.data, enc.key) : response.data;
1432
1445
  }
@@ -2051,6 +2064,13 @@ class EchoMemMCPServer {
2051
2064
  }
2052
2065
  catch (error) {
2053
2066
  rec.error_kind = classifyError(error);
2067
+ // Memory search reports its own request trace; every other tool gets
2068
+ // its failure detail (HTTP status, upstream code, timeout or network) here.
2069
+ if (rec.http_status === undefined && rec.error_code === undefined) {
2070
+ const failure = requestFailureDetails(error);
2071
+ rec.http_status = failure.httpStatus;
2072
+ rec.error_code = failure.errorCode;
2073
+ }
2054
2074
  if (error instanceof NoTokenError) {
2055
2075
  // Not isError: a normal "not connected yet" state. Once `login` runs, the next call works.
2056
2076
  return {
@@ -3800,6 +3820,8 @@ async function main() {
3800
3820
  // Existing standalone users may receive a new runtime without re-running setup. Refresh only
3801
3821
  // EchoMem's marker-owned block so stale Desktop-era instructions disappear automatically.
3802
3822
  refreshInstalledMemoryGuidance();
3823
+ // Codex skills carry the same instructions, so refresh the ones setup already installed.
3824
+ refreshInstalledCodexSkills();
3803
3825
  // Lifecycle hooks go stale the same way, Desktop installs included: each keeps running the
3804
3826
  // runtime version that wrote it until something repoints it.
3805
3827
  refreshInstalledLifecycleHooks();
@@ -37,7 +37,7 @@ const MCP_UPDATE_INSTRUCTION = MCP_DESKTOP_MANAGED
37
37
  ? "install the MCP update from Echo Desktop (Settings, MCP)"
38
38
  : `updates auto-install in the background; on failure run \`${MCP_UPDATE_ALL_COMMAND}\``;
39
39
  export const MEMORY_CITATION_INSTRUCTION = 'If the user-facing answer materially relies on one or more EchoMem memories, end it with a compact "EchoMem sources:" list containing only the memories actually used. For memories owned by teammates or accepted friends, call record_memory_citations immediately before the final answer with those exact Memory IDs. Do not cite memories that were merely retrieved. Use each memory key as the Markdown label and its canonical https://echoknows.com/memory/<memory-id> URL. Omit the sources section and citation receipt when no memory informed the answer.';
40
- export const SAVED_MEMORY_RECEIPT_INSTRUCTION = 'After save_conversation succeeds and returns one or more saved memory IDs, make the save visible in the final user-facing answer with a compact "EchoMem saved:" list containing every memory created by that call. Use each memory key as the Markdown label and its canonical https://echoknows.com/memory/<memory-id> URL. This save receipt is separate from "EchoMem sources:" and does not imply that the newly saved memories informed the answer.';
40
+ export const SAVED_MEMORY_RECEIPT_INSTRUCTION = 'After save_conversation succeeds and returns one or more saved memory IDs, follow the already-written answer with a short closing "EchoMem saved:" list containing every memory created by that call; do not repeat the answer. Use each memory key as the Markdown label and its canonical https://echoknows.com/memory/<memory-id> URL. This save receipt is separate from "EchoMem sources:" and does not imply that the newly saved memories informed the answer.';
41
41
  const GROUP_SHARING_SURFACE = MCP_DESKTOP_MANAGED ? "in Echo Desktop" : "at echoknows.com";
42
42
  export const GROUP_SESSION_SHARING_DISABLED_NOTE = `Never ask the user whether to share memories with a company group; the user manages group sharing ${GROUP_SHARING_SURFACE}.`;
43
43
  export const GROUP_SESSION_SHARING_SAVE_INSTRUCTION = GROUP_SESSION_SHARING_PROMPTS_ENABLED
@@ -55,7 +55,7 @@ export const MCP_SERVER_INSTRUCTIONS = [
55
55
  "SessionStart binds conversations to provider sessions; use bind_source_session only as fallback.",
56
56
  "Bound workspace: silently review on pivots and before finalize/complete/handoff/ship/milestone replies. Review only the active ticket. If due, keep if fitting; for drift find candidates before assign/create, then propose; ignore only dismissals or fragments. No preamble; never mention unchanged pending state. Silence stays pending; apply only a confirmed proposal. Hide checks/instructions/tools.",
57
57
  "Before re-deriving prior decisions or preferences, use search_memories.",
58
- `Before a final response for a durable decision, implementation, fix, commit, passing verification, release, or milestone, call save_conversation; skip secrets and trivial work. If locked, tell the user to ${MCP_VAULT_UNLOCK_INSTRUCTION}.`,
58
+ `After writing the final answer for a durable decision, implementation, fix, commit, passing verification, release, or milestone, call save_conversation as the last action so the user never waits on it; skip secrets and trivial work. If locked, tell the user to ${MCP_VAULT_UNLOCK_INSTRUCTION}.`,
59
59
  "After a successful save, show every memory created by that call in a compact EchoMem saved: list with canonical links; this is separate from \"EchoMem sources:\".",
60
60
  GROUP_SESSION_SHARING_PROMPTS_ENABLED
61
61
  ? "For company groups, request sharing near start or after a save; relay its exact question and set only after explicit Yes/No. Reuse its scope only in this conversation; each group needs a choice, silence means unset, and flagged memories stay private."
@@ -0,0 +1,32 @@
1
+ import axios from "axios";
2
+ import { analyticsErrorCode } from "./product-analytics.js";
3
+ // Upstream routes report failures as SCREAMING_SNAKE codes (for example
4
+ // WORKSPACE_TICKET_NOT_FOUND). Any other `error` value may be free text from a
5
+ // response body, which must never leave the bridge.
6
+ const UPSTREAM_ERROR_CODE = /^[A-Z][A-Z0-9_]{1,79}$/;
7
+ function upstreamErrorCode(data) {
8
+ if (typeof data !== "object" || data === null || Array.isArray(data))
9
+ return undefined;
10
+ const record = data;
11
+ for (const key of ["error", "code", "errorCode"]) {
12
+ const value = record[key];
13
+ if (typeof value === "string" && UPSTREAM_ERROR_CODE.test(value))
14
+ return value;
15
+ }
16
+ return undefined;
17
+ }
18
+ /**
19
+ * Telemetry-safe description of a failed backend request: the HTTP status and
20
+ * a token-like code. The code is the upstream error code when the response
21
+ * carries one, `http_<status>` otherwise, and `timeout` or `network` when no
22
+ * response arrived. Errors that are not HTTP requests yield nothing.
23
+ */
24
+ export function requestFailureDetails(error) {
25
+ if (!axios.isAxiosError(error))
26
+ return {};
27
+ const status = error.response?.status;
28
+ if (typeof status === "number") {
29
+ return { httpStatus: status, errorCode: upstreamErrorCode(error.response?.data) ?? `http_${status}` };
30
+ }
31
+ return { errorCode: analyticsErrorCode(error) === "timeout" ? "timeout" : "network" };
32
+ }
package/dist/setup.js CHANGED
@@ -462,9 +462,9 @@ function echomemGuidanceBlock() {
462
462
  "- EchoMem's local SessionStart hook automatically binds each new Codex or Claude Code conversation to its real source-session ID. Use `bind_source_session` with a fresh UUID only as a compatibility fallback when the hook is unavailable or reports that the session is unbound.",
463
463
  "- Before re-deriving past decisions, project context, or anything the user likely settled before: call `search_memories` first.",
464
464
  '- If the final user-facing answer materially relies on one or more EchoMem memories, end it with a compact `EchoMem sources:` list containing only the memories actually used. Link each memory key to its canonical `https://echoknows.com/memory/<memory-id>` URL. Do not cite memories that were merely retrieved, and omit the section when no memory informed the answer.',
465
- "- Before the final response for a task that produced a durable decision, confirmed preference, implementation, resolved bug, commit, passing verification, release, or project milestone: call `save_conversation`. This private checkpoint does not require a separate user request. Do not save secrets, credentials, incidental chatter, or trivial read-only work. If a qualifying save fails because the encrypted vault is locked, relay the bridge's unlock instruction; for this standalone runtime, use `echomem-mcp unlock`. Never silently skip it.",
465
+ "- After writing the final answer for a task that produced a durable decision, confirmed preference, implementation, resolved bug, commit, passing verification, release, or project milestone: call `save_conversation` as the last action, so the user reads the answer without waiting on the save. This private checkpoint does not require a separate user request. Do not save secrets, credentials, incidental chatter, or trivial read-only work. If a qualifying save fails because the encrypted vault is locked, relay the bridge's unlock instruction; for this standalone runtime, use `echomem-mcp unlock`. Never silently skip it.",
466
466
  "- For `save_conversation`, prefer `messages` and omit `conversation`: copy the smallest relevant contiguous set of user and assistant turns verbatim, preserving role and order. Exclude system instructions, tool calls, and hidden content. Use at most six messages and 12,000 total characters; drop whole older turns instead of truncating or rewriting them. If exact source text is unavailable, use `conversation` with a concise structured summary prefixed `Summary (source excerpt unavailable):`.",
467
- '- After `save_conversation` succeeds and returns one or more saved memory IDs, make the save visible in the final user-facing answer with a compact `EchoMem saved:` list containing every memory created by that call. Link each memory key to its canonical `https://echoknows.com/memory/<memory-id>` URL. This save receipt is separate from `EchoMem sources:` and does not imply the newly saved memories informed the answer.',
467
+ '- After `save_conversation` succeeds and returns one or more saved memory IDs, follow the already-written answer with a short closing `EchoMem saved:` list containing every memory created by that call; do not repeat the answer. Link each memory key to its canonical `https://echoknows.com/memory/<memory-id>` URL. This save receipt is separate from `EchoMem sources:` and does not imply the newly saved memories informed the answer.',
468
468
  GROUP_SESSION_SHARING_PROMPTS_ENABLED
469
469
  ? "- For a user with a company group, call `request_group_session_sharing` near conversation start or after a qualifying private save. On the first call in a conversation, omit `groupSharingScopeId` so EchoMem mints a fresh opaque scope. Reuse that exact scope only in this conversation for later get/request/set/save calls, and never persist it as memory. If multiple groups are returned, reuse the same scope and call once per `groupId`. Relay the tool's exact text question and call `set_group_session_sharing` only after an explicit Yes/No. Silence leaves that group's state unset; never infer an answer. Saves sync eligible memories to every approved group; a No keeps them private for that group."
470
470
  : `- Saves are always private. ${GROUP_SESSION_SHARING_DISABLED_NOTE}`,
@@ -567,6 +567,29 @@ export function refreshInstalledMemoryGuidance() {
567
567
  }
568
568
  }
569
569
  }
570
+ /** Refresh EchoMem-owned Codex skills that are already installed; never installs missing ones. */
571
+ export function refreshInstalledCodexSkills() {
572
+ let skillsRoot;
573
+ try {
574
+ skillsRoot = path.join(codexHome(), "skills");
575
+ }
576
+ catch {
577
+ return;
578
+ }
579
+ const templateRoot = fileURLToPath(new URL("../templates/codex-skills/", import.meta.url));
580
+ for (const skillName of CODEX_SKILL_NAMES) {
581
+ const source = path.join(templateRoot, skillName);
582
+ const destination = path.join(skillsRoot, skillName);
583
+ try {
584
+ if (!fs.existsSync(destination) || packagedSkillMatches(source, destination))
585
+ continue;
586
+ fs.cpSync(source, destination, { recursive: true, force: true });
587
+ }
588
+ catch {
589
+ // Unreadable or externally managed skill folders are left untouched.
590
+ }
591
+ }
592
+ }
570
593
  /** Merge the EchoMem entry into a JSON client's `mcpServers` map without clobbering siblings. */
571
594
  export function writeJsonClientConfig(configPath, entry, options = {}) {
572
595
  const config = readJsonObjectFile(configPath, "MCP client configuration");
@@ -1264,7 +1264,7 @@ export function listToolSpecs(opts = {}) {
1264
1264
  },
1265
1265
  {
1266
1266
  name: canonicalToolNames.save,
1267
- description: `Save durable knowledge from this conversation into the user's private EchoMem (durable memories are extracted automatically). Call before the final response when work produced a durable decision, confirmed preference, implementation, resolved bug, commit, passing verification, release, or project milestone; this private checkpoint does not require a separate user request. Omit secrets, incidental chatter, and trivial read-only work. If the encrypted vault is locked, tell the user to ${MCP_VAULT_UNLOCK_INSTRUCTION} and never silently skip a qualifying checkpoint. Private persistence happens first.${GROUP_SESSION_SHARING_SAVE_INSTRUCTION} New extraction input uses the plan's weekly processing allowance; if the limit is reached, nothing is saved. passthrough=true stores the text verbatim as a session capsule. ${SAVED_MEMORY_RECEIPT_INSTRUCTION}`,
1267
+ description: `Save durable knowledge from this conversation into the user's private EchoMem (durable memories are extracted automatically). Call after writing the final answer, as the turn's last action, when work produced a durable decision, confirmed preference, implementation, resolved bug, commit, passing verification, release, or project milestone; this private checkpoint does not require a separate user request. Omit secrets, incidental chatter, and trivial read-only work. If the encrypted vault is locked, tell the user to ${MCP_VAULT_UNLOCK_INSTRUCTION} and never silently skip a qualifying checkpoint. Private persistence happens first.${GROUP_SESSION_SHARING_SAVE_INSTRUCTION} New extraction input uses the plan's weekly processing allowance; if the limit is reached, nothing is saved. passthrough=true stores the text verbatim as a session capsule. ${SAVED_MEMORY_RECEIPT_INSTRUCTION}`,
1268
1268
  inputSchema: {
1269
1269
  type: "object",
1270
1270
  properties: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@echomem/mcp",
3
- "version": "1.4.70",
3
+ "version": "1.4.71",
4
4
  "description": "EchoMem MCP bridge for cross-agent memory, local history import, and recall",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -36,7 +36,7 @@
36
36
  "test:config-safety": "npm run build && node test/config-safety.test.mjs",
37
37
  "test:billing-ui": "npm run build && node test/setup-ui.test.mjs billing",
38
38
  "test:mcp-control": "npm run build && node test/mcp-control.test.mjs",
39
- "test": "npm run build && node test/source-session.test.mjs && node test/source-session-stress.test.mjs && node test/cowork-ticket-session.test.mjs && node test/ticket-review-format.test.mjs && node test/schema-parity.test.mjs && node test/ticket-overview.test.mjs && node test/ticket-stewardship-contract.test.mjs && node test/stewardship-integration.test.mjs && node test/source-session-hook.test.mjs && node test/local-data-paths.test.mjs && node test/crypto.test.mjs && node test/integration.test.mjs && node test/onboarding-resilience.test.mjs && node test/local-auth.test.mjs && node test/product-analytics.test.mjs && node test/retrieval-only.test.mjs && node test/no-restart.test.mjs && node test/canonical-golden.test.mjs && node test/tools.test.mjs && node test/workspace-selector.test.mjs && node test/group-map.test.mjs && node test/update-check.test.mjs && node test/headless-runtime.test.mjs && node test/claude-code-config.test.mjs && node test/config-safety.test.mjs && node test/mcp-control.test.mjs && node test/delete.test.mjs && node test/low-touch-tools.test.mjs && node test/migrate.test.mjs && node test/restart-recovery.test.mjs && node test/save-checkpoint-hook.test.mjs && node test/durable-entry.test.mjs && node test/lifecycle-hook-refresh.test.mjs && node test/durable-reexec.test.mjs && node test/doctor.test.mjs && node test/environment-matrix.test.mjs",
39
+ "test": "npm run build && node test/source-session.test.mjs && node test/source-session-stress.test.mjs && node test/cowork-ticket-session.test.mjs && node test/ticket-review-format.test.mjs && node test/schema-parity.test.mjs && node test/ticket-overview.test.mjs && node test/ticket-stewardship-contract.test.mjs && node test/stewardship-integration.test.mjs && node test/source-session-hook.test.mjs && node test/local-data-paths.test.mjs && node test/crypto.test.mjs && node test/integration.test.mjs && node test/onboarding-resilience.test.mjs && node test/local-auth.test.mjs && node test/product-analytics.test.mjs && node test/request-failure.test.mjs && node test/retrieval-only.test.mjs && node test/no-restart.test.mjs && node test/canonical-golden.test.mjs && node test/tools.test.mjs && node test/workspace-selector.test.mjs && node test/group-map.test.mjs && node test/update-check.test.mjs && node test/headless-runtime.test.mjs && node test/claude-code-config.test.mjs && node test/config-safety.test.mjs && node test/mcp-control.test.mjs && node test/delete.test.mjs && node test/low-touch-tools.test.mjs && node test/migrate.test.mjs && node test/restart-recovery.test.mjs && node test/save-checkpoint-hook.test.mjs && node test/durable-entry.test.mjs && node test/lifecycle-hook-refresh.test.mjs && node test/durable-reexec.test.mjs && node test/doctor.test.mjs && node test/environment-matrix.test.mjs",
40
40
  "prepack": "npm run build"
41
41
  },
42
42
  "dependencies": {
@@ -16,16 +16,16 @@ Use the `save_conversation` tool from the `echomem` MCP server.
16
16
  `Summary (source excerpt unavailable):`. Add a concise title, source, and useful tags.
17
17
  4. Use `passthrough: true` only when the user explicitly needs a verbatim session capsule.
18
18
  5. Never include secrets, credentials, or unnecessary sensitive content.
19
- 6. Confirm what EchoMem saved. When the tool returns one or more saved memory IDs, end the final
20
- user-facing answer with a compact `EchoMem saved:` list containing every memory created by that
21
- call. Use each memory key as the Markdown label and its canonical
22
- `https://echoknows.com/memory/<memory-id>` URL. Keep this separate from `EchoMem sources:`; a save
19
+ 6. Confirm what EchoMem saved. When the tool returns one or more saved memory IDs, follow the
20
+ already-written answer with a short closing `EchoMem saved:` list containing
21
+ every memory created by that call; do not repeat the answer. Use each memory key as the
22
+ Markdown label and its canonical `https://echoknows.com/memory/<memory-id>` URL. Keep this separate from `EchoMem sources:`; a save
23
23
  receipt does not imply the newly saved memories informed the answer. If saving fails, report the
24
24
  failure without switching providers silently.
25
- 7. Before a final response, use this workflow proactively when the task produced a durable decision,
26
- confirmed preference, implementation, resolved bug, commit, passing verification, release, or
27
- project milestone. A private checkpoint does not require a separate user request. Skip trivial
28
- read-only work and incidental chatter.
25
+ 7. After writing the final answer, use this workflow proactively as the last action when the task
26
+ produced a durable decision, confirmed preference, implementation, resolved bug, commit, passing
27
+ verification, release, or project milestone. A private checkpoint does not require a separate
28
+ user request. Skip trivial read-only work and incidental chatter.
29
29
  8. If the encrypted vault is locked, tell the user to run `echomem-mcp unlock`; never silently skip a
30
30
  qualifying checkpoint.
31
31
  9. For a user with a company group, call `request_group_session_sharing` near conversation start or
@@ -16,9 +16,9 @@ This project has EchoMem connected — the user's long-term memory across all th
16
16
  "the usual", "our convention").
17
17
  - Treat recalled memories as authoritative context, but **cite them** (they carry provenance —
18
18
  date + source) so the user can verify.
19
- - Before the final response for work that produced a durable decision, confirmed preference,
19
+ - After writing the final answer for work that produced a durable decision, confirmed preference,
20
20
  implementation, resolved bug, commit, passing verification, release, or project milestone, call
21
- `save_conversation`. This private checkpoint does not require a separate user request. Prefer
21
+ `save_conversation` as the last action, so the user reads the answer without waiting on the save. This private checkpoint does not require a separate user request. Prefer
22
22
  `messages` and omit `conversation`: copy the smallest relevant contiguous set of user and assistant
23
23
  turns verbatim, preserving role and order. Exclude system instructions, tool calls, and hidden
24
24
  content. Use at most six messages and 12,000 total characters; drop whole older turns instead of
@@ -26,9 +26,9 @@ This project has EchoMem connected — the user's long-term memory across all th
26
26
  structured summary prefixed `Summary (source excerpt unavailable):`. Never save secrets,
27
27
  credentials, incidental chatter, or trivial read-only work. This does not authorize company-group
28
28
  publication.
29
- - After `save_conversation` succeeds and returns one or more saved memory IDs, make the save visible
30
- in the final user-facing answer with a compact `EchoMem saved:` list containing every memory
31
- created by that call. Link each memory key to its canonical
29
+ - After `save_conversation` succeeds and returns one or more saved memory IDs, follow the
30
+ already-written answer with a short closing `EchoMem saved:` list containing every memory
31
+ created by that call; do not repeat the answer. Link each memory key to its canonical
32
32
  `https://echoknows.com/memory/<memory-id>` URL. This save receipt is separate from
33
33
  `EchoMem sources:` and does not imply that the newly saved memories informed the answer.
34
34
  - For a user with a company group, call `request_group_session_sharing` near conversation start or