activeloopai / activeloopai/hivemind

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

Offen
#88 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
1.6k
Forks
107
Ø Merge
17 Std. 30 Min.
Gemergte PRs (30 T.)
6

Beschreibung

## 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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.