Support reliable cross-provider session handoff with normalized tool history
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- PR merge metrics
- PR metrics pending
Description
What variant of Codex are you using?
CLI
What feature would you like to see?
Feature request
Codex should support handing off a long-running session from one model provider
to another while preserving its working context.
Example:
- Continue a long GPT session with a custom Responses-compatible provider when
the GPT quota is exhausted. - Later hand the resulting session back to OpenAI models.
- Preserve completed conversation history, decisions, tool results, and project
context without requiring a manual summary.
Current behavior
-
codex resumeacross providers is unreliable because the session retains its
original provider-specific state. -
codex fork -p <provider> -m <model> <session-id>copies the history, but the
destination provider may reject valid historical tool records. -
In my case DeepSeek returned:
No tool output found for tool call call_mj42PDsUwFvbo5vPJM4Kunyd -
The corresponding
custom_tool_call_outputwas present in the rollout file,
but a developer message occurred between the tool call and its output.
OpenAI accepted this history; the custom provider rejected it. -
Provider-specific pickers also make the source session difficult to locate,
requiring its UUID.
Desired behavior
Before a cross-provider resume or fork, Codex should normalize the transcript
into a provider-neutral representation:
- preserve all user and assistant messages;
- preserve completed tool calls and outputs;
- guarantee valid call/output pairing and ordering;
- remove or transform provider-specific protocol items;
- retain the source session as an unchanged rollback point;
- clearly indicate that the destination is a new session derived from the
original session.
Ideally:
codex handoff <session-id> --profile deepseek --model deepseek-v4-pro
Environment
- Codex CLI 0.147.0
- macOS
- Source provider: OpenAI
- Destination: custom Responses-compatible provider
Additional information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the codex resume and codex fork entry points, then inspect the rollout file format that contains the tool call and custom_tool_call_output records. Compare the source history accepted by OpenAI with the ordering rejected by the custom provider. Done means a cross-provider handoff preserves usable messages and completed tools, leaves the source session unchanged, and clearly creates a derived session.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100