Repository navigation
fix(sessions): restore valid modes when continuing imported history - #3439
Merged
Merged
Conversation
3 tasks done
kev1n77
force-pushed
the
codex/fix-imported-session-mode
branch
from
October 17, 2026 16:47
d28be4c to
df57dd7
Compare
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
Fix
Unknown session mode: primarywhen sending the first message from a followed Codex/Zcode history or retrying a previously created native branch.Standardmode, keepingprimaryonly as the model selector.primaryshape toStandardwhen reading metadata and snapshots, including existing native branches.Related: #3424. Rebased onto
mainafter #3438 merged. This PR contains only the mode fix and its regression coverage.Type and Areas
Type: Bug fix, regression tests, docs.
Areas: Rust session metadata and external-history compatibility; Web UI fork/submission and failed-message retry.
Motivation / Impact
The external-history registration path stored the model selector
primaryas the session mode. Fork creation succeeded, but the subsequent message was rejected by runtime mode admission. The frontend could also replay that stale value over a corrected branch, including from a failed queue entry.New branches use a valid native mode. Existing imported records and branches remain readable without manual data edits, and their queued drafts can be retried after the application is rebuilt and restarted. Historical turns and provenance are retained, and unrelated custom modes or external runtime bindings are not treated as aliases.
Verification
Rebased onto
upstream/mainat7e79a4840, which includes #3438. The compatibility projection runs through the shared metadata overlay used by cold reads, cache hits, and refreshed views. The legacy v1 fixture verifies corrected modes on cold and warm reads, one snapshot read, a shared history body, and unchanged snapshot/index bytes.check:web, including TypeScript checking, passed after regenerating the unchanged upstream MiniApp CSS withnode scripts/generate-miniapp-chat-styles.mjsfor this Windows checkout's line endings. Normalized content was identical; the temporary generated-file change is excluded from the PR.Reviewer Notes
primary.deferred/tracking.rsis resolved by retaining mode normalization inoverlay_view_metadata, preserving perf(sessions): page catalogs and share external history snapshots #3438's cache and paging behavior. Cold and warm legacy-snapshot regression coverage confirms the mode projection without rewriting stored history or the index.Checklist