Commit Graph

825 Commits

Author SHA1 Message Date
Alex Newman 030fb0f6cb Merge remote-tracking branch 'origin/main' into cloud-sync-native
# Conflicts:
#	plugin/scripts/mcp-server.cjs
#	plugin/scripts/server-service.cjs
#	plugin/scripts/transcript-watcher.cjs
#	plugin/scripts/worker-service.cjs
2026-07-12 19:54:44 -07:00
Alex Newman 67ba946f37 chore: bump version to 13.10.4 2026-07-12 16:26:54 -07:00
Alex Newman 31a06e9b13 chore: bump version to 13.10.4 2026-07-12 16:22:13 -07:00
Alex Newman c28f7d5388 chore: bump version to 13.10.4 2026-07-12 16:21:34 -07:00
Alex Newman 0cd98603db chore: bump version to 13.10.4 2026-07-12 16:12:37 -07:00
Alex Newman a1b50d6a27 chore: bump version to 13.10.3 2026-07-12 14:09:40 -07:00
Alex Newman 0a764d22c9 Merge main into core-dev
# Conflicts:
#	plugin/scripts/context-generator.cjs
#	plugin/scripts/mcp-server.cjs
#	plugin/scripts/server-service.cjs
#	plugin/scripts/transcript-watcher.cjs
#	plugin/scripts/worker-service.cjs
#	src/npx-cli/commands/install.ts
#	src/services/infrastructure/HealthMonitor.ts
#	src/services/worker/README.md
2026-07-12 13:34:02 -07:00
Alex Newman d03392f8da build: rebuild plugin bundles with fixed prompt mapper and v40 self-repair
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>
2026-07-12 13:08:00 -07:00
Alex Newman 4c4d1e573f chore: bump version to 13.10.2 2026-07-05 15:46:39 -07:00
Alex Newman 77869056e0 Revert "fix: use canonical project identity"
This reverts commit 107ef946ec.
2026-07-05 15:24:13 -07:00
Alex Newman c275b340c8 fix(worker): graft worker-script resolver identity + IPv6 + worktree gitdir
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>
2026-07-05 15:14:02 -07:00
Alex Newman 2e15df0e8d build: regenerate plugin bundles from integrated source
Reconciles plugin/scripts/*.cjs, plugin/sqlite/* against the cherry-picked
source (worker-host, spawn shims, marketplace repair, sqlite/settings,
sqlite runtime modules, codex Windows hooks, SDK proxy env). Excludes the
observer-truncation and project re-keying regressions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-05 15:09:12 -07:00
Alex Newman 22e4325ce2 fix: harden sqlite migrations and settings writes
(cherry picked from commit b20024b772)
2026-07-05 15:06:27 -07:00
Alex Newman 83dd59256f fix: centralize windows spawn shims
(cherry picked from commit 92997115e5)
2026-07-05 15:06:27 -07:00
Alex Newman 41113d3454 fix: use health oracle and configured worker endpoint
(cherry picked from commit 3695d11601)
2026-07-05 15:06:12 -07:00
Alex Newman c81acee39a fix: probe configured worker host 2026-07-05 11:06:58 -07:00
Alex Newman 7d281423e8 fix: hold chroma writer lock during cleanup 2026-07-05 10:53:26 -07:00
Alex Newman 107ef946ec fix: use canonical project identity 2026-07-05 01:27:13 -07:00
Alex Newman 0166683385 fix: bound observer provider context 2026-07-05 01:13:11 -07:00
Alex Newman b20024b772 fix: harden sqlite migrations and settings writes 2026-07-05 00:56:57 -07:00
Alex Newman 92997115e5 fix: centralize windows spawn shims 2026-07-05 00:21:10 -07:00
Alex Newman 49e5dadfdf fix: guard chroma persistent writer ownership 2026-07-05 00:03:33 -07:00
Alex Newman 3695d11601 fix: use health oracle and configured worker endpoint 2026-07-04 23:48:16 -07:00
Alex Newman 36cb8fcb49 chore: bump version to 13.10.1 2026-07-03 21:52:49 -07:00
Alex Newman 47d14c1747 fix: preserve empty-string additionalContext in Codex hook output
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
2026-07-03 21:44:09 -07:00
Alex Newman 62693445b6 fix: emit valid SessionStart hookSpecificOutput on hook no-op fallback
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 #2947
Closes #2972

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011YMT5iCF1kfikq7fetR6NF
2026-07-03 21:35:15 -07:00
Alex Newman 1993559540 chore: bump version to 13.10.0
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011YMT5iCF1kfikq7fetR6NF
2026-07-03 19:17:02 -07:00
Alex Newman 9cbd3f8203 fix: drop dead SessionEnd hook, wire antigravity-cli into npx-cli
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
2026-07-03 15:57:33 -07:00
Alex Newman ec783e87e4 fix: write Antigravity rules context to home dir, not cwd (Phase C)
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
2026-07-03 15:39:32 -07:00
Alex Newman 173ebb26a9 feat: add full Antigravity CLI support (Phase B)
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
2026-07-03 15:34:05 -07:00
Alex Newman 26fe40a6c1 feat: remove Gemini CLI host integration (Phase A)
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
2026-07-03 14:51:33 -07:00
Alex Newman fd07bfa564 chore: bump version to 13.9.3 2026-07-02 22:22:10 -07:00
Alex Newman 2a0a407340 chore: remove over-engineering findings from repo-wide ponytail audit (wave 1)
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>
2026-07-02 20:49:27 -07:00
Alex Newman 39dd77d9e3 fix: eliminate all 331 error-handling anti-patterns detected by scanner (#3119)
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>
2026-07-02 13:09:09 -07:00
Alex Newman ed97d4e490 chore: bump version to 13.9.2 2026-06-30 21:52:15 -07:00
Alex Newman 29af028403 fix(providers): remove client-side context truncation ("second system")
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>
2026-06-30 20:52:54 -07:00
Alex Newman 482b4f0a15 fix(server): 404 on cross-team/nonexistent project purge
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>
2026-06-29 17:58:38 -07:00
Alex Newman 5bd7da778e chore: build-and-sync after merging ChenglinWei97 server PRs 2026-06-29 17:49:58 -07:00
Alex Newman f1b8fdb28a chore: bump version to 13.9.1 2026-06-29 16:47:29 -07:00
Alex Newman 4af7daf29c test: stabilize session init after server rename 2026-06-29 16:23:14 -07:00
Alex Newman aad0d87c55 Merge remote-tracking branch 'origin/main' into release/recovery-2026-06-24
# Conflicts:
#	plugin/scripts/context-generator.cjs
#	plugin/scripts/mcp-server.cjs
#	plugin/scripts/server-service.cjs
#	plugin/scripts/transcript-watcher.cjs
#	plugin/scripts/worker-service.cjs
#	src/cli/handlers/session-init.ts
#	src/servers/mcp-server.ts
#	src/services/sync/ChromaSync.ts
#	tests/hooks/server-client.test.ts
2026-06-29 16:01:54 -07:00
Alex Newman 8d80ca4b15 fix(codex): load startup context through MCP 2026-06-29 15:57:33 -07:00
Alex Newman 8f65bb0860 chore: bump version to 13.9.0
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>
2026-06-29 15:28:24 -07:00
Alex Newman 348d9ee406 feat(recovery): scope memories by platform source 2026-06-29 15:24:59 -07:00
Alex Newman 108c5c65a1 Merge remote-tracking branch 'origin/main' into mutual-aardvark
# Conflicts:
#	plugin/scripts/context-generator.cjs
#	plugin/scripts/mcp-server.cjs
#	plugin/scripts/server-service.cjs
#	plugin/scripts/transcript-watcher.cjs
#	plugin/scripts/worker-service.cjs
#	plugin/ui/viewer-bundle.js
#	src/server/routes/v1/ServerV1PostgresRoutes.ts
#	src/server/runtime/ServerService.ts
#	src/server/runtime/create-server-service.ts
#	src/server/runtime/types.ts
#	tests/server/server-service.test.ts
2026-06-29 15:10:51 -07:00
Alex Newman ad4bd6f7a6 fix(observer): drop invalid prose and pause on quota 2026-06-29 10:27:11 -07:00
Alex Newman 8702c8f331 fix(chroma): prewarm uvx and harden shutdown 2026-06-29 10:04:51 -07:00
Alex Newman f42bead214 refactor(sdk): trim over-engineering from cmem-sdk client
Ponytail-review cleanups, behavior-preserving:
- dedup provider instantiation into instantiateProvider() (was duplicated
  across config + env resolution paths)
- reuse ChromaSync.getCollectionName() instead of re-deriving the cm__
  collection name (kills drift risk)
- drop redundant ChromaMcpManager.isHealthy() probe; ensureCollectionExists
  already rethrows when the subprocess can't start
- replace repeated optional-field plumbing with assignDefined() helper
- remove no-op try/catch that re-threw verbatim, and the IIFE event-load dance
- drop defensive seen-Set dedup of unique Chroma doc ids

net -42 lines in src/sdk/index.ts. typecheck + build + SDK import guard +
51 unit tests green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-27 21:33:40 -07:00
Alex Newman 4557920565 Merge remote-tracking branch 'origin/main' into mutual-aardvark
# Conflicts:
#	package.json
#	plugin/scripts/context-generator.cjs
#	plugin/scripts/mcp-server.cjs
#	plugin/scripts/server-service.cjs
#	plugin/scripts/worker-service.cjs
#	plugin/ui/viewer-bundle.js
#	src/server/runtime/create-server-service.ts
#	tests/sdk/parse-summary.test.ts
#	tests/sdk/parser.test.ts
2026-06-27 21:20:51 -07:00
Alex Newman c520c8f2c9 fix(deps): surface dependency health preflight 2026-06-25 15:02:25 -07:00