OpenViking icon indicating copy to clipboard operation
OpenViking copied to clipboard

[Bug]: ov-memory-doctor.mjs does not support Antigravity and falls back to cursor

Open wycocoyu opened this issue 2 weeks ago • 1 comments

Issue Origin

Observed or reproduced in a real environment

Bug Description

After #7710 and #7715 added Antigravity (agy CLI and desktop app) support to agent-hook-plugin and install.sh, examples/agent-hook-plugin/scripts/ov-memory-doctor.mjs was not updated for Antigravity.

Running ov-memory-doctor.mjs from ~/.openviking/agent-integrations/antigravity/scripts/ (even when passing antigravity explicitly) falls back to cursor and fails against non-existent ~/.cursor/ paths. Furthermore, even with antigravity added to CLIENTS, three host-specific behaviors in ov-memory-doctor.mjs are incompatible with Antigravity:

  1. CLIENTS lacks antigravity, so resolveClient() ignores integration.json ("client": "antigravity") and defaults to "cursor".
  2. hooks.json event parsing reads hooks.data.hooks?.events || hooks.data.hooks, whereas Antigravity places events under the "openviking-memory" top-level plugin key (hooks.data["openviking-memory"]). Also, manually configured commands without OPENVIKING_INTEGRATION_ID or unquoted .mjs script paths are not checked properly.
  3. Antigravity's installer intentionally leaves ~/.gemini/config/mcp_config.json untouched (mcpOptional), yet the existing MCP check treats a missing openviking entry as a fail and tells users to re-run --harness antigravity.
  4. checkActivity() counts a session as captured only when capturedHashes or capturedTurnIds is non-empty, whereas the Antigravity adapter (hosts/antigravity.mjs) tracks progress via lastStep. With more than 3 Antigravity sessions, the doctor falsely warns "no session has ever captured a turn".

Steps to Reproduce

  1. Install the Antigravity plugin via curl -fsSL https://openviking.ai/install | bash -s -- --yes --harness antigravity.
  2. Run node ~/.openviking/agent-integrations/antigravity/scripts/ov-memory-doctor.mjs (or pass antigravity as an argument).
  3. Observe the report falls back to cursor and exits with code 1.

Expected Behavior

ov-memory-doctor.mjs automatically resolves antigravity from integration.json (or CLI argument), checks ~/.gemini/config/plugins/openviking-memory/hooks.json (SessionStart, PreInvocation, Stop), handles optional ~/.gemini/config/mcp_config.json cleanly, and recognizes lastStep in ~/.openviking/hook-state/antigravity/*.json without false warnings.

Actual Behavior

  · running from ~/.openviking/agent-integrations/antigravity (version 0.5.34, client cursor)
  ⚠ this copy was installed for antigravity, not cursor
  ✗ no hooks template for cursor → re-run the installer
  ✗ ~/.cursor/hooks.json not found → re-run the installer with --harness cursor

OpenViking Version

0.5.6.dev50 / agent-hook-plugin 0.5.34

Python Version

3.13 (Node.js v24.16.0)

Operating System

macOS

中文说明

问题来源

在真实环境中观察并复现。

Bug 描述

PR #7710 和 #7715 为 agent-hook-plugin 与安装脚本加入了 Antigravity(agy CLI 与桌面端)支持,但诊断脚本 examples/agent-hook-plugin/scripts/ov-memory-doctor.mjs 未同步适配 Antigravity。

直接运行 ~/.openviking/agent-integrations/antigravity/scripts/ov-memory-doctor.mjs(即便显式传入 antigravity 参数),也会回退成检查 cursor 并报错退出。此外,即使仅在 CLIENTS 中补上 antigravity,脚本中仍有几处与 Antigravity 宿主格式不兼容:

  1. CLIENTS 映射缺少 antigravity,导致 resolveClient() 无法识别 integration.json 中的 "client": "antigravity",兜底回退为 "cursor"。
  2. hooks.json 事件提取写死了 hooks.data.hooks?.events || hooks.data.hooks,而 Antigravity 的 hooks.json 将事件挂在顶层插件键 "openviking-memory" 下;同时手动安装(不含 OPENVIKING_INTEGRATION_ID 或路径无单引号)时也无法正确识别与校验脚本路径。
  3. 安装脚本明确不自动写入 ~/.gemini/config/mcp_config.json,但原有 MCP 检查在缺失 openviking 时会报 fail 并指引用户重跑 --harness antigravity(死循环无效指引)。
  4. checkActivity() 仅依据 capturedHashes 或 capturedTurnIds 判断是否捕获过对话,而 Antigravity 适配器(hosts/antigravity.mjs)使用 lastStep 游标记录进度;一旦本机超过 3 个 Antigravity 会话,诊断脚本会 100% 误报 "no session has ever captured a turn"。

复现步骤

  1. 运行 curl -fsSL https://openviking.ai/install | bash -s -- --yes --harness antigravity 安装插件。
  2. 执行 node ~/.openviking/agent-integrations/antigravity/scripts/ov-memory-doctor.mjs(或传入 antigravity)。
  3. 观察输出回退为 cursor 并以退出码 1 失败。

预期行为

ov-memory-doctor.mjs 应自动识别 antigravity,校验 ~/.gemini/config/plugins/openviking-memory/hooks.json 中的 SessionStart、PreInvocation、Stop,合理提示可选的 ~/.gemini/config/mcp_config.json 配置,并识别状态文件中的 lastStep 游标而不产生误报。

实际行为

输出回退为 client cursor,提示 no hooks template for cursor 与 ~/.cursor/hooks.json not found,退出码为 1。

版本与系统

OpenViking 0.5.6.dev50 / agent-hook-plugin 0.5.34,Node.js v24.16.0,macOS。

wycocoyu avatar Nov 17 '26 02:11 wycocoyu

Points 1-3 of this report were fixed by #8227 (and #8534); point 4 was not. #8557 covers it: checkActivity() now counts Antigravity's lastStep cursor as a captured turn, so the "no session has ever captured a turn" warning stops firing past three sessions. https://github.com/volcengine/OpenViking/pull/8557

2SinceJuly avatar Nov 27 '26 03:11 2SinceJuly