Repository navigation
A Codex chat shows the turns made outside it - #30883
Conversation
When a Codex chat's agent opens its conversation, Orca reads Codex's own saved turns and adds the ones the chat doesn't have, after the chat's rows, behind a quiet "Continued outside this chat." divider. Turns are matched by Codex's own turn ids, read whole before anything is written, and never re-imported; a chat imported from a transcript gets only turns started after the import. A failed or partial read adds nothing and the next open tries again.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
6ae89571-bf73-47aa-a5c3-1e3a792aeaed
📒 Files selected for processing: 20
config/scripts/vitest-sqlite-runtime-files.mjssrc/main/codex/codex-structured-journal-translation-restore.tssrc/main/codex/codex-structured-journal-translation-turn-lifecycle.test.tssrc/main/codex/codex-structured-session-start.tssrc/main/codex/codex-structured-thread-catch-up.test.tssrc/main/codex/codex-structured-thread-catch-up.tssrc/main/native-chat/agent-session-journal/journal-reducer.tssrc/main/native-chat/agent-session-journal/journal-store.tssrc/main/native-chat/agent-session-wire/structured-agent-session-event-sink-queue.tssrc/main/native-chat/agent-session-wire/structured-agent-session-event-sink.tssrc/main/native-chat/agent-session-wire/structured-agent-session-journal-views.tssrc/renderer/src/components/native-chat/NativeChatNoticeRow.tsxsrc/renderer/src/i18n/en-runtime-required.jsonsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/shared/agent-session-host-status-rows.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
d24e11f1-b9a0-4d1b-84bb-3e5244e22a88
📒 Files selected for processing: 19
src/main/codex/codex-app-server-connection.tssrc/main/codex/codex-history-import-plan.tssrc/main/codex/codex-structured-journal-contracts.tssrc/main/codex/codex-structured-journal-items.tssrc/main/codex/codex-structured-journal-translation-restore.tssrc/main/codex/codex-structured-journal-translation.tssrc/main/codex/codex-structured-session-start.tssrc/main/codex/codex-structured-thread-catch-up.test.tssrc/main/codex/codex-structured-thread-catch-up.tssrc/main/codex/codex-structured-thread-history-pages.tssrc/main/codex/codex-thread-item-identity.tssrc/main/native-chat/agent-session-journal/journal-epoch-replacement.tssrc/main/native-chat/agent-session-journal/journal-history-origin.tssrc/main/native-chat/agent-session-journal/journal-reducer.tssrc/main/native-chat/agent-session-journal/journal-row-schema.tssrc/main/native-chat/agent-session-journal/journal-store.tssrc/main/native-chat/agent-session-wire/structured-agent-session-adopted-import.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-journal-views.tssrc/main/native-chat/agent-session-wire/structured-agent-session-transition.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
|
A Codex conversation continued in a terminal used to leave its chat missing those turns. The final branch appends missing saved turns when the chat next starts Codex, under “Continued outside this chat.” Reopening again keeps each turn once. Full review complete; test-only trim, QA carried. Current head Four review rounds repaired stranded older gaps, duplicate transcript imports, overwritten reasoning, partial publication, lost import boundaries after rewind and historical prompts affecting native delivery or waiting drafts. Final independent integration/readiness/performance/platform and whole-mechanism audits found no unresolved source blocker. The test trim retains the main flow, recorded regressions and saved-history paging/translation contracts while removing repeated branch/plumbing coverage. Added tests fell from 1,100 lines to 697, below 1,009 production additions plus 14 locale additions. All 282 tests across 13 named files passed on the new commit. The full PR workflow 39645306787 and aggregate job 119386803829 passed on this exact head. All five review threads are resolved. Admitted M4Air QA 1087 on Catch-up is an intended extension to the common pattern because a terminal can write while the chat’s Codex is stopped. It validates the whole missing range and appends once; it never replaces existing rows or uses saved history to settle native delivery. Opening remains available when catch-up is unsupported or fails. A send that starts Codex can precede recovered history, and older gaps append after existing rows. A Codex chat that was imported from a transcript and then rewound before this change can't add turns made outside it; it still opens and sends normally. Deferred: rewind may leave an orphan divider (STA-11349). Final QA also observed missing indexed Latest turns on both builds, different search-tip example text and reported checklist heading placement without established cause. Privacy coverage establishes matched startup/Refresh absence only; OS-consent-triggered toast delivery remains untested. Two model answers added periods despite exact-marker prompts; those actual bytes were preserved. Long-history performance, other operating systems, SSH, phone and mixed-version runtime flows are source-reviewed only. The evidence archive and all 598 file hashes were verified locally, with independent raw-row and complete-text comparisons. All 860 recorded QA process identities were stopped and ticket 1087 released. Failed capture receipts, the stopped recursive pnpm bootstrap, and historical updater/setup/cleanup limits remain recorded; they are not presented as successful final-head checks. The final PR description gives the scope and evidence limits. For Brennan’s review QA captures: exact main
One rewind, outside continuation, then native return:
Matched restart observations and their limitsBoth builds restarted the same stopped main-created profile at identical paths. Captures are full window, 1728×999, with saved zoom 0.
The search tip appears on both; its sample illustration text differs. Both Settings checklists retain 2/6 setup and 0/2 milestones, with no restart sidebar checklist. The QA report observed heading placement differing; no cause is established.
The indexed first prompt is present, but Latest turns says “No conversation preview available” on both builds. This unexpected result is also present on main.
Neither untouched startup nor ordinary Permissions Refresh displayed a privacy toast. The real macOS consent event was not triggered, so OS-consent-triggered toast delivery remains untested; these images establish only matched observed absence.
Three source judgments: whole-range atomic append, saved request IDs affect display only, and original transcript boundary. |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
b82efe06-3f60-47ae-8550-604dcc71b9a6
📒 Files selected for processing: 40
src/main/acp/acp-tool-timeline.tssrc/main/codex/codex-app-server-connection.tssrc/main/codex/codex-history-import-plan.tssrc/main/codex/codex-history-journal-view.tssrc/main/codex/codex-structured-journal-translation-turn-lifecycle.test.tssrc/main/codex/codex-structured-thread-catch-up-echo.spec.tssrc/main/codex/codex-structured-thread-catch-up.test.tssrc/main/codex/codex-structured-thread-catch-up.tssrc/main/codex/codex-structured-thread-history-pages.tssrc/main/jsonl-rpc/timeline-final-tail.test.tssrc/main/jsonl-rpc/timeline-lane.tssrc/main/native-chat/agent-session-journal/journal-completed-content.test.tssrc/main/native-chat/agent-session-journal/journal-epoch-replacement.tssrc/main/native-chat/agent-session-journal/journal-item-echo.tssrc/main/native-chat/agent-session-journal/journal-item-provenance.tssrc/main/native-chat/agent-session-journal/journal-lifecycle-batch-appender.tssrc/main/native-chat/agent-session-journal/journal-lifecycle-mutation.tssrc/main/native-chat/agent-session-journal/journal-reducer.tssrc/main/native-chat/agent-session-journal/journal-row-builders.tssrc/main/native-chat/agent-session-journal/journal-row-schema.tssrc/main/native-chat/agent-session-journal/journal-store-contracts.tssrc/main/native-chat/agent-session-journal/queued-message-delivered-echo.tssrc/main/native-chat/agent-session-wire/agent-session-item-wire-form.test.tssrc/main/native-chat/agent-session-wire/agent-session-item-wire-form.tssrc/main/native-chat/agent-session-wire/structured-agent-session-event-sink.tssrc/main/native-chat/agent-session-wire/structured-agent-session-journal-append-options.tssrc/main/native-chat/agent-session-wire/structured-agent-session-journal-views.tssrc/main/native-chat/agent-session-wire/structured-rewind-cut.tssrc/main/pi/rpc-messages.tssrc/main/pi/rpc-session.tssrc/renderer/src/components/native-chat/NativeChatNoticeRow.tsxsrc/renderer/src/components/native-chat/NativeChatToolOutput.test.tsxsrc/renderer/src/components/native-chat/NativeChatToolOutput.tsxsrc/renderer/src/i18n/en-runtime-required.jsonsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.json
🚧 Files skipped from review as they are similar to previous changes: 8
- src/renderer/src/i18n/locales/en.json
- src/renderer/src/i18n/locales/fr.json
- src/renderer/src/i18n/locales/ko.json
- src/renderer/src/i18n/locales/zh.json
- src/renderer/src/i18n/locales/ja.json
- src/renderer/src/i18n/en-runtime-required.json
- src/main/codex/codex-structured-journal-translation-turn-lifecycle.test.ts
- src/renderer/src/i18n/locales/es.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
0642a3a0-ea85-4105-a225-0544a3a3595f
📒 Files selected for processing: 11
src/main/codex/codex-structured-session-start.tssrc/main/native-chat/agent-session-journal/journal-epoch-replacement.tssrc/main/native-chat/agent-session-journal/journal-store.tssrc/main/native-chat/agent-session-wire/structured-agent-session-event-sink.tssrc/renderer/src/i18n/en-runtime-required.jsonsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.json
🚧 Files skipped from review as they are similar to previous changes: 7
- src/renderer/src/i18n/en-runtime-required.json
- src/renderer/src/i18n/locales/fr.json
- src/renderer/src/i18n/locales/zh.json
- src/renderer/src/i18n/locales/en.json
- src/renderer/src/i18n/locales/es.json
- src/renderer/src/i18n/locales/ja.json
- src/renderer/src/i18n/locales/ko.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.














ELI5
Continuing a Codex conversation in a terminal used to leave its chat missing those turns. When the chat next starts Codex, it now appends the saved outside turns under “Continued outside this chat.” Reopening again keeps each turn once.
What Changed
Catch-up reads the complete saved turn list, including older missing gaps, and validates full detail and the complete restore budget before appending one insert-only batch. Existing chat rows are never deleted or rewritten. Failed, unsupported, oversized or ambiguous reads skip catch-up while ordinary supported opening continues.
Saved native request IDs prevent a prompt already in the chat from being shown twice. This changes display only: delivery state, receipts, waiting drafts and queue cards keep their existing meaning. Unknown sends remain unknown even if their answer becomes visible. Without a usable saved request ID, a native prompt can appear again as an outside prompt.
Transcript-imported chats keep their original import boundary through later rewinds. Imported reasoning and other items include their turn identity, preserving earlier items after outside history changes. When a previously represented turn is absent from the saved conversation, the divider explains that earlier replies remain above.
Why
The common pattern keeps the chat journal authoritative. Orca additionally permits a terminal to write the same conversation while the chat’s Codex is stopped, so catch-up runs at provider startup, before its private server holds the writer lock. It adds no polling or recovery queue. Replacing the chat could lose retained rows; text matching could confuse an outside prompt with a native send; stopping at the first known turn could strand an older gap.
Linked Issue
Part of the in-place chat and terminal switch lane. This PR provides independently useful catch-up; the switch control is a later change.
Testing
Full review path for saved data, ordering and lifecycle: four review rounds, fixes, independent integration/readiness/performance/platform audits and the whole-mechanism comparison completed on
f709f818f654217edb1454f7e94099f6fd050db2. The successor50cf8ef0e817f0413e75f9e4fd8597f6d2b18b30changes only three test files; every production, locale, configuration and workflow file is identical. Mainbbc8303b47ffremains integrated.test-only trim, QA carried under the launcher’s explicit instruction. Added test lines fell from 1,100 to 697, below 1,009 production additions plus 14 locale additions. The remaining tests retain the main catch-up flow, the concrete regressions found during review and the Codex saved-history paging/translation contract. They remove repeated branch/plumbing matrices and duplicate assertions. All 282 tests across 13 named files passed on the committed new head. The full PR workflow 39645306787, including aggregate job 119386803829, passed on that exact head; all review threads are resolved.
QA 1087 ran on
f709f818f654; it carries to the identical production code in50cf8ef0e817without claiming a new runtime execution. Hidden Electron QA ran on the admitted M4Air with real Codex 0.163.0 and a Codex QA driver:codex resumeturns after the native writer exited, normal terminal exit, native restart/send, and another reopen/send all completed. Six outside messages appeared once, in source order, under one divider. All 32 preceding journal rows stayed byte exact; repeat reopening retained all 45 preceding rows and the same single import.The coordinator verified the sanitized archive and every one of its 598 manifest entries, inspected the screenshots and independently compared raw journal prefixes and complete answer bytes. All 860 recorded QA process identities were stopped and ticket 1087 released.
Visual Proof
QA captures: exact main
bbc8303b47ffand reviewed production headf709f818f654, using the same main-created saved profile. Production is byte identical in the test-only successor50cf8ef0e817:Rewind followed by real terminal continuation and native return:
Matched restart observations and their limits
Both builds restarted the same stopped main-created profile at identical paths. Captures are full window, 1728×999, with saved zoom 0.
The search tip appears on both; its sample illustration text differs. Both Settings checklists retain 2/6 setup and 0/2 milestones, with no restart sidebar checklist. The QA report observed heading placement differing; no cause is established.
The indexed first prompt is present, but Latest turns says “No conversation preview available” on both builds. This unexpected result is also present on main.
Neither untouched startup nor ordinary Permissions Refresh displayed a privacy toast. The real macOS consent event was not triggered, so OS-consent-triggered toast delivery remains untested; these images establish only matched observed absence.
Notes
Author: Brennan Benson (@BrennanKB5)