handoff
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseThe user wants to resume work. Optional cwd override: $ARGUMENTS
Determine the current project path: if is provided, resolve it to an absolute, normalized path (accept relative inputs, e.g. ); otherwise use the current working directory.
$ARGUMENTSpath.resolve(process.cwd(), $ARGUMENTS)Call the MCP tool. From the result, pick the most recent session whose normalized matches the project path with a directory-boundary check — equality OR OR . Do NOT use a raw string prefix match: it produces false positives across unrelated repos that share a path prefix (e.g. vs ). Prefer sessions with status over . If nothing matches, fall back to the single most recent session overall.
memory_sessionscwdsession.cwd.startsWith(projectPath + path.sep)projectPath.startsWith(session.cwd + path.sep)/repo-a/repo-a-stagingcompletedabandonedOnce a session is selected:
- If the session ended on an unanswered user-facing question, surface that question FIRST as the lead. Look for it in or in the last few observations (type
summarywithconversationending innarrative).? - Then summarize the session: title/summary, key files touched, key decisions or errors. Use with a query derived from the session's top concepts to fetch supporting observations, limit 10.
memory_recall - End with a short "next step?" pointer the user can act on.
If neither MCP tool is available, fall back to HTTP: and with when set.
GET $AGENTMEMORY_URL/agentmemory/sessionsPOST $AGENTMEMORY_URL/agentmemory/recallAuthorization: Bearer $AGENTMEMORY_SECRETDo not invent observations. If the most recent session has zero observations, say so and offer to start fresh.
用户希望恢复工作。可选的工作目录覆盖参数:$ARGUMENTS
确定当前项目路径:如果提供了,将其解析为绝对规范化路径(接受相对输入,例如);否则使用当前工作目录。
$ARGUMENTSpath.resolve(process.cwd(), $ARGUMENTS)调用 MCP工具。从结果中选择最近的会话,该会话的规范化需通过目录边界检查与项目路径匹配——完全相等,或,或。请勿使用原始字符串前缀匹配:这会在共享路径前缀的无关仓库中产生误判(例如与)。优先选择状态为的会话,而非的会话。如果没有匹配项,则退而求其次选择整体最近的单个会话。
memory_sessionscwdsession.cwd.startsWith(projectPath + path.sep)projectPath.startsWith(session.cwd + path.sep)/repo-a/repo-a-stagingcompletedabandoned选定会话后:
- 如果会话以未解答的用户可见问题结束,首先将该问题作为开头展示。在或最后几条观测记录(类型为
summary且conversation以narrative结尾)中查找该问题。? - 然后总结会话:标题/摘要、涉及的关键文件、关键决策或错误。使用工具,基于会话的核心概念生成查询语句,获取支持性观测记录,限制为10条。
memory_recall - 最后以简短的“下一步?”引导语结尾,供用户采取行动。
如果上述两个MCP工具均不可用,则退而使用HTTP方式:调用,以及在设置了时调用。
GET $AGENTMEMORY_URL/agentmemory/sessionsAuthorization: Bearer $AGENTMEMORY_SECRETPOST $AGENTMEMORY_URL/agentmemory/recall请勿编造观测记录。如果最近的会话没有任何观测记录,请如实告知并提议重新开始。