fix: replace invalid 'decision: allow' with {} in hooks
Closes #872. The top-level decision field only recognizes "block". To not block, return empty JSON {}. "allow" was silently ignored by Claude Code, causing unpredictable behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -68,10 +68,6 @@ if [ -n "$MEMPAL_DIR" ] && [ -d "$MEMPAL_DIR" ]; then
|
|||||||
python3 -m mempalace mine "$MEMPAL_DIR" >> "$STATE_DIR/hook.log" 2>&1
|
python3 -m mempalace mine "$MEMPAL_DIR" >> "$STATE_DIR/hook.log" 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Notify — compaction is about to happen but filing is handled in background
|
# Silent: return empty JSON to not block. "decision": "allow" is invalid —
|
||||||
cat << 'HOOKJSON'
|
# only "block" or {} are recognized.
|
||||||
{
|
echo '{}'
|
||||||
"decision": "allow",
|
|
||||||
"reason": "MemPalace pre-compaction save. Your full conversation has been saved verbatim in the background — no action needed. Compaction can proceed safely."
|
|
||||||
}
|
|
||||||
HOOKJSON
|
|
||||||
|
|||||||
@@ -168,12 +168,9 @@ if [ "$SINCE_LAST" -ge "$SAVE_INTERVAL" ] && [ "$EXCHANGE_COUNT" -gt 0 ]; then
|
|||||||
}
|
}
|
||||||
HOOKJSON
|
HOOKJSON
|
||||||
else
|
else
|
||||||
cat << 'HOOKJSON'
|
# Silent mode: return empty JSON to not block. "decision": "allow" is
|
||||||
{
|
# not a valid value — only "block" or {} are recognized.
|
||||||
"decision": "allow",
|
echo '{}'
|
||||||
"reason": "MemPalace auto-save checkpoint. Your conversation is being saved verbatim in the background — no action needed from you. Continue working."
|
|
||||||
}
|
|
||||||
HOOKJSON
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# Not time yet — let the AI stop normally
|
# Not time yet — let the AI stop normally
|
||||||
|
|||||||
Reference in New Issue
Block a user