Skip to content

Fix native chat history across transcript formats - #13393

Merged
brennanb2025 merged 2 commits into
mainfrom
brennanb2025/fix-codex-chat-history
Aug 10, 2026
Merged

brennanb2025 merged 2 commits into
mainfrom
brennanb2025/fix-codex-chat-history

Conversation

@brennanb2025

Copy link
Copy Markdown
Contributor

Summary

  • restore messages from early unwrapped response rollouts
  • decode canonical completed turn items used by paginated history
  • preserve legacy event history without duplicates or model-only prompt exposure
  • decode durable freeform tool calls and outputs

Compatibility

Covers all three persisted transcript eras: unwrapped response records, wrapped legacy events, and canonical paginated turn items. The full desktop reader and mobile tail reader share the same decoder. Existing message roles and block shapes are reused, so this does not change the remote wire contract.

Validation

  • pnpm exec vitest run --config config/vitest.config.ts src/main/native-chat (161/161)
  • pnpm run typecheck:node
  • focused oxlint
  • pnpm run check:max-lines-ratchet
  • git diff --check

@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 53707fde-c5d2-442a-add0-ad4536d9bd50

📥 Commits

Reviewing files that changed from the base of the PR and between e8f87cc and 95cf418.

📒 Files selected for processing (2)
  • src/main/native-chat/transcript-line-decoders-codex.ts
  • src/main/native-chat/transcript-reader-codex-history-mode.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/native-chat/transcript-line-decoders-codex.ts

📝 Walkthrough

Walkthrough

Codex transcript decoding now supports unwrapped records and completed turn items. It converts supported user and assistant content into native text and image blocks. It recognizes custom tool calls and custom tool-call outputs. History-mode tests cover paginated and legacy histories, response-copy deduplication, transcript tails, image content, and freeform tools.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the change and validation, but it omits the required Screenshots, AI Review Report, Security Audit, and Notes sections. Add all required template sections, state whether there is visual change, document AI cross-platform review, provide a security audit, and include relevant notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: restoring native chat history across supported transcript formats.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8b37f5f5-81b6-45c2-8a10-81dfbac40c1f

📥 Commits

Reviewing files that changed from the base of the PR and between 5df2ddb and e8f87cc.

📒 Files selected for processing (2)
  • src/main/native-chat/transcript-line-decoders-codex.ts
  • src/main/native-chat/transcript-reader-codex-history-mode.test.ts

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Electron UI QA — native Codex chat history restore

Commit under test: 95cf418de62c6f62499b7da60446816643c8d3de
Method: agent-browser CDP (Electron skill only; no Computer Use / OS automation)
App identity: OrcaDev/1.4.177-rc.0 · Electron/43.1.0 · title Orca · isolated temp userData · CDP port unique
Worktree: this PR branch at the commit above

User actions exercised

  1. Launched this worktree with isolated temporary user data + unique CDP port.
  2. Seeded disposable Codex JSONL fixtures for all three transcript eras (sanitized marker strings only).
  3. Added a disposable git seed project, opened a terminal pane, enabled Experimental Native Chat.
  4. Bound each session via live agent status + providerSession.transcriptPath, then switched the tab to chat view in the real UI.
  5. Verified visible message text inside [data-native-chat-root="true"] and absence of model-only developer/system copies.
  6. Inspected app log + renderer identity; captured full-window screenshots outside the repo.

Results

History mode Visible user/agent messages restored Model-only developer/system/user-response copies in chat body
Paginated completed turn items (minimum required) PASS — 2 user + 2 assistant markers shown PASS — absent from chat body
Early unwrapped response records PASS — early prompt/response shown PASS — system text absent
Legacy wrapped event history PASS — legacy prompt/response shown PASS — developer copy absent

API cross-check (window.api.nativeChat.readSession('codex', …) positional): same message sets as the UI for all three fixtures.

Residual note (non-blocking for this PR’s chat-body fix)

  • Tab chrome aiVaultTitle for the paginated session briefly labeled the tab MODEL_ONLY_USER_COPY_QA13393… (title path can still prefer a model-only response_item user copy). Chat body itself did not show that text. Worth a follow-up if title generation should share the history-mode filter.

Log check

  • No renderer/native-chat transcript errors related to these restores.
  • Expected isolation noise only: daemon socket EINVAL under temp userData → local PTY fallback (does not block chat history restore).
  • CDP UA confirmed OrcaDev / Electron (not a headless Chrome substitute).

Screenshots

00 launch 01 paginated
00-app-launch.png 01-paginated-history-restored.png
01b paginated chrome 02 early unwrapped
01b-paginated-with-chrome.png 02-early-history-restored.png
03 legacy wrapped
03-legacy-history-restored.png

Cleanup

  • Screenshots uploaded via gh attach (not in PR diff).
  • Temp profile/transcripts/app process will be removed by the QA worker after this comment.

@brennanb2025
brennanb2025 merged commit 1d3decd into main Aug 10, 2026
44 checks passed
zpyoung pushed a commit to zpyoung/orca that referenced this pull request Aug 11, 2026
* fix(native-chat): restore transcript history across formats

* fix(native-chat): preserve safe Codex history metadata

(cherry picked from commit 1d3decd)
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* fix(native-chat): restore transcript history across formats

* fix(native-chat): preserve safe Codex history metadata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant