<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Codex on XEDCZQ Blog</title><link>https://xedczq.cn/en/tags/codex/</link><description>Recent content in Codex on XEDCZQ Blog</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Thu, 11 Jun 2026 00:00:00 +0800</lastBuildDate><atom:link href="https://xedczq.cn/en/tags/codex/index.xml" rel="self" type="application/rss+xml"/><item><title>Recovering Codex History After Switching Providers with CCSwitch on Mac</title><link>https://xedczq.cn/en/post/codex_ccswitch%E5%8E%86%E5%8F%B2%E6%81%A2%E5%A4%8D/</link><pubDate>Thu, 11 Jun 2026 00:00:00 +0800</pubDate><guid>https://xedczq.cn/en/post/codex_ccswitch%E5%8E%86%E5%8F%B2%E6%81%A2%E5%A4%8D/</guid><description>&lt;h1 id="recovering-codex-history-after-switching-providers-with-ccswitch-on-mac"&gt;&lt;a href="#recovering-codex-history-after-switching-providers-with-ccswitch-on-mac" class="header-anchor"&gt;&lt;/a&gt;Recovering Codex History After Switching Providers with CCSwitch on Mac
&lt;/h1&gt;&lt;p&gt;This note explains how to troubleshoot and recover Codex conversations that suddenly disappear after using CCSwitch to change a relay endpoint or model provider on macOS.&lt;/p&gt;
&lt;p&gt;The short version is: &lt;strong&gt;the history files are usually still stored on the Mac, but the newly selected Provider environment may not directly expose threads created under the previous Provider.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This guide uses the third-party command-line tool &lt;code&gt;codex-threadripper&lt;/code&gt; to rescan and synchronize local threads. It is not an official OpenAI tool. Verify its source and make a complete backup of &lt;code&gt;~/.codex&lt;/code&gt; before installing or running it.&lt;/p&gt;
&lt;h2 id="symptoms"&gt;&lt;a href="#symptoms" class="header-anchor"&gt;&lt;/a&gt;Symptoms
&lt;/h2&gt;&lt;p&gt;After changing the Codex relay endpoint, &lt;code&gt;model_provider&lt;/code&gt;, or &lt;code&gt;base_url&lt;/code&gt; with CCSwitch, you may observe that:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Codex starts and answers normally.&lt;/li&gt;
&lt;li&gt;New conversations are saved correctly.&lt;/li&gt;
&lt;li&gt;Conversations created before the switch are no longer visible.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;~/.codex&lt;/code&gt; directory still exists and its disk usage has not dropped significantly.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This does not necessarily mean that the history was deleted. Local thread data may contain Provider, model-source, or environment metadata. After configuration changes, the new environment may expose a different set of threads.&lt;/p&gt;
&lt;h2 id="recovery-approach"&gt;&lt;a href="#recovery-approach" class="header-anchor"&gt;&lt;/a&gt;Recovery Approach
&lt;/h2&gt;&lt;p&gt;The complete workflow is:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Back up ~/.codex
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -&amp;gt; Switch to the target relay with CCSwitch
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -&amp;gt; Confirm that Codex works normally
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -&amp;gt; Scan and synchronize threads with codex-threadripper
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -&amp;gt; Reopen Codex
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -&amp;gt; Verify history and tool status
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Do not modify or delete the local Codex database without a backup. If the original history files still exist, recovery is usually possible. Once the source data is overwritten, recovery becomes much harder.&lt;/p&gt;
&lt;h2 id="install-codex-threadripper"&gt;&lt;a href="#install-codex-threadripper" class="header-anchor"&gt;&lt;/a&gt;Install codex-threadripper
&lt;/h2&gt;&lt;p&gt;&lt;code&gt;codex-threadripper&lt;/code&gt; is a third-party command-line tool for scanning and processing local Codex history threads. Depending on your package manager, install it through Homebrew or npm.&lt;/p&gt;
&lt;h3 id="install-with-homebrew"&gt;&lt;a href="#install-with-homebrew" class="header-anchor"&gt;&lt;/a&gt;Install with Homebrew
&lt;/h3&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew tap wangnov/tap
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew install codex-threadripper
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="install-globally-with-npm"&gt;&lt;a href="#install-globally-with-npm" class="header-anchor"&gt;&lt;/a&gt;Install globally with npm
&lt;/h3&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;npm i -g codex-threadripper
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Check that the command is available:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;codex-threadripper --help
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If Homebrew or npm cannot find the package, the tool may no longer be available from that source, or its repository and package names may have changed. Do not download an unverified binary. Confirm the project repository and release page first.&lt;/p&gt;
&lt;h2 id="recommended-recovery-workflow-on-mac"&gt;&lt;a href="#recommended-recovery-workflow-on-mac" class="header-anchor"&gt;&lt;/a&gt;Recommended Recovery Workflow on Mac
&lt;/h2&gt;&lt;h3 id="back-up-local-codex-data"&gt;&lt;a href="#back-up-local-codex-data" class="header-anchor"&gt;&lt;/a&gt;Back Up Local Codex Data
&lt;/h3&gt;&lt;p&gt;Quit all running Codex instances, then create a timestamped backup:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cp -R ~/.codex ~/.codex_backup_&lt;span class="k"&gt;$(&lt;/span&gt;date +%Y%m%d_%H%M%S&lt;span class="k"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Confirm that the backup exists:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ls -ld ~/.codex_backup_*
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The backup may contain account state, configuration, and private conversation history. Do not upload it to a public cloud drive or repository, or share it with an untrusted party.&lt;/p&gt;
&lt;h3 id="switch-to-the-target-provider-with-ccswitch"&gt;&lt;a href="#switch-to-the-target-provider-with-ccswitch" class="header-anchor"&gt;&lt;/a&gt;Switch to the Target Provider with CCSwitch
&lt;/h3&gt;&lt;p&gt;Use CCSwitch to select the relay endpoint or model provider you want to use. Reopen Codex and confirm that:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Codex starts normally.&lt;/li&gt;
&lt;li&gt;Authentication with the current Provider succeeds.&lt;/li&gt;
&lt;li&gt;A test message receives a response.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Make sure the new environment works before synchronizing history. Otherwise, Provider configuration failures and history-index problems become difficult to distinguish.&lt;/p&gt;
&lt;h3 id="synchronize-threads"&gt;&lt;a href="#synchronize-threads" class="header-anchor"&gt;&lt;/a&gt;Synchronize Threads
&lt;/h3&gt;&lt;p&gt;Run the following command in Terminal:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;codex-threadripper sync
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If the tool does not automatically detect the Codex data directory, specify it explicitly:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;codex-threadripper --codex-home &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/.codex&amp;#34;&lt;/span&gt; sync
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;On macOS, &lt;code&gt;$HOME/.codex&lt;/code&gt; resolves to:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/Users/your-username/.codex
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Do not run multiple Codex instances during synchronization, and do not delete databases or thread files from &lt;code&gt;~/.codex&lt;/code&gt; while the command is running.&lt;/p&gt;
&lt;h3 id="reload-codex"&gt;&lt;a href="#reload-codex" class="header-anchor"&gt;&lt;/a&gt;Reload Codex
&lt;/h3&gt;&lt;p&gt;After synchronization finishes, fully quit and reopen Codex. Use the history, session-resume, thread-list, or search entry provided by your installed version.&lt;/p&gt;
&lt;p&gt;History commands and UI entry points can change between Codex versions. If a parameter or interactive command is unavailable, inspect the commands supported by your current installation:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;codex --help
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Treat the actual options shown by the installed client as the source of truth.&lt;/p&gt;
&lt;h3 id="inspect-synchronization-status"&gt;&lt;a href="#inspect-synchronization-status" class="header-anchor"&gt;&lt;/a&gt;Inspect Synchronization Status
&lt;/h3&gt;&lt;p&gt;Use the third-party tool to inspect current thread status:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;codex-threadripper status
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If supported by that version, the output groups threads by sources such as &lt;code&gt;custom&lt;/code&gt; and &lt;code&gt;openai&lt;/code&gt;, helping confirm whether old records were scanned and merged.&lt;/p&gt;
&lt;h2 id="how-to-confirm-recovery"&gt;&lt;a href="#how-to-confirm-recovery" class="header-anchor"&gt;&lt;/a&gt;How to Confirm Recovery
&lt;/h2&gt;&lt;p&gt;Check the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Threads created before the Provider switch appear in Codex again.&lt;/li&gt;
&lt;li&gt;User messages and Codex responses remain in the correct order when an old thread is opened.&lt;/li&gt;
&lt;li&gt;New conversations can still be created and saved under the new Provider.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;codex-threadripper status&lt;/code&gt; detects the expected threads.&lt;/li&gt;
&lt;li&gt;Recovered threads remain visible after restarting Codex.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="troubleshooting"&gt;&lt;a href="#troubleshooting" class="header-anchor"&gt;&lt;/a&gt;Troubleshooting
&lt;/h2&gt;&lt;h3 id="codex-threadripper-command-not-found"&gt;&lt;a href="#codex-threadripper-command-not-found" class="header-anchor"&gt;&lt;/a&gt;codex-threadripper Command Not Found
&lt;/h3&gt;&lt;p&gt;Check the executable path and help output:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;which codex-threadripper
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;codex-threadripper --help
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For an npm installation, also confirm that the global npm executable directory is included in &lt;code&gt;PATH&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id="old-conversations-are-still-missing"&gt;&lt;a href="#old-conversations-are-still-missing" class="header-anchor"&gt;&lt;/a&gt;Old Conversations Are Still Missing
&lt;/h3&gt;&lt;p&gt;Check these items in order:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Confirm that synchronization used the actual Codex directory, normally &lt;code&gt;~/.codex&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Confirm that you switched to the target Provider before running synchronization.&lt;/li&gt;
&lt;li&gt;Fully quit and restart Codex instead of only closing a window.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;status&lt;/code&gt; to check whether the tool detected old threads.&lt;/li&gt;
&lt;li&gt;Check whether the old data is stored under another &lt;code&gt;CODEX_HOME&lt;/code&gt; or backup directory.&lt;/li&gt;
&lt;li&gt;Review command output for database-lock, permission, or incompatible-format errors.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="database-is-locked-during-synchronization"&gt;&lt;a href="#database-is-locked-during-synchronization" class="header-anchor"&gt;&lt;/a&gt;Database Is Locked During Synchronization
&lt;/h3&gt;&lt;p&gt;Quit Codex and any other processes that may access &lt;code&gt;~/.codex&lt;/code&gt;, then retry. Do not force-copy or modify an index while the database is being written.&lt;/p&gt;
&lt;h3 id="history-reappears-after-switching-back"&gt;&lt;a href="#history-reappears-after-switching-back" class="header-anchor"&gt;&lt;/a&gt;History Reappears After Switching Back
&lt;/h3&gt;&lt;p&gt;This usually indicates that the original data was never lost. The visible thread set or index differs between Provider environments. Back up the data before deciding whether synchronization is necessary, rather than deleting the old configuration.&lt;/p&gt;
&lt;h2 id="rollback"&gt;&lt;a href="#rollback" class="header-anchor"&gt;&lt;/a&gt;Rollback
&lt;/h2&gt;&lt;p&gt;If synchronization causes problems, quit Codex first. Preserve the current directory for diagnosis, then restore the backup as &lt;code&gt;~/.codex&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Confirm the actual backup directory name before restoring. The commands below are only an example:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mv ~/.codex ~/.codex_after_sync
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cp -R ~/.codex_backup_20260611_120000 ~/.codex
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Replace the example timestamp with the backup directory you actually created.&lt;/p&gt;
&lt;h2 id="security-notes"&gt;&lt;a href="#security-notes" class="header-anchor"&gt;&lt;/a&gt;Security Notes
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;~/.codex&lt;/code&gt; may contain login state, Provider configuration, API Key references, and conversation content.&lt;/li&gt;
&lt;li&gt;Never commit the complete directory to Git.&lt;/li&gt;
&lt;li&gt;Do not send database files to strangers for troubleshooting.&lt;/li&gt;
&lt;li&gt;Inspect the source, installation scripts, and release files of third-party thread tools.&lt;/li&gt;
&lt;li&gt;Keep an untouched backup before every synchronization attempt.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="summary"&gt;&lt;a href="#summary" class="header-anchor"&gt;&lt;/a&gt;Summary
&lt;/h2&gt;&lt;p&gt;When Codex history disappears after switching relay endpoints with CCSwitch, it does not necessarily mean the local data was deleted. More often, the new Provider configuration does not read the old threads. The safest order is: &lt;strong&gt;back up first, switch and validate the Provider, then synchronize threads and verify the result.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;codex-threadripper&lt;/code&gt; can be used as a third-party recovery method, but its package source and command behavior may change. Always verify the installed version with &lt;code&gt;--help&lt;/code&gt; before allowing it to write to &lt;code&gt;~/.codex&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Connecting Mobile GPT to Mac Codex</title><link>https://xedczq.cn/en/post/codex_%E6%89%8B%E6%9C%BAgpt%E8%BF%9E%E6%8E%A5%E6%95%99%E7%A8%8B/</link><pubDate>Tue, 26 May 2026 10:30:00 +0800</pubDate><guid>https://xedczq.cn/en/post/codex_%E6%89%8B%E6%9C%BAgpt%E8%BF%9E%E6%8E%A5%E6%95%99%E7%A8%8B/</guid><description>&lt;h1 id="connecting-mobile-gpt-to-mac-codex"&gt;&lt;a href="#connecting-mobile-gpt-to-mac-codex" class="header-anchor"&gt;&lt;/a&gt;Connecting Mobile GPT to Mac Codex
&lt;/h1&gt;&lt;p&gt;This note records my own setup process. The goal was to make the GPT app on my phone connect reliably to Codex running on my Mac.&lt;/p&gt;
&lt;h2 id="steps"&gt;&lt;a href="#steps" class="header-anchor"&gt;&lt;/a&gt;Steps
&lt;/h2&gt;&lt;h3 id="sign-in-with-the-same-account"&gt;&lt;a href="#sign-in-with-the-same-account" class="header-anchor"&gt;&lt;/a&gt;Sign in with the same account
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;Sign in to the GPT app on the phone with your account.&lt;/li&gt;
&lt;li&gt;Sign in to Codex on the Mac with the same account.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="enable-multi-factor-authentication-on-the-phone"&gt;&lt;a href="#enable-multi-factor-authentication-on-the-phone" class="header-anchor"&gt;&lt;/a&gt;Enable multi-factor authentication on the phone
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;Enable multi-factor authentication (MFA) on the mobile side. Otherwise, the phone-side security verification may fail.&lt;/li&gt;
&lt;li&gt;In my case, I completed the verification using Apple&amp;rsquo;s built-in password/authentication capability.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="configure-codex-proxy-environment-variables"&gt;&lt;a href="#configure-codex-proxy-environment-variables" class="header-anchor"&gt;&lt;/a&gt;Configure Codex proxy environment variables
&lt;/h3&gt;&lt;p&gt;Edit &lt;code&gt;~/.codex/.env&lt;/code&gt; and add the following content:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-env" data-lang="env"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;HTTP_PROXY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://127.0.0.1:6789
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;HTTPS_PROXY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://127.0.0.1:6789
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;ALL_PROXY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://127.0.0.1:6789
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;WS_PROXY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://127.0.0.1:6789
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;WSS_PROXY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://127.0.0.1:6789
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;http_proxy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://127.0.0.1:6789
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;https_proxy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://127.0.0.1:6789
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;all_proxy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://127.0.0.1:6789
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;ws_proxy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://127.0.0.1:6789
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;wss_proxy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://127.0.0.1:6789
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;NO_PROXY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;localhost,127.0.0.1,::1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;no_proxy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;localhost,127.0.0.1,::1
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After saving the configuration, restart Codex.&lt;/p&gt;
&lt;p&gt;If you use a local proxy tool, Codex may work normally without changing these environment variables, but the mobile app may still show the device as offline.&lt;/p&gt;
&lt;h3 id="connect-the-phone-and-codex"&gt;&lt;a href="#connect-the-phone-and-codex" class="header-anchor"&gt;&lt;/a&gt;Connect the phone and Codex
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;After restarting Codex, try the connection flow again from the mobile app.&lt;/li&gt;
&lt;li&gt;Once the connection succeeds, it should be ready for normal use.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="success-criteria"&gt;&lt;a href="#success-criteria" class="header-anchor"&gt;&lt;/a&gt;Success Criteria
&lt;/h2&gt;&lt;p&gt;I mainly used two signals to decide whether the setup was successful:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Mobile GPT and Mac Codex are signed in with the same account and remain stable.&lt;/li&gt;
&lt;li&gt;Codex network requests work normally, without proxy or connection errors.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="troubleshooting"&gt;&lt;a href="#troubleshooting" class="header-anchor"&gt;&lt;/a&gt;Troubleshooting
&lt;/h2&gt;&lt;p&gt;If the connection fails, I would check the following items in order:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Confirm that the phone and Mac are using the same account.&lt;/li&gt;
&lt;li&gt;Confirm that MFA has been completed and is active.&lt;/li&gt;
&lt;li&gt;Check whether &lt;code&gt;~/.codex/.env&lt;/code&gt; was saved successfully and whether the port is correct.&lt;/li&gt;
&lt;li&gt;Confirm that the local proxy at &lt;code&gt;127.0.0.1:6789&lt;/code&gt; is running and that the port matches.&lt;/li&gt;
&lt;li&gt;Restart Codex and try again.&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>