OpenAI Codex in ChatGPT: Clash Split Rules and DNS When the Cloud Coding Agent Times Out (2026)

OpenAI Codex inside ChatGPT is billed as a cloud coding agent: it plans edits, calls tools, and keeps a multi-step session alive in your browser. When that agent “spins” and then times out, the failure rarely announces whether the culprit was model overload, a blocked hostname, or a DNS split where the page loaded yesterday but today’s control-plane fetch bypasses your Clash policy. This guide centers Codex and cloud agent traffic—not a generic “make ChatGPT open” checklist—so you can build split routing and resolver behavior that survive long HTTPS sessions, sibling OpenAI domains, and subscription merges that quietly bury your prepend rows. You will get copy-paste YAML patterns, a log-first workflow, and crisp distinctions from other AI routing articles on this site.

Why Codex timeouts are a different search problem than “ChatGPT is down”

People who only read headline metrics often bundle every OpenAI outage into one bucket. In practice, ChatGPT as a consumer surface spans marketing pages, account billing, the default chat UI, labs features, and embedded products such as Codex that behave more like an IDE backend living inside a tab. The coding agent pattern amplifies sensitivity to partial failures: a single missing features.cfg-style fetch or a half-second TLS mismatch on an identity helper can stall tool orchestration while static HTML still renders.

That is why this article stands apart from our broader ChatGPT web and OpenAI API routing guide, which remains the right reference for separating api.openai.com from browser chat for general users. Here we emphasize agent-shaped workloads: repeated round trips, sticky sessions, and the temptation to blame “OpenAI servers” when the local policy stack never placed those flows into the outbound group you think you selected.

If you also run programmable agents outside the browser—CI jobs hitting vendor REST surfaces—pair this page with Cursor Agent SDK plus Clash for CI egress: overlapping philosophy, different capture mechanics.

What “timeout” usually means on the wire

Browser-facing errors compress multitudes. Translating user-visible timeout language into network reality helps you avoid superstitious node rotation.

  • Connect-timeout class: SYN packets or QUIC initial attempts never complete cleanly—often wrong path, aggressive middlebox, or DNS that lands on a blackhole address.
  • TLS-timeout class: TCP succeeds yet the handshake never finishes—certificate inspection, HTTP/3 downgrade fights, or exhaustion on congested exits that hurt long-lived streams more than one-shot REST calls.
  • Application-timeout class: TLS is fine but the HTTP exchange stalls—could be genuine backlog on OpenAI’s side, or your hop silently mangling HTTP/2 flow control. Distinguish using timestamps from Mihomo logs versus browser developer tools.
  • Policy-timeout illusion: Traffic erroneously matches an unintended rule—say a broad GEOIP line—so diagnostics look “random” by time of day because another application toggled system proxy settings or VPN routes.

Throughout, assume you run a Clash Meta / Mihomo-class core with readable logs. If grouping syntax still feels unfamiliar, warm up with the site Clash tutorial before layering vendor-specific prepend blocks.

Capture first: where the browser’s Codex worker actually exits

Rules do nothing when sockets never traverse Mihomo listeners. Codex lives in a privileged browser context; it is easy to imagine “everything is proxied” while only some profiles honor system proxy settings.

System proxy mode fits many desktop setups: the OS announces an HTTP(S) forwarder, Chromium respects it, and Clash terminates CONNECT requests predictably. Weaknesses appear when ancillary helpers spawn without inherited variables or when PAC files carve bizarre exceptions.

TUN / virtual NIC strategies capture more processes by default, at the cost of complexity—routing tables, split exclusions for LAN printers, and gaming clients that expect raw UDP. Our TUN mode deep dive explains trade-offs without locking you into one OS.

Document your truth table: for each failure reproduction, note whether the failing host appeared in Clash’s connection list. Absence strongly suggests capture drift, not DNS cleverness.

💡 Tip When a symptom appears only inside Codex but not in a vanilla chat tab, compare extensions, site permissions, and whether a corporate profile forces secure DNS that bypasses your stub resolver on localhost.

Baseline OpenAI hostnames and why logs still win

Vendors shift CDN edges; baseline lists age. Treat the following as starting hypotheses you confirm after OpenAI ships product changes—not as scripture copy-pasted from forums.

  • Browser chat shell: chat.openai.com remains the obvious anchor for interactive sessions.
  • Marketing and policy: openai.com, www.openai.com, and siblings for announcements may still interleave during navigation—even when your mental model is “developer mode only.”
  • Platform and keys: platform.openai.com often appears when billing, usage, or workspace administration overlaps your testing.
  • REST-style API entry points: api.openai.com matters when tools or hybrid clients call HTTP APIs alongside UI features.
  • Authentication helpers: auth.openai.com and related identity surfaces participate in refresh-token choreography.
  • Remote configuration fetches: hosts like features.cfg.openai.com historically gate feature flags; missing them produces endless loading spinners that resemble model outages.

Codex sessions may touch additional internal hosts as OpenAI evolves coding agent infrastructure — exactly why you should not stop at the shortest list. Reproduce, read the Server Name Indication or destination names your gateway prints, then extend YAML surgically.

Subscription merges that rewrite rules: daily make this worse. If your remote provider reorders entries, revisit custom rules and RULE-SET hygiene so personal prepend rows survive automation.

Design proxy groups before you spam DOMAIN lines

One overloaded group named OpenAI works when the same exit satisfies both snappy HTML and bursty SSE-style streams. Two groups—OpenAI-Web versus OpenAI-API—help when API calls demand lower jitter while the browser tolerates a more conservative path.

Selectors should be operationally labeled: logs must answer whether Codex traffic hit OpenAI-Agent or fell through to a catch-all. Generic group names like Proxy make root-cause threads painful during incident weeks.

Guides such as Clash proxy-groups cover url-test versus fallback semantics without vendor lock-in.

YAML sketch: LAN first, OpenAI explicit, catch-alls last

Clash evaluates top to bottom; first match wins. Keep RFC1918 and loopback exclusions first, then OpenAI literals, then imported GEOIP or MATCH rows supplied by subscriptions.

# Local fabric (adapt to your LAN / lab)
IP-CIDR,192.168.0.0/16,DIRECT
IP-CIDR,10.0.0.0/8,DIRECT
IP-CIDR,172.16.0.0/12,DIRECT
IP-CIDR,127.0.0.0/8,DIRECT

# OpenAI family — CONFIRM WITH YOUR MIHOMO LOGS AFTER EACH PRODUCT UPDATE
# Swap OpenAI-Codex for your real proxy-group label
DOMAIN,chat.openai.com,OpenAI-Codex
DOMAIN,platform.openai.com,OpenAI-Codex
DOMAIN,api.openai.com,OpenAI-Codex
DOMAIN,auth.openai.com,OpenAI-Codex
DOMAIN,features.cfg.openai.com,OpenAI-Codex
DOMAIN-SUFFIX,openai.com,OpenAI-Codex

# Subscription GEOIP / MATCH MUST remain after your prepend block

If you deliberately separate web from API, duplicate lines with distinct targets—just never fork contradictory duplicates across machines without documenting why.

GUI users maintaining Clash Verge Rev should mirror the same ordering inside mixin overrides; steps live in our Verge Rev mixin override guide so remote providers cannot trash personal prepend rows silently.

DNS symmetry: fake-ip, DoH, and the silent rule bypass

Even pristine DOMAIN rows fail when names resolve outside Mihomo’s rule engine. Symptoms include “ping looks fine” while Mihomo never matched chat.openai.com because another resolver short-circuited answers.

Align three planes deliberately:

  • Operating system resolver path: /etc/resolv.conf on Linux, scutil output on macOS, or DHCP-assigned DNS on Wi-Fi versus Ethernet.
  • Browser secure DNS toggles: Chromium may speak DNS-over-HTTPS to a public provider even when Clash advertises a local stub—great for privacy in isolation, disastrous for coordinated split tunneling.
  • Mihomo fake-ip configuration: ensure fake-ip ranges remain consistent with fake-ip-filter exceptions you expect; cross-check Meta documentation whenever you upgrade cores.

Linux-heavy readers debugging resolved on workstations or homelab builders should also skim Linux Clash plus systemd-resolved for conflict patterns that look bizarre until you map nsswitch ordering.

⚠️ Warning Never publish raw API keys, workspace tokens, or full Mihomo logs containing them when asking for community help. Redact aggressively; rotate creds if leakage is plausible.

Long sessions, HTTP/2, and QUIC: why Codex feels flakier than static browsing

Coding agents maintain conversational state, stream tokens, and may parallelize tool calls. That workload pattern stresses middleboxes and congested exits more than fetching a marketing hero image.

When failures correlate with long idle periods inside the tab, consider middleboxes that reset quiet HTTP/2 streams, or exits that deprioritize QUIC while the browser insists on HTTP/3. Testing steps belong in engineering notebooks: note time-to-failure, correlate with Mihomo outbound swaps, capture whether disabling QUIC experimentally stabilizes (only as a diagnostic, not a permanent security stance).

IPv6 preference on dual-stack LANs remains an evergreen foot-gun. If your policy handles IPv4 tunnels beautifully yet leaks AAAA lookups direct, you chase ghosts. Log both address families.

A practical verification loop you can repeat monthly

Operators who write procedures survive vendor churn; everyone else burns weekends swapping nodes.

  1. Reproduce minimally: one browser profile, one subscription profile, Codex scenario isolated from unrelated extensions.
  2. Prove capture: confirm Codex destinations appear in Mihomo’s live connections with the outbound group you intend.
  3. Diff DNS: compare getent hosts chat.openai.com (or platform equivalents) against Mihomo DNS logs during the failure minute.
  4. Measure TLS: scripted curl through the same hop quantifies whether slowness precedes application layers.
  5. Change one variable: adjust rules or resolver, not five knobs at once.
  6. Archive artifacts: timestamped YAML snippets and redacted logs make the next incident cheaper.

This cadence aligns with how teams already operate Cursor 3 agents beside Clash Verge Rev—interactive coding surfaces share debugging instincts even when vendors differ.

FAQ — Codex cloud agent plus Clash

My ChatGPT text chat works; only Codex stalls. Is that possible?

Yes. Distinct code paths may hit different hostnames, feature flags, or WebSocket endpoints. Rely on logs rather than assumptions that one DOMAIN-SUFFIX row covers every future agent surface.

Should I enable sniffing to rescue unknown domains?

Sniffing can help classify traffic when rules lag reality, yet it complicates mental models and occasionally surprises TLS fingerprint-sensitive stacks. Prefer accurate preemptive DOMAIN data from receipts; use sniffing as a scoped tool, not a permanent crutch.

Do corporate SSL inspection appliances break Codex first?

Often. Agent workloads may pin expectations about certificate stores or TLS features differently than static browsing. If inspection is mandatory, coordinate trust store deployment with security teams rather than improvising per-laptop toggles.

Is sharing a single ruleset between family, work, and lab machines safe?

Convenient but risky when LAN CIDR exclusions diverge. Factor common prepend blocks via Git, but keep machine-specific DIRECT rows out of shared blobs—or tag environments explicitly in documentation.

Key takeaway: agent reliability is routing observability

OpenAI Codex is the headline product users search when browser automation fails mid-task; Clash is the policy layer that makes those failures legible. Treat timeouts as signals to tighten split routing, align DNS, and verify hostnames instead of reflexively blaming distant model farms.

Compared with shrink-wrapped VPN clients tuned for a single connect button, many general-purpose tunnel apps obscure rule order, offer no mixin discipline, and surface little beyond a brand-colored map when sessions stall. A maintained Mihomo distribution—especially with GUI helpers that respect override ergonomics—gives you named outbounds, merge-safe prepend rows, and connection logs that explain why a cloud coding agent never reached its orchestration endpoint.

If you are consolidating installers for a team standard, prefer documented release channels over mystery mirrors, and use download Clash as the anchor link in your internal runbooks so checksum habits stay consistent.