-
Notifications
You must be signed in to change notification settings - Fork 112
fix: .hivemind "collect": false makes Hivemind fully inactive in a tree
#444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,7 @@ import { join, dirname, sep } from "node:path"; | |
| import { fileURLToPath } from "node:url"; | ||
| import { readStdin } from "../utils/stdin.js"; | ||
| import { loadConfig } from "../config.js"; | ||
| import { resolveDirConfig } from "../dir-config.js"; | ||
| import { resolveDirConfig, isHivemindEnabled } from "../dir-config.js"; | ||
| import { armSkillOptOnSkillUse } from "./shared/skillopt-hook.js"; | ||
| import { DeeplakeApi } from "../deeplake-api.js"; | ||
| import { sqlLike } from "../utils/sql.js"; | ||
|
|
@@ -645,6 +645,7 @@ export async function processPreToolUse(input: PreToolUseInput, deps: ClaudePreT | |
| /* c8 ignore start */ | ||
| async function main(): Promise<void> { | ||
| const input = await readStdin<PreToolUseInput>(); | ||
| if (!isHivemindEnabled(input.cwd ?? process.cwd())) return; // .hivemind "collect": false → fully inactive | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🛡️ Detected with Advanced Tier | 🟠 Major | 🏗️ Heavy lift 🧩 Analysis chain🏁 Script executed: rg -n -i 'never be handed|host shell|memory-touching' --glob '!node_modules' . | head -40
git diff ce30de7ca94115cb73fa991538c6d2595ac2622a d8c0f21539c7a0d6bb09f8cee3e7eeba9d46bba9 -- src/hooks/pre-tool-use.ts src/hooks/codex/pre-tool-use.ts src/hooks/hermes/pre-tool-use.ts
sed -n '630,700p' src/hooks/pre-tool-use.tsRepository: activeloopai/hivemind Length of output: 8120 🏁 Script executed: set -eu
printf '%s\n' '--- diff for all four hooks ---'
git diff --unified=18 ce30de7ca94115cb73fa991538c6d2595ac2622a d8c0f21539c7a0d6bb09f8cee3e7eeba9d46bba9 -- \
src/hooks/pre-tool-use.ts \
src/hooks/codex/pre-tool-use.ts \
src/hooks/cursor/pre-tool-use.ts \
src/hooks/hermes/pre-tool-use.ts
printf '%s\n' '--- current cursor hook entry and handler ---'
sed -n '1,125p' src/hooks/cursor/pre-tool-use.ts
printf '%s\n' '--- current Claude memory gate and main ---'
sed -n '90,135p;600,680p' src/hooks/pre-tool-use.ts
printf '%s\n' '--- current Codex/Hermes main slices ---'
sed -n '430,490p' src/hooks/codex/pre-tool-use.ts
sed -n '1,100p' src/hooks/hermes/pre-tool-use.ts
printf '%s\n' '--- base main entry slices ---'
git show ce30de7ca94115cb73fa991538c6d2595ac2622a:src/hooks/pre-tool-use.ts | sed -n '635,675p'
git show ce30de7ca94115cb73fa991538c6d2595ac2622a:src/hooks/codex/pre-tool-use.ts | sed -n '450,485p'
git show ce30de7ca94115cb73fa991538c6d2595ac2622a:src/hooks/cursor/pre-tool-use.ts | sed -n '40,75p'
git show ce30de7ca94115cb73fa991538c6d2595ac2622a:src/hooks/hermes/pre-tool-use.ts | sed -n '32,62p'
printf '%s\n' '--- contract and test references ---'
sed -n '90,110p' library/knowledge/private/architecture/session-lifecycle.md
sed -n '130,170p' tests/claude-code/pre-tool-use.test.ts
sed -n '655,680p' tests/claude-code/pre-tool-use-branches.test.tsRepository: activeloopai/hivemind Length of output: 42091 Security Misconfiguration Reachability: External Reachability pathKeep memory-path interception active when collection is disabled. Run only the memory-path safety decision in disabled directories, then return without collection or other Hivemind side effects. 🤖 Prompt for AI Agents |
||
| // Self-heal the owner record from a SYNCHRONOUS hook. SessionStart records it | ||
| // for new sessions, but a session already open when this shipped only gets a | ||
| // record via the async capture hook — which can be detached and unable to | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '40,120p' src/hooks/cursor/pre-tool-use.ts git diff ce30de7ca94115cb73fa991538c6d2595ac2622a d8c0f21539c7a0d6bb09f8cee3e7eeba9d46bba9 -- src/hooks/cursor/pre-tool-use.tsRepository: activeloopai/hivemind
Length of output: 4645
Use the same workspace directory for enablement and routing.
When
input.cwdis absent, the enablement check can useinput.workspace_roots[0], butloadRoutedConfigstill usesprocess.cwd(). An enabled workspace can therefore pass the check while routing queries the process workspace instead of the workspace root.Suggested fix
🤖 Prompt for AI Agents