Skip to content

feat: add codex provider support and optional forwarding workflow (localhost:3000 -> public url for remote debugging)#48

Open
dimkk wants to merge 7 commits intosix-ddc:mainfrom
dimkk:codex-support-v2
Open

feat: add codex provider support and optional forwarding workflow (localhost:3000 -> public url for remote debugging)#48
dimkk wants to merge 7 commits intosix-ddc:mainfrom
dimkk:codex-support-v2

Conversation

@dimkk
Copy link

@dimkk dimkk commented Mar 1, 2026

Summary

This PR adds first-class Codex CLI support to CCBot and improves Telegram delivery reliability for long-running
sessions.

What’s included

  • Added provider abstraction with CCBOT_PROVIDER:
    • claude (existing behavior)
    • codex (new)
  • Added CCBOT_AGENT_COMMAND as the primary command entrypoint for new windows
    (kept CLAUDE_COMMAND as backward-compatible alias)
  • Added Codex session mapping from rollout logs (~/.codex/sessions or CCBOT_CODEX_SESSIONS_PATH)
  • Added support for forwarding unknown slash commands to active session (/status, /permissions, etc.)
  • Added private chat mode support (single stable binding to tmux window ccbot)

Port Forwarding

  • Added startup port forwarding via CLI flag:
    • --forward 3000
    • --forward 3000 --forward 5173
  • Added tunnel provider chain:
    • ngrok -> cloudflared -> localhost.run (ssh)
  • Sends forwarded public links to allowed users and pins that message
  • Properly unpins on shutdown (post_stop)
  • Fixed localhost.run parsing:
    • ignores https://admin.localhost.run
    • supports real public tunnel domains (*.localhost.run, *.lhr.life)
  • Fixed localhost.run startup by removing ssh -N (ensures tunnel URL is actually emitted in non-interactive mode)

Reliability / Delivery

  • Added line-level trace logging from session line -> Telegram message:
    • enqueue/send/edit events
    • trace age + queue wait timing
  • Simplified delivery path by removing Codex catch-up/turbo drop mode:
    • no low-priority message dropping
    • preserves 1:1 message flow semantics
  • Kept queue ordering and status behavior intact

Docs

  • Updated README with:
    • provider switching (claude / codex)
    • --forward usage and lifecycle
    • Codex session resume example (CCBOT_AGENT_COMMAND='codex resume <session-id>')

Notes on compatibility

  • Existing Claude flow remains supported.
  • CLAUDE_COMMAND still works, but CCBOT_AGENT_COMMAND is now preferred.
  • No migration required for existing state files.

Validation

Ran targeted tests for updated areas:

  • tests/ccbot/test_config.py
  • tests/ccbot/test_main.py
  • tests/ccbot/test_port_forward.py
  • tests/ccbot/test_codex_mapper.py
  • tests/ccbot/test_session.py

All passed locally.

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