Files
rohitg00__agentmemory/CONTRIBUTING.md
Rohit Ghumare 9c82d2aa7d chore(release): v0.9.29 with project-scope parity across capture surfaces (#1141)
* chore(release): v0.9.29 with project-scope parity across surfaces

Version trio + plugin manifests + supportedVersions + ExportData union
bumped to 0.9.29; CHANGELOG entry covering everything since v0.9.28 with
upgrade notes for the four visible behavior changes.

Fixes the endpoint-count drift on main (130 registered routes vs docs
saying 129 after #1132 landed in parallel with #1136).

Project-scope parity: OpenCode plugin, Hermes plugin, Pi extension, and
JSONL replay now resolve project the same way the hooks do (env
override, git toplevel basename, cwd basename) instead of sending raw
filesystem paths, closing #903 and #1135 and pre-empting the same bug
in pi. The filesystem watcher accepts AGENTMEMORY_PROJECT_NAME with the
old AGENTMEMORY_PROJECT kept as a deprecated alias, replay handles
Windows-recorded paths, and OpenCode file enrichment matches the
agent's lowercase tool names (the capitalized set never matched).

Tests: opencode fallback expectations updated to basenames per the
canonicalization, git-toplevel resolution covered with a fixture repo,
new project-scope-parity suite for replay and fs-watcher.

* fix(release): review findings, git-toplevel parity, doc counts

- skills generator dedupes routes on method plus path, so the REST
  reference lists all 130 registered routes instead of hiding the second
  method on ten dual-method paths (header said 119)
- fs-watcher trims AGENTMEMORY_PROJECT_NAME and the deprecated alias,
  treating whitespace as unset, and derives the git toplevel basename
  when watching a subdirectory
- replay resolves the git toplevel basename when the recorded cwd still
  exists locally (memoized per cwd), keeping the basename fallback for
  historical or cross-platform paths; no env override here since a bulk
  import spans many projects
- parity tests for replay git-root resolution, watcher git-root and
  trim behavior
- stat-tests badge updated from 1428+ to 1550+ passing

* fix(cli): refuse second-instance boot over a live daemon

Closes the class behind issue 1140: agentmemory consolidate (or any
unrecognized word) fell through the command table into the full server
boot, registering a duplicate worker on the running engine; on iii
0.11.2 the second instance's shutdown tears down the daemon's HTTP
trigger routing until a full engine restart. Unknown subcommands now
error with the supported list, and main() probes livez on the resolved
port and refuses to boot over a live daemon, so multi-instance setups
on other ports are unaffected. Verified behaviorally against the built
CLI: both paths refuse with exit 1.

Also from review: the watcher stamps each event with its own root's
project via a per-root map (an explicit config.project still overrides
for every root), and replay only accepts a non-empty string cwd from
parsed JSONL so malformed entries cannot reach the filesystem probe.

* test(watcher): two-repository flush events scope to their own project

* chore(release): bump packages/mcp, guard it, refresh CONTRIBUTING

packages/mcp was still 0.9.28 after the release bump because nothing
guarded it; a consistency test now pins it to package.json. CONTRIBUTING
release list corrected to the files a bump actually touches (no tracked
lockfile, the two extra plugin manifests, the export test derives from
VERSION now), and the subsystems table gains src/cli, integrations/pi,
and the generated-manifest note.

* fix(export): refuse over-frame export instead of dropping the worker

Closes the availability bug in issue 1142: GET /agentmemory/export
assembles the full store and returns it through sdk.trigger, so a store
whose serialized export passes the engine's 16 MiB WebSocket frame
(tungstenite max_frame_size, not raisable under the 0.11.2 pin) dies on
the worker->engine hop, drops the worker, and 404s every endpoint for
~1s. The session collections page on maxSessions/offset but ~18 others
do not, so a large store hits this at any parameter combination.

A shared frame-guard measures the serialized size before returning:
mem::export returns a small oversized error instead of the giant
object, and api::mesh-export returns 413 (same dead-end as #890). Either
way the over-frame payload never crosses the boundary, so the daemon
stays up and the failure is one clean request with a hint to narrow the
range. Full pagination of the non-session collections is a follow-up.

Layer 1 of the fix; verified with a synthetic oversized export returning
the error object (tiny) rather than the payload.

* ci: collapse to a single npm install to fix Node 24/26 CI

The two-step install (npm install --package-lock-only then npm ci) failed
only on the Node 24/26 matrix rows: their stricter npm rejects rolldown's
optional platform bindings (@rolldown/binding-android-arm64) that a
--package-lock-only pass does not fully enumerate. Lockfiles are gitignored,
so npm ci re-validation buys no reproducibility here. A single lenient
npm install resolves and installs in one pass.

* fix(mesh): scope exported memories by project like actions

api::mesh-export filtered actions by ?project but returned every project's
memories. On a mesh instance federating one project to a peer, the peer
pulled other projects' memories (cross-project leak), and those extras could
push the payload past the 16 MiB transport frame into a 413 even when the
requested project's own slice fit. Memories carry the same optional project
field as actions, so filter both before the frame-size guard runs.

Adds a regression test asserting a project-scoped export excludes other
projects' memories and that an oversized memory in another project no longer
413s the scoped request.

* chore(release): credit the Antigravity native hooks adapter in 0.9.29 notes

* chore(release): sweep stale 0.9.28 refs for 0.9.29

Deploy Dockerfiles/compose/render pins, AGENTS.md stats header, opencode
plugin manifest, website meta snapshot, test-count claims (1,428 -> 1,596)
in README/AGENTS/stat SVGs, and the missing 0.9.29 CHANGELOG compare link.

* chore(release): sync stat-tests badge to 1596+ and commit bridge exec bit

* refactor: trim frame-guard comments and drop issue refs from code
2026-08-09 13:22:25 +01:00

5.9 KiB

Contributing to agentmemory

Thanks for taking an interest. This file is the short path from "I have an idea" to "it's in main."

Ground rules

  • Apache-2.0 license applies to every contribution.
  • Sign-off is required on every commit (see DCO below).
  • Be civil. CODE_OF_CONDUCT.md applies.
  • No attribution headers ("Generated with Claude Code", "Co-Authored-By: Claude", etc.) in commits or PR descriptions.

Before you open an issue

Search existing issues first:

If it's a bug: provide the repro steps, your Node version, OS, agentmemory version (npm view @agentmemory/agentmemory version), and what you expected vs. what you saw.

If it's a feature: describe the user problem before the implementation. "I couldn't X because Y" beats "please add X."

Before you open a PR

  1. Fork the repo and create a branch off main:
    • feat/<short-name> for features
    • fix/<issue-number>-<short-name> for bug fixes
    • docs/<topic>, refactor/<topic>, chore/<topic> for the rest
  2. npm install — you need Node >=20.
  3. npm run build — TypeScript must compile clean.
  4. npm test — the full test suite must pass. The one integration test under test/integration.test.ts needs a live server on :3111 and is fine to skip locally.
  5. Commit with sign-off. Rebase over tiny fixup commits so the history stays readable.

Pull request flow

  • Keep PRs small and focused. One logical change per PR.
  • Write a clear description: what it does, why, and how to verify.
  • Link the issue the PR resolves (Fixes #NNN / Closes #NNN).
  • Expect CodeRabbit to review automatically. Address its comments before asking a human.
  • Address review feedback in new commits (do not force-push to the same branch). Maintainers may squash on merge.
  • A maintainer will merge when tests pass, CodeRabbit is green, and any review comments are addressed.

Developer Certificate of Origin

Every commit must carry a Signed-off-by trailer stating you have the right to submit the contribution under Apache-2.0. The full text of the DCO is at https://developercertificate.org.

Add it automatically:

git commit -s -m "feat: your message"

PRs with commits lacking sign-off will not merge.

Coding style

  • TypeScript strict mode. No any unless justified in a comment.
  • Prettier-compatible formatting (editor on save is fine; no repo-wide hook).
  • No code comments that restate what the code does. Only write a comment when the why is non-obvious — a hidden constraint, an invariant, a workaround for a specific bug.
  • No dead code, no commented-out imports.
  • Tests live next to the feature in test/<feature>.test.ts. Name the test after the behavior, not the implementation.

Subsystems at a glance

Directory What lives here
src/triggers/api.ts Every HTTP endpoint under /agentmemory/*. Adding an MCP tool? Add the REST twin here too.
src/mcp/ Standalone MCP server (@agentmemory/mcp), tools registry, transport, in-memory KV.
src/functions/ Core memory operations — observe, compress, consolidate, retention, forget, graph, smart-search, export-import, governance.
src/hooks/ The 12 auto-hooks that capture sessions in agents.
src/cli/ The agentmemory CLI, including connect/ adapters for 18 agents and the guideline writer for hook-less agents.
src/health/ Liveness + readiness + alert thresholds.
src/state/ KV schema, keyed mutex, access log.
integrations/ First-party plugins: hermes/, openclaw/, pi/, filesystem-watcher/.
plugin/ Agent plugin bundle: Claude Code plugin, hook manifests for Codex/Copilot/Droid, the OpenCode capture plugin, and the skills. Hook manifests and skill REFERENCE files are partly generated; run npm run skills:gen after touching registered endpoints or env vars.
website/ Marketing site (Next.js 16).
test/ Vitest test suite.

Adding an MCP tool

  1. Register the function in src/functions/<area>.ts.
  2. Register the HTTP trigger in src/triggers/api.ts with a matching api_path.
  3. Add the tool entry in src/mcp/tools-registry.ts.
  4. Implement in src/mcp/standalone.ts if the standalone MCP package should also expose it.
  5. Write a test under test/.
  6. No CHANGELOG touch in the PR itself — release PRs are the only place CHANGELOG changes.

Adding an auto-hook

  1. Add the new HookType string to the union in src/types.ts.
  2. Wire the handler in src/hooks/<hook-name>.ts.
  3. Add a Vitest case that fires the hook and asserts the observation gets written.

Release process

Maintainers cut releases. Every bump touches these files in lockstep (the consistency tests fail if the trio of doc counts or any version drifts):

  1. package.json
  2. src/version.ts
  3. plugin/.claude-plugin/plugin.json
  4. plugin/plugin.json
  5. plugin/.codex-plugin/plugin.json
  6. packages/mcp/package.json
  7. src/types.ts (ExportData.version union)
  8. src/functions/export-import.ts (supportedVersions Set)

No lockfiles are committed. test/export-import.test.ts asserts against the VERSION constant, so it needs no per-release edit. Run npm run skills:gen if the endpoint or env surface changed.

Then: CHANGELOG section, PR, merge, tag, GitHub release. The Publish to npm workflow picks up the release trigger and publishes @agentmemory/agentmemory, @agentmemory/mcp, and @agentmemory/fs-watcher to npm with provenance (@agentmemory/fs-watcher versions independently from integrations/filesystem-watcher/package.json).

Security issues

Do not open a public issue for a security report. See SECURITY.md.

Questions

  • Implementation questions: open a GitHub Discussion.
  • Governance questions: open an issue labeled governance. See GOVERNANCE.md.