chore: bump version to 10.0.6
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
"plugins": [
|
"plugins": [
|
||||||
{
|
{
|
||||||
"name": "claude-mem",
|
"name": "claude-mem",
|
||||||
"version": "10.0.5",
|
"version": "10.0.6",
|
||||||
"source": "./plugin",
|
"source": "./plugin",
|
||||||
"description": "Persistent memory system for Claude Code - context compression across sessions"
|
"description": "Persistent memory system for Claude Code - context compression across sessions"
|
||||||
}
|
}
|
||||||
|
|||||||
+77
-8
@@ -682,6 +682,7 @@ run_openclaw() {
|
|||||||
|
|
||||||
CLAUDE_MEM_REPO="https://github.com/thedotmack/claude-mem.git"
|
CLAUDE_MEM_REPO="https://github.com/thedotmack/claude-mem.git"
|
||||||
CLAUDE_MEM_BRANCH="${CLI_BRANCH:-main}"
|
CLAUDE_MEM_BRANCH="${CLI_BRANCH:-main}"
|
||||||
|
PLUGIN_FRESHLY_INSTALLED=""
|
||||||
|
|
||||||
install_plugin() {
|
install_plugin() {
|
||||||
# Check for git before attempting clone
|
# Check for git before attempting clone
|
||||||
@@ -796,6 +797,30 @@ install_plugin() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
success "claude-mem plugin installed and enabled"
|
success "claude-mem plugin installed and enabled"
|
||||||
|
|
||||||
|
# ── Copy core plugin files (worker, hooks, scripts) to extension directory ──
|
||||||
|
# The OpenClaw extension only contains the gateway hook (dist/index.js).
|
||||||
|
# The actual worker service and Claude Code hooks live in the plugin/ directory
|
||||||
|
# of the main repo. We copy them so find_claude_mem_install_dir() can locate
|
||||||
|
# the worker-service.cjs and the worker runs the updated version.
|
||||||
|
local extension_dir="${HOME}/.openclaw/extensions/claude-mem"
|
||||||
|
local repo_root="${build_dir}/claude-mem"
|
||||||
|
|
||||||
|
if [[ -d "$extension_dir" && -d "${repo_root}/plugin" ]]; then
|
||||||
|
info "Copying core plugin files to ${extension_dir}..."
|
||||||
|
|
||||||
|
# Copy plugin/ directory (worker service, hooks, scripts, skills, UI)
|
||||||
|
cp -R "${repo_root}/plugin" "${extension_dir}/"
|
||||||
|
|
||||||
|
# Copy root package.json (contains the canonical version number)
|
||||||
|
cp "${repo_root}/package.json" "${extension_dir}/package.json"
|
||||||
|
|
||||||
|
success "Core plugin files updated at ${extension_dir}"
|
||||||
|
else
|
||||||
|
warn "Could not copy core plugin files — worker may need manual update"
|
||||||
|
fi
|
||||||
|
|
||||||
|
PLUGIN_FRESHLY_INSTALLED="true"
|
||||||
}
|
}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@@ -1668,21 +1693,65 @@ main() {
|
|||||||
|
|
||||||
local needs_restart=""
|
local needs_restart=""
|
||||||
|
|
||||||
# Check if worker version is outdated compared to installed version
|
# If we just installed fresh plugin files, always restart the worker
|
||||||
|
# to pick up the new version — even if the old worker was healthy.
|
||||||
|
if [[ "$PLUGIN_FRESHLY_INSTALLED" == "true" ]]; then
|
||||||
if [[ -n "$WORKER_VERSION" && -n "$expected_version" && "$WORKER_VERSION" != "$expected_version" ]]; then
|
if [[ -n "$WORKER_VERSION" && -n "$expected_version" && "$WORKER_VERSION" != "$expected_version" ]]; then
|
||||||
warn "Existing worker is v${WORKER_VERSION} but installed v${expected_version} — restart recommended"
|
info "Upgrading worker from v${WORKER_VERSION} to v${expected_version}..."
|
||||||
info " Run: curl -X POST http://127.0.0.1:37777/api/admin/restart"
|
else
|
||||||
|
info "Plugin files updated — restarting worker to load new code..."
|
||||||
|
fi
|
||||||
|
needs_restart="true"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if worker version is outdated compared to installed version
|
||||||
|
if [[ "$needs_restart" != "true" && -n "$WORKER_VERSION" && -n "$expected_version" && "$WORKER_VERSION" != "$expected_version" ]]; then
|
||||||
|
info "Upgrading worker from v${WORKER_VERSION} to v${expected_version}..."
|
||||||
needs_restart="true"
|
needs_restart="true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if AI provider doesn't match current configuration
|
# Check if AI provider doesn't match current configuration
|
||||||
if [[ -n "$WORKER_AI_PROVIDER" && -n "$AI_PROVIDER" && "$WORKER_AI_PROVIDER" != "$AI_PROVIDER" ]]; then
|
if [[ "$needs_restart" != "true" && -n "$WORKER_AI_PROVIDER" && -n "$AI_PROVIDER" && "$WORKER_AI_PROVIDER" != "$AI_PROVIDER" ]]; then
|
||||||
warn "Worker is using ${WORKER_AI_PROVIDER} but you configured ${AI_PROVIDER} — restart to apply changes"
|
warn "Worker is using ${WORKER_AI_PROVIDER} but you configured ${AI_PROVIDER} — restarting to apply"
|
||||||
needs_restart="true"
|
needs_restart="true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If everything is current, show full healthy status
|
# Restart worker if needed: kill old process, start fresh
|
||||||
if [[ "$needs_restart" != "true" ]]; then
|
if [[ "$needs_restart" == "true" ]]; then
|
||||||
|
info "Stopping existing worker..."
|
||||||
|
# Try graceful shutdown via API first, fall back to SIGTERM
|
||||||
|
curl -s -X POST "http://127.0.0.1:37777/api/admin/shutdown" >/dev/null 2>&1 || true
|
||||||
|
sleep 2
|
||||||
|
|
||||||
|
# If still running, send SIGTERM to known PID
|
||||||
|
if check_port_37777; then
|
||||||
|
if [[ -n "$WORKER_REPORTED_PID" ]]; then
|
||||||
|
kill "$WORKER_REPORTED_PID" 2>/dev/null || true
|
||||||
|
sleep 1
|
||||||
|
fi
|
||||||
|
# Check PID file as fallback
|
||||||
|
local pid_file="${HOME}/.claude-mem/worker.pid"
|
||||||
|
if [[ -f "$pid_file" ]]; then
|
||||||
|
local file_pid
|
||||||
|
file_pid="$(INSTALLER_PID_FILE="$pid_file" node -e "
|
||||||
|
try { process.stdout.write(String(JSON.parse(require('fs').readFileSync(process.env.INSTALLER_PID_FILE, 'utf8')).pid || '')); }
|
||||||
|
catch(e) {}
|
||||||
|
" 2>/dev/null)" || true
|
||||||
|
if [[ -n "$file_pid" ]]; then
|
||||||
|
kill "$file_pid" 2>/dev/null || true
|
||||||
|
sleep 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Start fresh worker
|
||||||
|
if start_worker; then
|
||||||
|
verify_health || true
|
||||||
|
else
|
||||||
|
warn "Worker restart failed — you can start it manually later"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# No restart needed — show healthy status
|
||||||
local uptime_display=""
|
local uptime_display=""
|
||||||
if [[ -n "$WORKER_UPTIME" && "$WORKER_UPTIME" =~ ^[0-9]+$ && "$WORKER_UPTIME" != "0" ]]; then
|
if [[ -n "$WORKER_UPTIME" && "$WORKER_UPTIME" =~ ^[0-9]+$ && "$WORKER_UPTIME" != "0" ]]; then
|
||||||
uptime_display="$(format_uptime_ms "$WORKER_UPTIME")"
|
uptime_display="$(format_uptime_ms "$WORKER_UPTIME")"
|
||||||
@@ -1715,7 +1784,7 @@ main() {
|
|||||||
verify_health || true
|
verify_health || true
|
||||||
else
|
else
|
||||||
warn "Worker startup failed — you can start it manually later"
|
warn "Worker startup failed — you can start it manually later"
|
||||||
warn " cd ~/.claude/plugins/marketplaces/thedotmack && bun plugin/scripts/worker-service.cjs"
|
warn " cd ~/.openclaw/extensions/claude-mem && bun plugin/scripts/worker-service.cjs"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "claude-mem",
|
"name": "claude-mem",
|
||||||
"version": "10.0.5",
|
"version": "10.0.6",
|
||||||
"description": "Memory compression system for Claude Code - persist context across sessions",
|
"description": "Memory compression system for Claude Code - persist context across sessions",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"claude",
|
"claude",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "claude-mem",
|
"name": "claude-mem",
|
||||||
"version": "10.0.5",
|
"version": "10.0.6",
|
||||||
"description": "Persistent memory system for Claude Code - seamlessly preserve context across sessions",
|
"description": "Persistent memory system for Claude Code - seamlessly preserve context across sessions",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Alex Newman"
|
"name": "Alex Newman"
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "claude-mem-plugin",
|
"name": "claude-mem-plugin",
|
||||||
"version": "10.0.5",
|
"version": "10.0.6",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Runtime dependencies for claude-mem bundled hooks",
|
"description": "Runtime dependencies for claude-mem bundled hooks",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -500,6 +500,7 @@ export class WorkerService {
|
|||||||
'CLAUDE_CODE_PATH',
|
'CLAUDE_CODE_PATH',
|
||||||
'ENOENT',
|
'ENOENT',
|
||||||
'spawn',
|
'spawn',
|
||||||
|
'Invalid API key',
|
||||||
];
|
];
|
||||||
if (unrecoverablePatterns.some(pattern => errorMessage.includes(pattern))) {
|
if (unrecoverablePatterns.some(pattern => errorMessage.includes(pattern))) {
|
||||||
hadUnrecoverableError = true;
|
hadUnrecoverableError = true;
|
||||||
|
|||||||
@@ -246,6 +246,12 @@ export class SDKAgent {
|
|||||||
throw new Error('Claude session context overflow: prompt is too long');
|
throw new Error('Claude session context overflow: prompt is too long');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Detect invalid API key — SDK returns this as response text, not an error.
|
||||||
|
// Throw so it surfaces in health endpoint and prevents silent failures.
|
||||||
|
if (typeof textContent === 'string' && textContent.includes('Invalid API key')) {
|
||||||
|
throw new Error('Invalid API key: check your API key configuration in ~/.claude-mem/settings.json or ~/.claude-mem/.env');
|
||||||
|
}
|
||||||
|
|
||||||
// Parse and process response using shared ResponseProcessor
|
// Parse and process response using shared ResponseProcessor
|
||||||
await processAgentResponse(
|
await processAgentResponse(
|
||||||
textContent,
|
textContent,
|
||||||
|
|||||||
Reference in New Issue
Block a user