Skip to content

feat: support OpenAI Remote session identity - #1891

Open
Rat0323 wants to merge 1 commit into
BigPizzaV3:mainfrom
Rat0323:feat/openai-remote-session-provider
Open

feat: support OpenAI Remote session identity#1891
Rat0323 wants to merge 1 commit into
BigPizzaV3:mainfrom
Rat0323:feat/openai-remote-session-provider

Conversation

@Rat0323

@Rat0323 Rat0323 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a Codex++ setting for choosing the Codex session identity: custom or openai.
  • Keep relay transport, credentials, and Responses configuration in [model_providers.custom] while writing model_provider = "openai" for ChatGPT Remote compatibility.
  • Manage openai_base_url automatically for OpenAI session identity and require the Responses API.
  • Preserve fix: recover official-mix Mobile Remote Control sessions #1789 as the fallback recovery path for profiles that intentionally retain the custom session identity.
  • Skip fix: recover official-mix Mobile Remote Control sessions #1789 recovery for native OpenAI sessions and discard an exact stale pending recovery when its active profile is switched to OpenAI identity.
  • Add regression coverage for configuration fallback, aggregate persistence, protocol validation, pending-recovery migration, and CDP recovery behavior.

Root cause

ChatGPT Remote-created sessions are identified by model_provider = "openai". When Codex++ routes through a custom provider, the active conversation remains usable, but a session created from ChatGPT Remote may not remain visible in the mobile session list. The relay transport and the Remote-facing session identity therefore need to be configured independently.

This change uses openai only as the session identity. The actual relay still uses the existing custom provider table, so Codex++ keeps control of the relay URL, token, protocol, and aggregate routing.

Relationship to #1789

#1789 is not reverted by this PR. It repairs phone-created sessions for existing official-mix profiles that continue to use a non-OpenAI/custom session identity. That is a compatibility fallback, not the preferred path for full ChatGPT Remote behavior.

When an active profile uses OpenAI session identity, the recovery trigger and provider override are disabled. If the same profile still has an exact pending #1789 recovery created before the switch, Codex++ consumes that request without rewriting the rollout or SQLite provider back to custom. Unrelated or inactive-profile pending requests retain #1789's existing deferred behavior.

Compatibility

  • Existing profiles and APIs default to the custom session identity.
  • OpenAI session identity is opt-in and available only with the Responses API; Chat Completions is rejected with a clear validation error.
  • Existing fix: recover official-mix Mobile Remote Control sessions #1789 custom official-mix recovery remains available.
  • No Codex CLI or Codex desktop files are modified.
  • No executable or generated frontend output is included.

Validation

  • npm run check
  • npm test (65 passed)
  • node --check assets/inject/renderer-inject.js
  • cargo test -p codex-plus-data --test provider_sync -- --test-threads=1 (39 passed)
  • cargo test -p codex-plus-core --test relay_config -- --test-threads=1 (123 passed)
  • cargo test -p codex-plus-core --test cdp_bridge -- --test-threads=1 (109 passed)
  • cargo test -p codex-plus-manager --lib -- --test-threads=1 (55 passed)
  • Manual verification: a ChatGPT mobile Remote-created session remains visible in the session list and displays its generated title/content when the OpenAI session identity is selected.

The current machine does not have the MSVC C++ toolchain, so the complete Windows Rust build is verified by GitHub Actions. cargo fmt --all -- --check still reports pre-existing formatting differences in unrelated repository files; this PR does not reformat or include those files. git diff --check passes for the submitted commit.

@Rat0323
Rat0323 marked this pull request as ready for review August 18, 2026 19:30
@Rat0323
Rat0323 force-pushed the feat/openai-remote-session-provider branch from fb77cc2 to 1244d96 Compare August 18, 2026 19:44
@Rat0323
Rat0323 force-pushed the feat/openai-remote-session-provider branch from 1244d96 to 176b8eb Compare August 18, 2026 19:53
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