Regenerated from src including 7c8c6ebc7 (joined drain pushes real
memory_session_id/project on prompts) and 5af1b059b (v40 requeue +
backfill lane). Deployed live: v40 re-queued all 20,226 local prompts
and the worker drained them to zero through the backfill lane with no
errors.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Grafted from the two plan branches, minus their regressions:
- worker-utils: cache-first resolveWorkerScriptPath so hook/MCP/CLI/restart
launches converge on one worker bundle (stops cache-vs-marketplace version
skew); + CLAUDE_MEM_WORKER_SCRIPT_PATH override; + formatHostForUrl IPv6
bracketing in buildWorkerUrl.
- HealthMonitor: IPv6-bracket the worker host in health/readiness fetches.
- worktree: resolve a relative gitdir against the .git file's dir before
matching worktrees/, so a relative 'gitdir:' entry is not misread as a
non-worktree.
Excluded: c78b8bf8's stale-socket recovery (dead code — SO_REUSEADDR means
TIME_WAIT never raises EADDRINUSE) and the fd1b5221 submodule re-keying.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
codexAdapter.formatOutput used a truthy check on additionalContext,
silently dropping the key whenever it was an explicit empty string
(HookResult types it as a required string, not optional). The new
SessionStart no-op fallback from buildNoOpResult('context') hit this
exactly, emitting hookSpecificOutput without additionalContext at all.
Switch to a typeof check so the key is preserved whenever the caller
set it, matching the type contract.
Addresses review feedback on #3127.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011YMT5iCF1kfikq7fetR6NF
hook-command.ts fell back to a bare {continue:true, suppressOutput:true}
whenever a hook errored before its handler ran (missing session_id,
invalid cwd, missing transcript path). Codex's strict SessionStart
validator rejects that shape outright ("hook returned invalid session
start JSON output"), since `context` is the SessionStart handler on every
platform. buildNoOpResult() now attaches a minimal valid
hookSpecificOutput for that path so Codex's startup hook no longer fails.
Closes#2947Closes#2972
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011YMT5iCF1kfikq7fetR6NF
Two issues from automated PR review, both verified against the code
before fixing:
- SessionEnd was mapped to 'session-complete', but that internal event
has had no handler since a past release deliberately removed it (the
worker now self-completes via its SDK-agent generator's finally-block,
per CHANGELOG.md:777). The mapping only looked "confirmed live" because
stale pre-cleanup config was still sitting in ~/.gemini/settings.json.
Dropped back to the correct 7-event map; the deleted Gemini CLI compat
test had already asserted this exclusion, which the new test missed.
- `npx claude-mem antigravity-cli install|status|uninstall` was
unreachable (no case in src/npx-cli/index.ts's dispatcher, though
worker-service.cjs's Bun-runtime CLI had it). Not a regression --
gemini-cli never had this either -- but cheap to fix while here.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011YMT5iCF1kfikq7fetR6NF
The hands-on install/hook verification gate caught this live: running
`claude-mem install --ide antigravity` from this repo wrote
.agents/rules/claude-mem-context.md into the repo's working directory
instead of ~/.agents/rules/, the actual location Antigravity CLI reads
project-independent rules from. Carried over unnoticed from the old
MCP-only ANTIGRAVITY_CONFIG, which had the same process.cwd() bug.
Verified end-to-end after the fix: real install run, hooks fire
correctly (context + observation events), MCP tools reachable via both
registered config paths, GEMINI.md and rules-file context injection
both confirmed live on this machine.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011YMT5iCF1kfikq7fetR6NF
Adds hooks, dual MCP server registration, and GEMINI.md/rules context
injection for Antigravity CLI (Gemini CLI's official successor per
Google, May 19 2026), at feature parity with the removed Gemini CLI
integration. Built and verified against a real live Antigravity CLI
install (agy v1.0.16):
- Hooks share Gemini CLI's proven ~/.gemini/settings.json + 8-event map
(SessionStart, BeforeAgent, AfterAgent, BeforeTool, AfterTool,
Notification, PreCompress, SessionEnd), confirmed live on disk.
- MCP registration dual-writes ~/.gemini/antigravity/mcp_config.json
and ~/.gemini/config/mcp_config.json (both real paths observed in use).
- Detection checks for the `agy` binary alongside the existing
~/.gemini/antigravity directory check.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011YMT5iCF1kfikq7fetR6NF
Google deprecated Gemini CLI's free/individual tier in favor of Antigravity
CLI (announced May 19, 2026, cutoff June 18, 2026). Removes claude-mem's
Gemini CLI adapter, installer, IDE-detection entry, and docs.
The separate Gemini LLM/observation provider (CLAUDE_MEM_GEMINI_API_KEY,
GeminiProvider.ts, GeminiObservationProvider.ts) is untouched — that's a
different, still-supported Google product.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011YMT5iCF1kfikq7fetR6NF
Cuts verified dead code, duplication, and speculative abstractions across
14 disjoint areas of the tree: sqlite layer, worker HTTP routes, search
pipeline, server, chroma sync, viewer UI, npx-cli, MCP server, shared/utils,
telemetry/infra, integrations, scripts, tests, and stale plans/evals docs.
Also unifies the Chroma search pipeline onto SearchOrchestrator/strategies
and ports dual-project (merged_into_project) scoping plus dateRange
filtering into ChromaSearchStrategy, which corpus builds need but had
silently lost.
Full audit trail: 65-agent verification workflow wf_160a7862-1a6, 14-agent
execution wf_c7e48c0f-164, 6-agent fixup wf_865f86a4-c6b.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Drive scripts/anti-pattern-test/detect-error-handling-antipatterns.ts to
zero issues across the entire src/ tree (331 -> 0):
- NO_LOGGING_IN_CATCH (124): every silent catch now logs the full error
object via logger/console, or carries an explicit documented override
- PROMISE_EMPTY_CATCH (6): empty .catch(() => {}) handlers in the SDK
cleanup paths now log the swallowed cleanup failure
- GENERIC_CATCH (78): catches discriminate error types via instanceof
Error normalization instead of blind `as Error` casts
- LARGE_TRY_BLOCK (115): oversized try blocks narrowed to the throwing
statements or extracted into named helpers, semantics-preserving
- CATCH_AND_CONTINUE_CRITICAL_PATH (6) + ERROR_STRING_MATCHING (2):
fixed or documented with [ANTI-PATTERN IGNORED] justifications
297 real fixes, 38 documented overrides (each with a specific technical
reason and explicit recovery). No behavior changes: swallowed errors
remain non-throwing, only visible now.
Verified: detector exits 0, tsc --noEmit clean (both tsconfigs),
2292 tests pass / 0 fail. Includes rebuilt plugin artifacts.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
The OpenAICompatibleProvider.truncateHistory() sliding-window dropped
conversation messages based on a hardcoded 20-message cap and a 100k
"safety" token limit — a client-side context manager layered on top of
the provider's own context window. In practice it fired on message count
alone (dropping messages at ~12k tokens, nowhere near the token limit)
and silently corrupted conversation history, mislabeled as "runaway cost"
prevention.
Rip it out entirely. The full history is now sent to the provider, which
owns its own context window.
Removed:
- truncateHistory() + requireNonEmptyToTruncate from OpenAICompatibleProvider
- truncateHistoryForOpenRouter / truncateHistoryForGemini wrappers + constants
- CLAUDE_MEM_{GEMINI,OPENROUTER}_MAX_CONTEXT_MESSAGES / _MAX_TOKENS settings,
their defaults, and SettingsRoutes validation
- truncation-specific tests; docs + openclaw installer references
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ensureProjectAllowed only checks a key's optional project scope, so a
team-scoped key could call DELETE /v1/projects/:projectId/memory with any
projectId and get 200 { purged: true } with zero counts — misreporting an
unauthorized or nonexistent purge as success. Verify the project belongs to
the team (getByIdForTeam) before purging and 404 otherwise. The underlying
purge was already team-scoped, so no cross-team data was ever deleted; this
fixes the misleading success response. Addresses greptile P1 on PR #3089.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Ships the claude-mem/sdk export (cmem-sdk) — in-process
capture→compress→semantic-search with no HTTP worker or Redis — plus the
server-beta→server runtime rename (back-compat aliases retained).
Includes CMEM-SDK reference docs (docs/public/sdk/cmem-sdk.mdx) and a
correction to sdk.mdx's stale parse-error behavior note.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>