commit-history

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
The user wants a list of agent-linked commits. Filter args: $ARGUMENTS
Parse
$ARGUMENTS
for optional
branch=<name>
,
repo=<url-or-fragment>
, and
limit=<n>
tokens. A bare numeric token becomes the limit. Defaults: no branch filter, no repo filter, limit 100, max 500.
Call the
memory_commits
MCP tool with the parsed filters. If the MCP tool is unavailable, fall back to HTTP: build
GET $AGENTMEMORY_URL/agentmemory/commits
and append each filter as a URL-encoded query parameter (use
URLSearchParams
or
encodeURIComponent
on
branch
,
repo
, and
limit
) so values containing
?
,
&
, or
#
cannot corrupt the request. Include
Authorization: Bearer $AGENTMEMORY_SECRET
when set.
Render the result as a reverse-chronological list:
  • Short SHA, branch, authored timestamp
  • Commit message first line
  • Linked session id(s) (first 8 chars each) and observation counts where present
  • File count when
    files
    is provided
If the result is empty, tell the user the filter matched no commits and suggest dropping the branch/repo filter. Do not invent commits.
用户需要一份与Agent关联的提交列表。筛选参数:$ARGUMENTS
解析
$ARGUMENTS
以获取可选的
branch=<名称>
repo=<链接或片段>
limit=<数量>
参数。单独的数值参数将作为limit值。默认设置:无分支筛选、无仓库筛选、limit为100,最大为500。
调用带有解析后筛选条件的
memory_commits
MCP工具。如果MCP工具不可用,则回退到HTTP方式:构建
GET $AGENTMEMORY_URL/agentmemory/commits
请求,并将每个筛选条件作为URL编码的查询参数添加(对
branch
repo
limit
使用
URLSearchParams
encodeURIComponent
),以避免包含
?
&
#
的值破坏请求。当设置了
$AGENTMEMORY_SECRET
时,需包含
Authorization: Bearer $AGENTMEMORY_SECRET
请求头。
将结果按时间倒序渲染为列表:
  • 短SHA值、分支、提交时间戳
  • 提交信息首行
  • 关联的会话ID(每个显示前8个字符)及存在的观测计数
  • 当提供
    files
    字段时显示文件数量
如果结果为空,告知用户当前筛选条件未匹配到任何提交,并建议取消分支/仓库筛选。不得编造提交记录。