Repository navigation
fix(codex): show history of chats started outside the app - #460
Open
Mayaskara25 wants to merge 1 commit into
Open
Mayaskara25 wants to merge 1 commit into
Mayaskara25 wants to merge 1 commit into
Conversation
Codex chats from the terminal or another device opened empty.
This branch has not been deployed
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.
Problem. Codex conversations started outside AndCode's chat screen (in the terminal, with
codex exec, or copied from another device) appear in the chat list with their title, but open empty.Cause. The chat list comes from Codex (
thread/list), butlistMessagesreads only the localcodex-messages.json. That file is filled only by live notifications while AndCode runs a turn itself.Fix. When a thread has no stored messages and no turn in flight,
CodexRuntimepages throughthread/items/list(ascending, 100 per page, capped). Entries are converted with a separateCodexItemParserinstance, so live state is untouched, and keep their originalstartedAtMs/completedAtMs. They are stored and flushed. Threads Codex reports as empty are remembered per process. Failures are logged and fall back to the store.thread/items/listis the paginated API that Codex 0.172 points to now that full-history hydration withincludeTurnsis deprecated.Not included: re-syncing a thread that is only partly stored (started in AndCode, then continued elsewhere). That needs a way to replace a session's stored list without losing details the live stream recorded; better as a follow-up.
Testing. Tested on a Samsung Galaxy F41 (SM-F415F) with Codex 0.172.0 and Claude Code 2.1.332.
CodexHistoryTest(7 tests: conversion and ordering, timestamps, paging, empty threads, failure fallback, turn in flight, page cap); all*Codex*andChatViewModelTesttests pass.codexin the terminal, opened it in the chat screen, and saw the earlier messages with their original times. Sent a follow-up, which answered in context, and the history was still there after a force-stop.🤖 Generated with Claude Code