Repository navigation
[feat] /Combine - #1
Open
vishaltandale00 wants to merge 10 commits into
Open
vishaltandale00 wants to merge 10 commits into
vishaltandale00 wants to merge 10 commits into
Conversation
Handle descendant merges against logical rollout state, including compaction and rollback semantics. Also widen the merge picker to load resume candidates across providers while excluding the active thread, and add regression coverage for duplicate sources, cycles, ordering, and rollback cases.
Owner
Author
https://github.com//pull/1
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.






Summary
Adds a workspace thread combine feature that creates a new thread from a base thread plus one or more additional threads from the same workspace.
This is not a semantic merge. The implementation preserves each source thread's effective conversation state and appends the selected thread histories in user-chosen order.
Related upstream issue: openai#15133
What this changes
User-facing behavior
/combinein the TUI.Core behavior
codex-rs/core/src/thread_combine.rs.MergeBoundaryitems.merge_base_thread_idmerged_from_thread_idscodex-rs/core/src/thread_workspace.rs.Replay / reconstruction correctness
A naive append of rollout items is wrong because source threads may contain:
To keep combined threads correct on resume/fork/reload, rollout reconstruction now treats
MergeBoundaryas a hard replay segment boundary. That prevents rollback, compaction, and reference-context state from one appended source thread from leaking into another source thread.Why this is useful
Forking is good for branching exploration, but there is no clean path to bring useful branches back together. This fills that gap by letting users recombine multiple workspace threads into one new conversation without manually copying context or discarding the original threads.
Implementation notes
The branch intentionally trimmed scope and dropped a public thread-merge RPC. This keeps the feature TUI-first while landing the core storage/replay/product behavior.
Important pieces:
codex-rs/core/src/thread_combine.rscodex-rs/core/src/codex/rollout_reconstruction.rsMergeBoundarycodex-rs/core/src/rollout/recorder.rscodex-rs/protocol/src/protocol.rsRolloutItem::MergeBoundarycodex-rs/tui/src/app.rs,resume_picker.rs,chatwidget.rsCoverage
The change includes regression coverage for:
Validation
just fmtcargo test -p codex-core