activeloopai / activeloopai/hivemind

cursor + hermes: pre-tool-use can't read /index.md (only intercepts grep/rg, not cat)

Abierto
#88 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
1.6k
Forks
107
Merge medio
17 h 30 min
PR fusionados (30 d)
6

Descripción

## Severity
Medium — feature parity gap with CC + Codex. After commit 4e956fa the virtual /index.md is bounded to 50 most-recently-updated rows with a clean markdown table — exactly the right entry point for "what's recent" queries. CC and Codex both read it. Cursor and Hermes can't.

## Where
- `src/hooks/cursor/pre-tool-use.ts` — only intercepts `grep`/`rg`/`egrep`/`fgrep` shell commands (per the file's docstring)
- `src/hooks/hermes/pre-tool-use.ts` — only intercepts `terminal` events (similar scope)

Compare with `src/hooks/pre-tool-use.ts:107-117` and `:355-380` (CC) where the Read tool + bash `cat`/`head`/`tail` routes through `readVirtualPathContents` — including the special `/index.md` virtual fallback.

## Repro
Inside a Cursor or Hermes session, ask the agent to read the index:

```
cat /.deeplake/memory/index.md
```

The bash command falls through the agent's pre-tool-use hook (only grep is intercepted), then errors with ENOENT against the real filesystem (the path doesn't exist as a real directory). Both agents' SessionStart prompts say "index.md (start here)" but the agents can't actually do it.

## Proposed fix
Port the index.md / direct-read intercept from CC's pre-tool-use:

1. Recognize `cat` / `head` / `tail` / `wc` / Read-tool calls targeting paths under the memory mount.
2. Resolve the read via `readVirtualPathContents` (already imported in CC's hook; just import it in cursor + hermes).
3. Special-case `/index.md` to fall through to the synthesized virtual index (already handled in `readVirtualPathContents`).

Cursor uses `updated_input: { command: 'echo ' }` for grep; for Read it would use the same pattern with content-as-string.

Hermes uses `{action: "block", message: ""}` per the existing pattern.

## Acceptance
- Cursor session: `cat /.deeplake/memory/index.md` returns the bounded markdown table.
- Hermes session: same.
- Existing grep/rg interception unchanged.

## Out of scope
- Pi extension — in-process architecture, separate code path. Tracked in #85 (OpenClaw parity issue).

Found during embedding_generation branch validation, see commit 4e956fa.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.