When Your AI Sidekick Can't Connect
Imagine this: you're out on a trail, phone in hand, ready to check on your AI coding buddy back home. But the remote control feature just won't connect. That's exactly what happened to me with Codex. I'd tried everything—rebooting, updating, checking accounts—but that red error message kept popping up: "Unable to enable remote control. Please try again."
If you're into tech tinkering as a hobby, you know the frustration. But here's the twist: instead of giving up, I decided to let the AI diagnose its own problem. This turned into a fun afternoon of detective work that not only fixed the issue but also taught me a thing or two about how AI and humans can team up.
The Setup: Mac + Phone + Codex
My goal was simple: have Codex running on my Mac, and use my phone to check in, send new commands, and keep the work flowing even when I'm away from the desk. For anyone who likes to code while hiking or fishing, this is a game-changer—if it works.
The setup seemed straightforward: go to Settings → Remote Control on the phone, pair with the desktop, and you're in. But the Mac kept failing at the "Allow" step. I suspected account permissions or workspace issues, but those checked out fine.
Upgrade? Not the Fix
I noticed an update for Codex—from 26.803.61601 to 26.810.50856. Maybe it was a bug. I upgraded, tried again, and got the same error. So, not a version issue.
Diving into Logs: A Detective's Move
Next, I checked the official logs. Found them at ~/Library/Logs/com.openai.codex/YYYY/MM/DD. Searching for remote control, I saw entries like remoteControl/enable with errorCode=null and connectionCount=0. That suggested the feature was turning on, but connections weren't being made. Something was blocking the network path.
The Proxy Puzzle
My Mac uses a local proxy to reach ChatGPT—a common setup for many. The proxy was on, and ChatGPT worked fine, so I assumed the network was fine. But I ran a couple of tests:
- Direct connection to chatgpt.com: timed out.
- Using the proxy: connection established instantly.
That told me the main app was using the proxy, but the remote control's background connection wasn't inheriting those settings.
Solving It with Environment Variables
The fix was elegant: launch Codex with explicit proxy environment variables. I quit the app, opened Terminal, and ran:
export HTTP_PROXY=http://127.0.0.1:33210
export HTTPS_PROXY=http://127.0.0.1:33210
export ALL_PROXY=socks5://127.0.0.1:33211
open -a "Codex"Then I hit "Allow" again—and it worked. My phone connected to the Mac. The problem wasn't my account or the app; it was that the remote control service didn't inherit the proxy settings.
Making It Stick: A Custom Launcher
Setting environment variables each time is a hassle. So, I created a small AppleScript app that waits 8 seconds (for the proxy to start) and then launches Codex with the right variables. Here's the command:
mkdir -p "$HOME/Applications"
osacompile -o "$HOME/Applications/Codex-Proxy-Launcher.app" -e 'delay 8' -e 'do shell script "export HTTP_PROXY=http://127.0.0.1:33210; export HTTPS_PROXY=http://127.0.0.1:33210; export ALL_PROXY=socks://127.0.0.1:33211; /usr/bin/open -a Codex"'Then add it to your login items and use it instead of the regular Codex icon. It's clean, reversible, and doesn't mess with system settings.
Why This Matters for Hobbyists
This whole experience reminded me that technology is part of our leisure time. Whether you're into coding, gaming, or any tech hobby, knowing how to debug your tools is a valuable skill. And having an AI that can help you fix its own issues? That's like having a buddy who's a whiz at troubleshooting.
So next time your tech acts up, consider letting the AI take a crack at it. You might be surprised at what you can solve together.
Comments (0)
Please sign in to post a comment.
Don't have an account? Create one
No comments yet. Be the first to comment!