Repository navigation
fix(session): read Codex reasoning from its summary and content - #1203
Merged
jeff-r2026 merged 1 commit intoOct 18, 2026
Merged
Conversation
|
No findings in the specified diff. The PR description includes sufficient testing: type checking, lint, unit tests, and a representative real-CLI Codex → Claude Code migration showing restored reasoning text. The remaining empty blocks are explained by empty summaries in the source session. Review was read-only; I did not run, build, or install PR code. |
hsuchifeng
approved these changes
Oct 18, 2026
jeff-r2026
approved these changes
Oct 18, 2026
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
The Codex reader takes reasoning text only from
payload.rawContent(src/session-flow/adapters/codex.ts:569). Codex does not write that field. Its protocol type is{ type: "reasoning", summary: Array<{ type: "summary_text", text }>, content?: Array<{ type: "reasoning_text" | "text", text }>, encrypted_content }, and the readable part is insummary. Every Codex reasoning item therefore reads back as an empty thinking block: Claude Code gets"thinking": ""and Cursor gets an empty<thinking>block.This PR reads
rawContentfirst (whatwriteSessionemits, so Codex to Codex round trips do not change), thencontent, thensummary, with summary parts separated by a blank line.Type of Change
Test Plan
npx tsc --noEmitpassesnpm run lintpassesnpx vitest runpasses (10796 pass; the same 6 tests fail onmainhere: twosubmodule-checkoutcases that need git >= 2.54 (local 2.53), onehooks-reconcile-scopereal-shell case, and three Cursor tests that need asqlite3CLI this machine does not have)New test in
session-cmd.test.ts: one reasoning item with twosummary_textparts and one with bothsummaryandcontentmust read back as the joined summary and as the content. Onmainboth read back as"".Real CLI with a throwaway HOME, migrating one of my Codex sessions with
teamai session migrate <id> -s codex -t claude-code -y:Related Issues
Follow-up to #593.
Notes for Reviewers
Reasoning items with only
encrypted_contentand an empty summary still become an empty thinking block, as before.