chore(release): v0.9.29 with project-scope parity across capture surfaces - #1141
chore(release): v0.9.29 with project-scope parity across capture surfaces#1141rohitg00 wants to merge 8 commits into
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe 0.9.29 release updates version and export compatibility, canonicalizes project names across integrations, separates project and cwd payloads, preserves method-specific REST routes, updates endpoint documentation, adds CLI guards, and limits oversized export payloads. ChangesProject Scope and Release
Payload Frame Guards
Estimated code review effort: 3 (Moderate) | ~30 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant MeshExport
participant FrameGuard
participant AgentmemoryStorage
Client->>MeshExport: request export
MeshExport->>AgentmemoryStorage: generate serialized payload
AgentmemoryStorage-->>MeshExport: return export payload
MeshExport->>FrameGuard: check UTF-8 payload size
FrameGuard-->>MeshExport: return payload or oversized error
MeshExport-->>Client: return export or HTTP 413
Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
integrations/pi/index.ts (1)
124-146: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove added behavioral comments from TypeScript files.
Use clear identifiers and test names instead of comments that restate implementation behavior.
integrations/pi/index.ts#L124-L146: remove comments that describe project resolution and the Git fallback.src/replay/jsonl-parser.ts#L29-L31: remove the separator-handling comment.test/project-scope-parity.test.ts#L6-L8: remove the project-scope behavior comment.plugin/opencode/agentmemory-capture.ts#L5-L9: remove the file-tool matching comment.plugin/opencode/agentmemory-capture.ts#L65-L88: remove comments that describe project state and Git fallback.test/opencode-auto-context.test.ts#L90-L92: remove the canonicalization comment.test/opencode-auto-context.test.ts#L114-L114: remove the Git-subdirectory behavior comment.test/opencode-auto-context.test.ts#L125-L129: remove the file-tool behavior comment.As per coding guidelines, “Do not add comments explaining what the code does; use clear naming instead.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@integrations/pi/index.ts` around lines 124 - 146, Remove behavioral comments without changing implementation: in integrations/pi/index.ts, remove comments around resolveProjectName; in src/replay/jsonl-parser.ts lines 29-31, remove the separator-handling comment; in test/project-scope-parity.test.ts lines 6-8, remove the project-scope comment; in plugin/opencode/agentmemory-capture.ts lines 5-9 and 65-88, remove file-tool, project-state, and Git-fallback comments; and in test/opencode-auto-context.test.ts lines 90-92, 114, and 125-129, remove the canonicalization, Git-subdirectory, and file-tool behavior comments. Preserve all code and test behavior.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@integrations/filesystem-watcher/watcher.mjs`:
- Around line 322-324: Update project resolution consistently across
integrations/filesystem-watcher/watcher.mjs:322-324,
src/replay/jsonl-parser.ts:27-32, and test/project-scope-parity.test.ts:21-60:
trim AGENTMEMORY_PROJECT_NAME (then deprecated AGENTMEMORY_PROJECT), resolve the
Git toplevel basename before falling back to the watched-root or cwd basename,
and apply the same override/Git-root order during replay when the recorded cwd
is accessible while retaining basename fallback for unavailable or
cross-platform paths. Add parity tests covering replay override, replay Git-root
resolution, and watcher Git-root resolution.
In `@plugin/skills/agentmemory-rest-api/REFERENCE.md`:
- Line 8: Regenerate plugin/skills/agentmemory-rest-api/REFERENCE.md using npm
run skills:gen after verifying the generator discovers all registered routes,
including the routes exposed through src/index.ts and src/triggers/api.ts.
Replace the incomplete 119-endpoint header and table with the complete generated
130-route block, preserving the generator’s output format.
---
Nitpick comments:
In `@integrations/pi/index.ts`:
- Around line 124-146: Remove behavioral comments without changing
implementation: in integrations/pi/index.ts, remove comments around
resolveProjectName; in src/replay/jsonl-parser.ts lines 29-31, remove the
separator-handling comment; in test/project-scope-parity.test.ts lines 6-8,
remove the project-scope comment; in plugin/opencode/agentmemory-capture.ts
lines 5-9 and 65-88, remove file-tool, project-state, and Git-fallback comments;
and in test/opencode-auto-context.test.ts lines 90-92, 114, and 125-129, remove
the canonicalization, Git-subdirectory, and file-tool behavior comments.
Preserve all code and test behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: c0c6d7fc-acc2-4be1-bb79-b657fb451086
📒 Files selected for processing (20)
AGENTS.mdCHANGELOG.mdREADME.mdintegrations/filesystem-watcher/watcher.mjsintegrations/hermes/__init__.pyintegrations/pi/index.tspackage.jsonplugin/.claude-plugin/plugin.jsonplugin/.codex-plugin/plugin.jsonplugin/opencode/agentmemory-capture.tsplugin/plugin.jsonplugin/skills/agentmemory-rest-api/REFERENCE.mdsrc/functions/export-import.tssrc/index.tssrc/replay/jsonl-parser.tssrc/types.tssrc/version.tstest/export-import.test.tstest/opencode-auto-context.test.tstest/project-scope-parity.test.ts
- 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
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/replay/jsonl-parser.ts (1)
29-59: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove explanatory implementation comments.
Lines 29, 37-41, and 55-56 explain implementation behavior. Remove these comments or retain only comments that document non-obvious constraints not represented by the code.
As per coding guidelines,
src/**/*.{ts,tsx}must “avoid comments that explain what code does.”🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/replay/jsonl-parser.ts` around lines 29 - 59, Remove the explanatory comments in and around deriveProject, including the projectByCwd memoization note, git-resolution explanation, and path-splitting explanation. Keep the implementation unchanged and retain only comments documenting genuinely non-obvious constraints, if necessary.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@integrations/filesystem-watcher/watcher.mjs`:
- Around line 142-144: Update the project resolution in the watcher
initialization and flush flow: preserve config.project as an explicit override,
but when it is absent derive and store a project for each resolved root instead
of assigning only the first root’s project to this.project. In flush, select the
project associated with the emitted event’s rootDir, and add coverage using two
repositories to verify each event is scoped to its own project.
In `@src/replay/jsonl-parser.ts`:
- Around line 32-42: Validate the parsed JSON entry’s cwd before assigning it,
accepting only non-empty string values and otherwise leaving it unset or
defaulted. Update the entry-copying logic feeding deriveProject so invalid
truthy values such as objects never reach existsSync(cwd), while preserving
valid string handling and fallback behavior.
---
Nitpick comments:
In `@src/replay/jsonl-parser.ts`:
- Around line 29-59: Remove the explanatory comments in and around
deriveProject, including the projectByCwd memoization note, git-resolution
explanation, and path-splitting explanation. Keep the implementation unchanged
and retain only comments documenting genuinely non-obvious constraints, if
necessary.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 885e469c-20e2-43e4-a210-a4b476dc4367
⛔ Files ignored due to path filters (2)
assets/tags/light/stat-tests.svgis excluded by!**/*.svgassets/tags/stat-tests.svgis excluded by!**/*.svg
📒 Files selected for processing (5)
integrations/filesystem-watcher/watcher.mjsplugin/skills/agentmemory-rest-api/REFERENCE.mdscripts/skills/generate.tssrc/replay/jsonl-parser.tstest/project-scope-parity.test.ts
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.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/cli-second-instance-guard.test.ts (1)
13-28: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftCover the CLI guards at runtime, not just as text.
These Vitest assertions can pass while the dispatch or daemon guard is broken. Extract the
handler/maindecisions or invoke the CLI with mockedfetch,startEngine, andprocess.exit, then assert that an unknown positional command runsunknownCommand, a successful livez probe exits before startup, and a failed/disconnected probe continues startup.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/cli-second-instance-guard.test.ts` around lines 13 - 28, The tests in “test/cli-second-instance-guard.test.ts” only inspect source text instead of validating runtime behavior. Replace or supplement the string assertions around the CLI handler and “main” flow with executable tests using mocked “fetch”, “startEngine”, and “process.exit”; verify unknown positional commands invoke “unknownCommand”, a successful “/agentmemory/livez” probe exits before startup, and a failed or disconnected probe still starts the engine.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@test/cli-second-instance-guard.test.ts`:
- Around line 13-28: The tests in “test/cli-second-instance-guard.test.ts” only
inspect source text instead of validating runtime behavior. Replace or
supplement the string assertions around the CLI handler and “main” flow with
executable tests using mocked “fetch”, “startEngine”, and “process.exit”; verify
unknown positional commands invoke “unknownCommand”, a successful
“/agentmemory/livez” probe exits before startup, and a failed or disconnected
probe still starts the engine.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: b0c4b5b1-53df-47a1-8fa7-71a66fa4b768
📒 Files selected for processing (5)
integrations/filesystem-watcher/watcher.mjssrc/cli.tssrc/replay/jsonl-parser.tstest/cli-second-instance-guard.test.tstest/project-scope-parity.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- src/replay/jsonl-parser.ts
- test/project-scope-parity.test.ts
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.
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.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/triggers/api.ts`:
- Around line 2793-2802: Update the export handler surrounding the oversized
payload check so the `memories` collection is filtered by the requested
`project`, matching the existing project filtering applied to `actions`, before
invoking `checkPayloadFrameSize`. Preserve unfiltered memories when no project
is provided, and add a regression test verifying that a project-scoped export
excludes memories from other projects and avoids the documented 413 scenario.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: c1f24973-05ae-433e-88eb-73e0a200b7a6
📒 Files selected for processing (5)
CHANGELOG.mdsrc/functions/export-import.tssrc/state/frame-guard.tssrc/triggers/api.tstest/frame-guard.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- CHANGELOG.md
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.
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.
Release PR for v0.9.29. Three things in one reviewable unit: the release mechanics, a fix for the count drift currently failing consistency on main, and the project-scope parity work we scoped after closing #1122.
Release mechanics
supportedVersionsand theExportDataversion union accept 0.9.29Project-scope parity (closes #903, closes #1135)
Every capture surface now resolves
projectthe way the hooks'resolveProjectdoes:AGENTMEMORY_PROJECT_NAMEoverride, then git toplevel basename, then cwd basename. Previously the same repository fragmented into different memory buckets per agent:projectandcwd; now project is the canonical basename, cwd keeps the full path, and the resolution is done once at plugin init (no per-message git spawns)cwdpath as both fields (Hermes Agent Python plugin sends raw cwd path as project, not git basename (PR #687 gap) #1135)process.cwd()/-segment, which turned a Windows-recorded cwd into the entire raw path; it now splits on both separatorsAGENTMEMORY_PROJECTenv name; it now prefersAGENTMEMORY_PROJECT_NAMEand keeps the old name as a deprecated aliasAlso fixed while in there: OpenCode file enrichment matched capitalized tool names (
Read,Write) that OpenCode never sends, so it was silently dead; the set is lowercase now and matching is case-insensitive.Tests
The #1125 fallback expectations are updated to basenames per the canonicalization, git-toplevel resolution is covered with a throwaway fixture repo (the #1138 pattern), and a new
project-scope-paritysuite covers replay's Windows paths and the watcher's env alias. Full suite 7235 passing, consistency 62, skills lint green. Hermes is Python and has no harness in this repo; the change is minimal and syntax-checked.After merge:
gh release create v0.9.29publishes agentmemory, mcp, and fs-watcher via publish.yml.Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests