agentmemory icon indicating copy to clipboard operation
agentmemory copied to clipboard

fix(codex): declare agentmemory MCP server as stdio

Open jinzheng8115 opened this issue 6 months ago • 2 comments

Summary

  • add type = "stdio" to the Codex MCP block written by agentmemory connect codex
  • add a focused Codex adapter regression test to lock the generated block shape

Why

In my local Codex Desktop setup, the agentmemory server entry was written without an explicit transport type. Other Codex MCP entries in config.toml use type = "stdio", and adding it locally brought the config back into the expected shape for stdio-launched MCP servers.

Validation

  • reproduced that memory_save and memory_lesson_save work when the standalone MCP process is launched directly
  • verified the generated fork diff only changes src/cli/connect/codex.ts and adds a Codex adapter test
  • updated my local ~/.codex/config.toml to include type = "stdio" for mcp_servers.agentmemory as a runtime workaround

I was not able to run the full upstream test suite in this environment because getting a clean local checkout of the full repo stalled repeatedly, so this PR focuses on the minimal config change plus regression coverage.

Summary by CodeRabbit

  • Bug Fixes

    • Fixed Codex adapter configuration for Agentmemory MCP server setup with proper stdio server type specification.
  • Tests

    • Added test suite for Codex adapter, verifying environment detection, configuration installation, and backup creation.

jinzheng8115 avatar Jun 04 '26 11:06 jinzheng8115

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

A member of the Team first needs to authorize it.

vercel[bot] avatar Jun 04 '26 11:06 vercel[bot]

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds type = "stdio" to the Agentmemory Codex MCP server TOML configuration block and introduces a comprehensive test suite for the Codex adapter that validates the configuration change with mock filesystem operations and environment handling.

Changes

Codex adapter stdio configuration

Layer / File(s) Summary
TOML configuration update
src/cli/connect/codex.ts
The MCP server configuration [mcp_servers.agentmemory] block now includes type = "stdio" in the TOML_BLOCK constant.
Codex adapter test suite
test/codex-connect.test.ts
New test suite with mock HOME directory setup verifies detect() returns false when Codex config missing, install() writes correct TOML config with stdio type and npx command, and install() backs up existing config.toml files with a defined backup path.

🎯 2 (Simple) | ⏱️ ~12 minutes

A config whisker here, a test there,
The Codex adapter, oh so fair!
Type stdio declared with care,
Coverage blessed with tests to share. 🐰✨

🚥 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 directly and specifically describes the primary change: adding the type = "stdio" declaration to the agentmemory MCP server configuration in the Codex adapter, which is the core fix addressed in the changeset.
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

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.

coderabbitai[bot] avatar Jun 04 '26 11:06 coderabbitai[bot]