Skip to content

fix(mcp): use DELETE for governance memory deletion proxy - #423

Merged
rohitg00 merged 1 commit into
rohitg00:mainfrom
honor2030:fix/mcp-governance-delete-method
May 16, 2026
Merged

rohitg00 merged 1 commit into
rohitg00:mainfrom
honor2030:fix/mcp-governance-delete-method

Conversation

@honor2030

@honor2030 honor2030 commented May 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Fix standalone MCP proxy for memory_governance_delete to call the REST governance endpoint with DELETE instead of POST
  • Add a regression test that verifies method, endpoint, and payload forwarding

Why

src/triggers/api.ts registers /agentmemory/governance/memories as a DELETE endpoint. The standalone MCP proxy was using POST, which returns 405 Method Not Allowed against the live server and then falls back to local KV instead of deleting server memories.

Test Plan

  • RED: AGENTMEMORY_URL=http://127.0.0.1:9 AGENTMEMORY_PROBE_TIMEOUT_MS=50 npx vitest run test/mcp-standalone-proxy.test.ts -t "proxies memory_governance_delete" failed before the implementation with POST /agentmemory/governance/memories -> 405 Method Not Allowed
  • GREEN: AGENTMEMORY_URL=http://127.0.0.1:9 AGENTMEMORY_PROBE_TIMEOUT_MS=50 npx vitest run test/mcp-standalone-proxy.test.ts -t "proxies memory_governance_delete"
  • npm run build
  • AGENTMEMORY_URL=http://127.0.0.1:9 AGENTMEMORY_PROBE_TIMEOUT_MS=50 npx vitest run test/mcp-standalone-proxy.test.ts
  • Broader suite note: AGENTMEMORY_URL=http://127.0.0.1:9 AGENTMEMORY_PROBE_TIMEOUT_MS=50 npm test reached 953/955 or 954/955 passing in repeated runs; the remaining failures were existing timing/flaky tests in test/context-injection.test.ts and test/fs-watcher.test.ts, outside this PR's diff. Rerunning the targeted failing tests individually passed.

Summary by CodeRabbit

  • Bug Fixes

    • Corrected HTTP method used for memory deletion operations to comply with REST standards.
  • Tests

    • Added test coverage for memory deletion endpoint functionality.

Review Change Stack

@vercel

vercel Bot commented May 16, 2026

Copy link
Copy Markdown

@honor2030 is attempting to deploy a commit to the rohitg00's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented May 16, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 17c9c352-6af2-4d1f-a994-38644d3dcad1

📥 Commits

Reviewing files that changed from the base of the PR and between b7e1240 and 7fd14b0.

📒 Files selected for processing (2)
  • src/mcp/standalone.ts
  • test/mcp-standalone-proxy.test.ts

📝 Walkthrough

Walkthrough

The PR corrects the HTTP method used by the memory_governance_delete MCP tool proxy from POST to DELETE when calling the /agentmemory/governance/memories endpoint. A test case validates the corrected behavior, confirming the DELETE request is made with the expected JSON payload.

Changes

DELETE Method Proxy Fix

Layer / File(s) Summary
DELETE method proxy and validation
src/mcp/standalone.ts, test/mcp-standalone-proxy.test.ts
The memory_governance_delete tool proxy was changed to use DELETE instead of POST for the /agentmemory/governance/memories endpoint, with request body and response handling unchanged. A test case verifies the DELETE method is called and the JSON payload (memoryIds and reason) is forwarded correctly.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly Related PRs

  • rohitg00/agentmemory#161: Previously introduced the governance REST proxy endpoint mapping for memory_governance_delete, which this PR corrects by changing the HTTP method from POST to DELETE.

Poem

A rabbit hops through methods old,
From POST to DELETE, brave and bold,
The governance memories find their way,
With tests that brighten up the day! 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: fixing the HTTP method used for the governance memory deletion proxy from POST to DELETE.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@rohitg00
rohitg00 merged commit b48176c into rohitg00:main May 16, 2026
1 of 2 checks passed
@rohitg00

Copy link
Copy Markdown
Owner

Thanks, completely missed it. @honor2030

@honor2030

Copy link
Copy Markdown
Contributor Author

Thanks for the quick review and merge! Easy one to miss since the endpoint/body looked otherwise consistent.

I’ll keep future fixes small and focused like this.

healdigital pushed a commit to healdigital/agentmemory that referenced this pull request Jul 27, 2026
Co-authored-by: 이민재 <19909783+honor2030@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants