Skip to content

feat: add Codex CLI integration with transcript-based memory capture#1333

Open
0xRouteAI wants to merge 1 commit intothedotmack:mainfrom
0xRouteAI:feature/codex-integration
Open

feat: add Codex CLI integration with transcript-based memory capture#1333
0xRouteAI wants to merge 1 commit intothedotmack:mainfrom
0xRouteAI:feature/codex-integration

Conversation

@0xRouteAI
Copy link

Summary

This PR adds Codex CLI integration to claude-mem, enabling transcript-based memory capture for Codex sessions.

Changes

  • Added transcript command support for Codex CLI
  • Implemented worker service integration for transcript processing
  • Added comprehensive test coverage for CLI routing and worker lifecycle
  • Updated documentation with Codex integration instructions
  • Fixed test instability issues with hermetic test environment

Testing

  • All transcript tests passing
  • Worker lifecycle tests verified
  • CLI routing tests with spy verification

Related

Implements Codex integration as outlined in the implementation plan.

Implements transcript watcher for Codex CLI sessions, enabling persistent
memory across Codex sessions using dual integration model:
- MCP for reading (search tools)
- Transcript watcher for writing (observation capture)

Core Implementation:
- Add transcript command routing to worker CLI (init/validate/watch)
- Automatic watcher lifecycle management in worker service
- Support both turn_aborted and task_complete session end events
- Graceful shutdown with watcher cleanup

Tests (52 passing, 106 assertions):
- codex-schema.test.ts: Validates all 7 Codex event types (30 tests)
- processor-codex-ingestion.test.ts: Real spies verify handler calls (8 tests)
- worker-transcript-cli.test.ts: Verifies worker routing at line 1146 (4 tests)
- worker-managed-watch.test.ts: Hermetic lifecycle tests (10 tests)

Test Improvements:
- All tests use isolated temp directories (hermetic)
- Real spyOn mocks verify actual handler invocations
- Tests verify worker-service.ts routing and lifecycle code paths
- No more smoke tests (expect(true).toBe(true))

Documentation:
- README.md: Setup guide with production/dev commands
- platform-integration.mdx: Comprehensive integration reference
- Event mapping table updated for task_complete support
- Removed misleading "without MCP" language

Build artifacts updated for npm distribution.

Fixes based on code review:
- session_end now matches both turn_aborted and task_complete
- Tests verify real worker routing, not just CLI functions
- Documentation consistent on dual integration model
- All files tracked in git for CI/reviewers
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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.

1 participant