Commit Graph
5 Commits
Author SHA1 Message Date
Deshraj YadavandClaude Fable 5 10b8fc4bed fix(mem0-agent): read the key from the plugin config, add cross-surface verification
The desktop app never sources a shell rc, so a key that exists only as MEM0_API_KEY
in .zshrc is invisible there and the plugin silently no-ops. Claude Code injects the
userConfig value as CLAUDE_PLUGIN_OPTION_API_KEY (v1 read it, v2 did not).

- resolve_api_key() -> (key, source): env, plugin config, legacy plugin config, keychain
- health now reports WHERE the key came from, which is how you tell the two apart
- every logged event records the editor, and a new 'sessions' command lists which
  surfaces have actually built packs and written memories

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-29 20:17:17 -07:00
Deshraj YadavandClaude Fable 5 dda5f21332 fix(mem0-agent): bundle a launcher so hooks never depend on a global CLI
SessionStart failed with 'pyenv: mem0-agent: command not found' in any repo whose
.python-version selects a Python the console script was not installed into. A
pip entry point is the wrong dependency for a plugin.

- bin/mem0-agent: POSIX launcher that picks the first CPython >= 3.10 it can find
  and runs the package from source (there are no third-party dependencies)
- hooks now invoke ${CLAUDE_PLUGIN_ROOT}/bin/mem0-agent, matching how the v1
  plugin calls its own scripts; the generator enforces this
- app_id override renamed to MEM0_AGENT_APP_ID: v1 exports MEM0_PROJECT_ID, which
  was silently overriding this plugin's project scope while both are installed

Verified: all six hooks exit 0 from a pyenv-3.11 repo, and app_id resolves per
repository again.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-29 16:20:28 -07:00
Deshraj YadavandClaude Fable 5 a07756f6d7 fix(mem0-agent): accept --session-id after the subcommand
The generated manifest writes 'mem0-agent context --session-id $CLAUDE_SESSION_ID',
but the flag was only on the top-level parser, so argparse rejected it and every
SessionStart hook exited 2 -- the plugin would install and silently do nothing.

Both orders now work, and a new test runs every command line in the manifest
through the parser so a manifest/CLI mismatch fails the build.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-29 02:02:29 -07:00
Deshraj YadavandClaude Fable 5 e11d2a4a06 fix(mem0-agent): emit the Claude Code manifest at hooks/hooks.json
Claude Code auto-discovers a plugin's hooks at <plugin>/hooks/hooks.json. The
generator was writing to hooks/generated/, so the manifest existed but was never
loaded and no hook would have fired on install.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-29 01:49:27 -07:00
Deshraj YadavandClaude Fable 5 3ea00cf88c feat(mem0-agent): read path, hooks, maintenance, CLI and skills
- pack.py: single-call context pack, budgeted, sanitized, cached, with
  served-id tracking that turns a citation into POSITIVE feedback
- assist.py: error-signature lookup (never raw stdout, which returned 0 results in v1)
- maintain.py: transactional consolidation (add merged -> verify -> delete sources)
- transcript.py: JSONL parsing into non-overlapping windows via a cursor
- cli.py: the twelve commands the hooks invoke; detached assist queues a block
  that the next prompt hook drains, keeping the hot path network-free
- hooks generated from one spec; plugin manifest, MCP wiring, five skills

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-28 01:56:38 -07:00