Skip to content

Add a Codex CLI provider #22

@Ron537

Description

@Ron537

Summary

Add a new SessionProvider for OpenAI Codex CLI so DPlex can discover and resume Codex sessions out of the box, alongside Copilot CLI and Claude Code.

Background

DPlex's provider system is documented in docs/providers.md. Each provider is one TypeScript class implementing SessionProvider (defined in src/main/services/providers/types.ts). Built-ins live in src/main/services/providers/.

Acceptance criteria

  • New file src/main/services/providers/codexProvider.ts exporting a CodexProvider class that implements SessionProvider.
  • Provider registers in createDefaultRegistry() in src/main/services/providers/index.ts.
  • Discovers sessions from Codex's data directory (verify upstream — likely ~/.codex/sessions or similar).
  • Active-session detection works (probably via lock file or pidfile, like the other providers).
  • getResumeCommand(sessionId) returns the correct codex --resume=<id> shape.
  • At least one unit test covering session discovery + resume command shape.

Files to touch

  • src/main/services/providers/codexProvider.ts (new)
  • src/main/services/providers/index.ts (register)
  • tests/unit/codex-provider.test.ts (new)

How to test

npm run typecheck
npm run test:unit
npm run dev   # confirm Codex sessions appear in the Sessions tab if you have any

Reference

  • See claudeCodeProvider.ts for the closest analog (also pidfile-based active detection).
  • See copilotProvider.ts for the other built-in.

Effort: 1-2 days for someone unfamiliar with the codebase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomershelp wantedExtra attention is neededproviderNew AI-CLI provider integration

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions