You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(plugin): pass settings under accepted names and run hooks in exec form - #1681
Clears two plugin directory notes and fixes how the plugin reads its settings.
Settings under accepted names.plugin/.mcp.json passed the plugin settings as AGENTMEMORY_URL and AGENTMEMORY_SECRET. The directory accepts only CLAUDE_PLUGIN_OPTION_<KEY> names. It also overrode the user's own AGENTMEMORY_URL with an empty string when the URL setting was left empty, which contradicts the setting's description. The MCP bridge now reads the option names with the same rules as the hooks:
A filled option wins.
An empty URL option falls back to AGENTMEMORY_URL, then http://localhost:3111.
An empty secret option never falls back to an environment secret. A loopback URL still gets the local server's secret.
Unsubstituted ${...} placeholders, from hosts that do not fill user_config, count as empty.
Hooks in exec form. The 12 handlers in plugin/hooks/hooks.json use "command": "node", "args": [...]. Claude Code supports this since 2.1.139. The other hosts' hook files are unchanged. connect claude-code --with-hooks writes the same form and replaces an earlier shell-form install instead of duplicating it. The release gate spawns exec-form handlers directly.
The README now says where the plugin reads a remote server's URL and secret.
Tests: 6 new precedence cases in test/plugin-bridge-secret.test.ts, an exec-form check in test/codex-plugin.test.ts, and an upgrade case in test/claude-code-with-hooks.test.ts. Build, skills:check and docs:check pass. The full vitest suite passes except test/integration.test.ts, which needs a live server. All 12 hooks were spawned in exec form and exit 0. The plugin has not been run inside Claude Code yet.
Summary by CodeRabbit
New Features
Claude Code plugin settings now support configuring the server URL and secret. An empty URL falls back to the environment setting, then to the local server; an empty secret won’t send the environment secret.
Plugin hooks now use a format compatible with Claude Code 2.1.139 and later.
Bug Fixes
Blank or unresolved settings are ignored, preventing placeholder values from being used.
Documentation
Updated setup instructions and release notes to explain plugin settings and hook compatibility.
The pull request updates Claude Code plugin URL and secret configuration, including setting precedence and fallback behavior. It also changes plugin hooks to exec form and updates hook merging, release-gate execution, tests, and documentation to handle separate commands and arguments.
Changes: Plugin settings
Layer / File(s)
Summary
Setting inputs and resolution plugin/.mcp.json, src/hooks/_endpoint.ts, plugin/scripts/*
The plugin configuration uses Claude option environment keys. Hook setting lookup filters blank and unresolved placeholder values. Secret resolution applies the filtered setting while preserving the behavior that an unusable explicit secret suppresses the environment secret.
The MCP bridge and REST proxy use the shared setting and secret resolution. Tests and documentation cover setting precedence, URL fallbacks, and secret behavior.
Claude Code hook entries now specify node as the command and pass each script path as an argument. The hook handler type and manifest tests support argument arrays.
Hook merging and execution src/cli/connect/codex-hooks.ts, scripts/release-gate/run.mjs, test/claude-code-with-hooks.test.ts, CHANGELOG.md
Hook merging substitutes the plugin root in commands and arguments and checks both fields when identifying existing handlers. The release gate executes handlers with arguments. Tests cover substitution and replacement of an existing shell-form hook.
rohitg00/agentmemory#1664: Adds Claude Code URL and secret user configuration and introduces the plugin-option setting names used by this change.
Suggested reviewers:dmazhukov
Merge Risk: Low · up to 1d726
Mergeable with bounded owner awareness: standalone configurations can transmit plugin-option secrets over remote HTTP, and hook installation can remove an unrelated handler that references a plugin script as data. Address these narrow cases or explicitly accept them.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clears two plugin directory notes and fixes how the plugin reads its settings.
Settings under accepted names.
plugin/.mcp.jsonpassed the plugin settings asAGENTMEMORY_URLandAGENTMEMORY_SECRET. The directory accepts onlyCLAUDE_PLUGIN_OPTION_<KEY>names. It also overrode the user's ownAGENTMEMORY_URLwith an empty string when the URL setting was left empty, which contradicts the setting's description. The MCP bridge now reads the option names with the same rules as the hooks:AGENTMEMORY_URL, thenhttp://localhost:3111.${...}placeholders, from hosts that do not filluser_config, count as empty.Hooks in exec form. The 12 handlers in
plugin/hooks/hooks.jsonuse"command": "node", "args": [...]. Claude Code supports this since 2.1.139. The other hosts' hook files are unchanged.connect claude-code --with-hookswrites the same form and replaces an earlier shell-form install instead of duplicating it. The release gate spawns exec-form handlers directly.The README now says where the plugin reads a remote server's URL and secret.
Tests: 6 new precedence cases in
test/plugin-bridge-secret.test.ts, an exec-form check intest/codex-plugin.test.ts, and an upgrade case intest/claude-code-with-hooks.test.ts. Build,skills:checkanddocs:checkpass. The full vitest suite passes excepttest/integration.test.ts, which needs a live server. All 12 hooks were spawned in exec form and exit 0. The plugin has not been run inside Claude Code yet.Summary by CodeRabbit