Skip to content

修复 Agent Hook 卸载后自动注入及 Codex trust 失败残留 - #607

Closed
Orsted290 wants to merge 41 commits into
MemTensor:v1.2.3from
Orsted290:fix-codex-hook-repeat-install
Closed

Orsted290 wants to merge 41 commits into
MemTensor:v1.2.3from
Orsted290:fix-codex-hook-repeat-install

Conversation

@Orsted290

Copy link
Copy Markdown
Contributor

问题定位

  • 手动移除 Agent Hook、插件或 Skill 后,状态变为 not_connected,自动注入将其误判为尚未安装并重新写入;页面状态与磁盘文件可能不一致。
  • Codex 安装先写入 Hook 文件和 hooks.json,再请求 Hook trust。Trust 失败时,状态未更新为 plugin_installed,原流程也未回滚已写入的文件。
  • standalone Memory runtime 的自动安装与手动卸载并发时,旧状态快照可能漏掉抑制标记,留下自动写入的 Hook。

修改内容

  • 增加持久化自动注入抑制状态:手动卸载后跳过自动注入,手动安装成功后解除;安装与手动卸载并发时,App backend 和 Memory runtime 都重新读取最新状态并清理自动写入。
  • Codex Hook 安装对配置、脚本、bridge 和 hooks.json 做快照;写入或 trust 失败时恢复原文件内容、权限和符号链接,并删除原先不存在的文件。安装服务仅在目标安装成功后更新状态。
  • 保留 5023e09b 中的 Codex CLI 查找修复。

验证

  • Memory runtime 定向测试:17/17 通过,包含并发卸载回归。
  • backend 定向用例:6/6 通过;需要本地回环监听的 Codex Hook 用例在沙箱外运行,2/2 通过。
  • Memory 与 backend typecheck、backend lint 通过。
  • 打包版 1.2.1 arm64 卸载后重启验证:Cursor 和 Codex 未触发 Memmy Hook、未自动写回;随后重新安装并确认文件恢复。
  • 打包版 Codex trust 故障注入:临时 app-server 返回退出码 73;原本无 Hook 时新增文件被清理,原本有文件或链接时内容、权限和链接目标均恢复。该测试直接调用打包产物中的安装器,未经过桌面 UI。

未完成与已知限制

  • OpenClaw、WorkBuddy 的打包版卸载后启动验证尚未完成。
  • 较宽 backend 测试批次有 3 项 analytics 断言仍期待布尔值,而 analytics 实现按 GA4 要求将布尔值规范化为 1/0;这些断言不在本次改动范围内。
  • 保存的 root 全量测试日志另有 release-notes 测试失败(29 通过、1 失败、5 跳过),尚未确认与本次改动相关。

Anson-Se and others added 30 commits September 26, 2026 13:17
…mand

A turn routed as end_topic used to be dropped from L1 capture as a whole,
so feedback, work conventions and instructions sent together with the
closing words never reached L1, user memory or the episode reward.

Only a bare end-topic command ("结束会话" / "不聊了") is still kept out of
L1. Every other end_topic turn now goes through the same capture decision
as a normal turn; the closed episode waits for that decision before
reflection and reward are queued.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Preserve complete extraction for PDF and Office documents and return bounded chunks with continuation offsets. Select PDF pages before pagination and keep continuation hints within the tool result budget.

Add regression fixtures, runtime recovery checks, reproducible benchmarks, and isolated account-model review scripts. Record 140 passing tests, typecheck results, and three successful live synthetic scenarios. Leave plain-text pagination and extraction caching outside this change.
A trailing newline was shown as an extra blank line, so patches against one-line memory files failed to match.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the long-document fix limited to the runtime change and its tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Every memmy-memory run reports memmy_cli_* events to the cloud analytics
endpoint. resolveCommandIdentity took the second positional word as
command_action unconditionally, which was meant for subcommands such as
`session close`. For search, add, get and delete that word is the search
query, the memory text or the memory id, so it was sent verbatim. An
unrecognized first word was also sent verbatim as command_group.

command_action is now reported only when the first word is a group with
subcommands (service, session, turn, raw) and the second word is one of
that group's known subcommands; raw methods match case-insensitively, as
runRaw does. An unrecognized first word is reported as command_group
"unknown". The known commands live in a small table in analytics.ts that
mirrors runCommand and mapTopLevelCommand. has_session_id and has_turn_id
are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The session close route only woke the auto worker when the close result
listed closed episodes, jobs, or scheduled evolution. For an L3 World
Model v2 session, closeSession also freezes the pending L3 evidence
batches and queues l3_world_model_update jobs, but it does not return
them. When the session's episode had already closed earlier (idle
timeout or end_topic), closedEpisodeIds was empty and nothing woke the
worker. The worker does not poll, so the new L3 jobs stayed queued until
an unrelated request happened to wake it.

The close route now always schedules the worker, as the token compaction
boundary already does after freezing batches. A close with no follow-up
work costs one empty drain. A new REST contract test closes an L3 v2
session whose episode had already ended and checks that the worker picks
up the frozen L3 job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Synchronize the main branch code to the v1.2.0 branch
App updates left previously installed Cursor, Claude Code, and Codex hooks on the first-install script. Startup now compares the stored hook fingerprint and reinstalls when it is missing or stale.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the hook revision test beside the Cursor resume test renamed on v1.2.1.

Co-authored-by: Cursor <cursoragent@cursor.com>
DeepSeek Harness no longer accepts a generic plugin message source, and completed assistant turns are recorded as assistant/message.

Co-authored-by: Cursor <cursoragent@cursor.com>
DeepSeek Harness rejects official model requests when an enabled plugin manifest has no version.

Co-authored-by: Cursor <cursoragent@cursor.com>
fix(dsh): restore Memmy plugin activation across supported DSH tags
fix: remove legacy memory embedding config
A stored fingerprint no longer counts as current unless the on-disk script and bridge match it, and the fingerprint is recorded only after the rest of the install succeeds.

Co-authored-by: Cursor <cursoragent@cursor.com>
Send account identity with plugin and scan events, and coerce boolean params so GA4 keeps the events.
fix(analytics): report each newly stored memory once
…ding

fix(documents): 支持长文档分段续读
…ry-repair-queue

fix: deprioritize startup summary repairs
…-worker

fix(memory): wake the worker after every session close
v1.2.2 requires the turn capture decision to return a non-empty l1.title
together with l1.summary. The mixed feedback-and-closing test stub only
returned a summary, so the capture decision threw and the closing L1 stayed
in resolving instead of being activated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and-action

fix(memory): stop sending CLI arguments as analytics command actions
@Orsted290
Orsted290 changed the base branch from v1.2.2 to v1.2.3 October 12, 2026 07:02
@Orsted290 Orsted290 closed this Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants