<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: vild da</title>
    <description>The latest articles on DEV Community by vild da (@vild_da_f524590ed3ae13840).</description>
    <link>https://dev.to/vild_da_f524590ed3ae13840</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3843027%2F810b8b05-f248-45e4-aec8-d965eb36d17d.png</url>
      <title>DEV Community: vild da</title>
      <link>https://dev.to/vild_da_f524590ed3ae13840</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vild_da_f524590ed3ae13840"/>
    <language>en</language>
    <item>
      <title>Why Codex history disappears after switching providers (and how I fixed it)</title>
      <dc:creator>vild da</dc:creator>
      <pubDate>Wed, 25 Mar 2026 10:50:42 +0000</pubDate>
      <link>https://dev.to/vild_da_f524590ed3ae13840/why-codex-history-disappears-after-switching-providers-and-how-i-fixed-it-f0j</link>
      <guid>https://dev.to/vild_da_f524590ed3ae13840/why-codex-history-disappears-after-switching-providers-and-how-i-fixed-it-f0j</guid>
      <description>&lt;p&gt;I ran into an annoying Codex problem while switching between official OpenAI auth and relay/custom providers.&lt;/p&gt;

&lt;p&gt;The sessions were not actually gone. What broke was session visibility.&lt;/p&gt;

&lt;p&gt;In practice, the symptoms looked like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;old sessions were visible under one provider, then disappeared after switching to another one&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;codex resume&lt;/code&gt; and Codex App did not always show the same history&lt;/li&gt;
&lt;li&gt;changing only the rollout files was not enough&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why this happens
&lt;/h2&gt;

&lt;p&gt;Codex stores provider-related session metadata in two places:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;rollout files under &lt;code&gt;~/.codex/sessions&lt;/code&gt; and &lt;code&gt;~/.codex/archived_sessions&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;SQLite state in &lt;code&gt;~/.codex/state_5.sqlite&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If only one layer is updated, the history may still look inconsistent. That is why a session can appear to be "missing" even though the actual data is still there.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;I built &lt;code&gt;codex-provider-sync&lt;/code&gt; to align both layers together.&lt;/p&gt;

&lt;p&gt;It can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;inspect the current provider distribution&lt;/li&gt;
&lt;li&gt;sync rollout metadata and SQLite state to a target provider&lt;/li&gt;
&lt;li&gt;optionally update root &lt;code&gt;model_provider&lt;/code&gt; in &lt;code&gt;config.toml&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;create a backup before each run&lt;/li&gt;
&lt;li&gt;restore from backup if needed&lt;/li&gt;
&lt;li&gt;skip locked live rollout files and report them clearly&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Windows GUI
&lt;/h2&gt;

&lt;p&gt;I also added a Windows GUI so normal users do not need Node or npm anymore.&lt;/p&gt;

&lt;p&gt;The GUI can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;scan the current &lt;code&gt;.codex&lt;/code&gt; home&lt;/li&gt;
&lt;li&gt;show provider distribution from rollout files and SQLite&lt;/li&gt;
&lt;li&gt;let you pick a target provider and execute the sync&lt;/li&gt;
&lt;li&gt;optionally update root &lt;code&gt;model_provider&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;restore from backup&lt;/li&gt;
&lt;li&gt;automatically keep the newest 5 managed backups by default, with configurable retention&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/Dailin521/codex-provider-sync" rel="noopener noreferrer"&gt;https://github.com/Dailin521/codex-provider-sync&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Release: &lt;a href="https://github.com/Dailin521/codex-provider-sync/releases/tag/0.2.0" rel="noopener noreferrer"&gt;https://github.com/Dailin521/codex-provider-sync/releases/tag/0.2.0&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you have hit the "my Codex history disappeared after switching providers" problem, this is exactly what the tool is meant to fix.&lt;/p&gt;

</description>
      <category>productivity</category>
    </item>
  </channel>
</rss>
