Skip to content

[cloud-push] Codex adapter: conversation continuity across push/pull #17

@Zeus-Deus

Description

@Zeus-Deus

Context

PR #15 added bidirectional Claude conversation sync. Codex is the next priority for agent parity (per user, Codex + Pi before Gemini).

Today: pushing a workspace with an active Codex pane → Codex launches on the remote with a fresh conversation. We strip args and run bare `codex` (see `src-tauri/src/terminal/daemon_backed.rs` around line 488).

What needs research first

Before writing code, document the answers to these in a comment on this issue:

  1. Where does Codex store conversation history? (`/.codex/`, `/.config/openai-codex/`, or somewhere else?)
  2. What's the file/path layout? Per-project files like Claude, or a single DB like OpenCode, or something else?
  3. What's the resume command? `codex --resume `, `codex chat resume`, or interactive-only?
  4. How to capture the session id? Hooks like Claude, plugin like OpenCode, output scanning, or file watching?

Look at:

Acceptance criteria

  • Push workspace with a Codex pane → conversation continues on remote
  • Pull back → conversation continues on laptop
  • 3+ push/pull cycles preserve full history

Implementation pattern

Mirror what PR #15 did for Claude (commit `495f62f`):

  1. Helper in `src-tauri/src/commands/hosts.rs` to rsync (or extract+merge if DB-shaped) the per-workspace Codex session data between laptop and remote. Reuse the path-encoding pattern from `crate::ssh::claude_project_dir_name` if Codex's layout is similar
  2. Register a Codex adapter in `src-tauri/src/session_adapters.rs` — currently only `claude-code` exists (see line 115–128)
  3. Session-id capture via whatever Codex provides — emit to `adapter_captures["codex_session_id"]` on the active `TerminalSessionSnapshot`
  4. Remote-relaunch branch in `src-tauri/src/terminal/daemon_backed.rs` (around line 488–573) that builds the correct `codex --resume` invocation

References

Out of scope

Estimate

If Codex is per-cwd file-based (like Claude): ~2 hours.
If Codex is DB-based (like OpenCode): ~half-day.
Research first, estimate after.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions