Does forking a Codex conversation preserve full context?

I’m trying to understand how forking works in Codex Desktop.

I had a Codex conversation with a lot of concrete project details: source files, database paths, import rules, exclusions, and decisions we had already made.

Then I forked the conversation.

In the fork, Codex acted like it barely remembered the original thread. It missed important decisions and even invented placeholder paths that contradicted what we had already discussed.

From my side, it felt like the fork started from a very aggressive hidden summary/compaction, but I didn’t see any warning that context would be reduced.

Is that expected?

When I fork a Codex conversation, does the new thread get the full prior context, or only a compacted/summarized version of it?

If it’s summarized, I think the UI should make that clear, because in coding workflows this can lead to wrong code changes very quickly.

Might be moot given context is always “managed” so even in the primary thread the context is compacted from time to time (and is lossy but that can’t be helped as context is constrained)

Welcome to the forum!

Forking a conversation and having it work as expected is a highly requested capability, as shown by the number of Codex issues that appear when searching for fork:

As you noted, and as @merefield also agreed, compaction appears to be one of the problems that needs to be addressed. In particular, some reports suggest that forking from an earlier point in a conversation may not reliably preserve the original pre-compaction context.

My advice would be to participate in the relevant GitHub issues and add a :+1: reaction to the issue or issues that best match your experience. That helps signal to the Codex developers that this behavior matters to users.

Just wanted to confirm the following behavior:

When Codex forks a thread, the entire previous context is used 1:1 in the new thread.

If the original thread had already been compacted earlier, the fork inherits whatever the persisted rollout now contains, including any prior compaction artifacts. It does not recover pre-compaction detail, and it does not create a new compacted version just because of the fork.

As a thought experiment: you could manage the thread and context yourself because all of the text is still there at the file level. It is just no longer sent to the model after automatic compaction.

Just to clarify one important point: the fork was created before any visible/explicit compaction happened.

At that moment, the original thread still retained the important project details: paths, import rules, prior decisions, exceptions, and the reasoning behind previous implementation choices. The forked thread, however, immediately behaved as if it had already gone through a very lossy compaction — almost like it had been “lobotomized.” It started missing details that were still clearly available in the original thread at the same point in time.

A few messages later, both the original thread and the forked thread did go through compaction. But even after that, the original thread still preserved significantly more useful context than the fork had already lost immediately after being created.

So the issue does not seem to be simply “the source thread had already been compacted, and the fork inherited the compacted state.” From my observation, the fork lost a large amount of context before compaction occurred in either branch, while the original thread continued to behave as if it still had access to those details.

That is why I think this may be a separate issue with how fork context is initialized, not just normal context-window compaction.

You could add a checkpoint routine that dynamically stores critical context prior to compaction, off of keywords or specifically when you fork and then have your agent review that routine at the beginning of a fork to bring context forward

You can inspect the code used to fork threads in the public repo..
It’s true, the fork isn’t just copy-pasting but at the same time it’s not magic either.

Hope this helps!

Thank you, I didn’t know it’s public!

I think the issue is more specific than ordinary context compaction.

The source rollout already contained a compaction checkpoint. When I forked/rolled back to an older point, Codex did not seem to reconstruct a clean raw prefix of the original conversation. Instead, the fork copied the persisted rollout, including the compaction checkpoint, and then applied a rollback marker on top of it.

I investigated this with Codex itself by looking through the Codex source code, and that seems to support this interpretation: fork works from persisted/stored rollout history, and rollback reconstruction can skip user-turn segments while replaying history around compaction checkpoints.

If that rollback crosses the compaction checkpoint, the checkpoint’s replacement history may not be used as the reconstructed base, while the old raw pre-compaction history is also no longer replayed. In that case, the fork can end up with some remaining model-visible items, but those items are not necessarily the actual user conversation context. They may be things like reasoning/tool/compaction/context-related items, while the real user-message context can be lost completely.

That is most likely what happened in my case: the fork looked like it still had some history, but the important user-level project context was gone.

So this seems to be a fork/rollback-across-compaction issue, not just normal context-window compaction.

I see the edge case now. If a compaction checkpoint is created inside a user turn that has not fully completed, and that same user-turn segment is later rolled back, Codex may skip the whole segment during history reconstruction. Because the compaction checkpoint lived inside the skipped segment, its replacement history is not used as the reconstructed base. At the same time, the raw pre-compaction history may no longer be replayed from before that checkpoint. So a later fork can inherit a reconstructed history that still contains some model-visible artifacts, but is missing the important user-message context.

The question is, if this has happened here.
But either way: Thanks for following-up! I learned something.

Sorry for the slow reply. Forking is intended to preserve the conversation, so the missing-context example deserves a closer look. If it still happens, please share the app version and a small reproducible example with Support. We’ll also pass along the request for clearer compaction visibility.