[Windows][26.820.60940 regression] Java NIO Selector.open fails with "Unable to establish loopback connection"
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What version of the Codex App are you using (From “About Codex” dialog)?
26.820.60940
What subscription do you have?
Pro
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
After installing Codex App 26.820.60940 on August 26, 2026, Java processes launched through Codex cannot initialize a Java NIO selector.
The first visible symptom was that this command stopped working:
.\gradlew.bat compileJava
The Gradle wrapper starts Java, but the build fails before source compilation begins:
FAILURE: Build failed with an exception.
* What went wrong:
java.io.IOException: Unable to establish loopback connection
Running with --no-daemon --stacktrace produces:
java.io.UncheckedIOException: java.io.IOException: Unable to establish loopback connection
at org.gradle.internal.remote.internal.inet.SocketConnection.<init>(SocketConnection.java:64)
at org.gradle.launcher.daemon.client.DefaultDaemonConnector.connectToDaemon(DefaultDaemonConnector.java:271)
at org.gradle.launcher.daemon.client.DefaultDaemonConnector.startSingleUseDaemon(DefaultDaemonConnector.java:244)
Caused by: java.io.IOException: Unable to establish loopback connection
at java.base/sun.nio.ch.PipeImpl$Initializer.init(PipeImpl.java:96)
at java.base/sun.nio.ch.PipeImpl.<init>(PipeImpl.java:186)
at java.base/sun.nio.ch.WEPollSelectorImpl.<init>(WEPollSelectorImpl.java:78)
at java.base/sun.nio.ch.WEPollSelectorProvider.openSelector(WEPollSelectorProvider.java:33)
at java.base/java.nio.channels.Selector.open(Selector.java:295)
Caused by: java.net.SocketException: Invalid argument: connect
at java.base/sun.nio.ch.UnixDomainSockets.connect0(Native Method)
at java.base/sun.nio.ch.UnixDomainSockets.connect(UnixDomainSockets.java:126)
at java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:947)
at java.base/java.nio.channels.SocketChannel.open(SocketChannel.java:281)
at java.base/sun.nio.ch.PipeImpl$Initializer$LoopbackConnector.run(PipeImpl.java:123)
This is not specific to Gradle. The minimal Java reproducer in the reproduction section fails with the same exception when launched by Codex.
The same Gradle command and repository worked on August 25, before installing Codex App 26.820.60940. Restarting Windows did not resolve the problem.
The failure also occurs after approving elevated/out-of-sandbox execution for the command. Basic commands and java -version still run successfully.
What steps can reproduce the bug?
- Use Codex App 26.820.60940 on Windows.
- Start a local Windows task using PowerShell.
- Ask Codex to run the following command and approve execution if prompted:
@(
'import java.nio.channels.Selector;'
'Selector.open();'
'/exit'
) | jshell --execution local
- Observe that Selector.open() fails with:
java.io.IOException: Unable to establish loopback connection
Caused by: java.net.SocketException: Invalid argument: connect
- As a real-world reproduction, run a Gradle build:
.\gradlew.bat compileJava
- Observe that Gradle fails while connecting to its daemon, before compilation begins.
Environment:
- Java: Amazon Corretto OpenJDK 26.0.2
- Gradle wrapper: 9.7.1
- Codex sandbox mode: workspace-write
- Restarting Windows does not resolve the failure
- Session/feedback ID: not available
What is the expected behavior?
Java processes launched by Codex should be able to initialize a local NIO selector.
Selector.open() should return a selector without throwing an exception, and Gradle should be able to connect to its local daemon and proceed with compilation, as it did before the Codex App update.
Additional information
Direct java -version execution succeeds:
openjdk version "26.0.2" 2026-07-21
OpenJDK Runtime Environment Corretto-26.0.2.10.1
OpenJDK 64-Bit Server VM Corretto-26.0.2.10.1
A direct Pipe.open() call succeeds, but Selector.open() fails when WEPollSelectorImpl creates its internal loopback pipe. This narrows the problem to Java's Windows selector initialization rather than Java process startup or Gradle itself.
This may be a regression in the Windows command-runner or sandbox environment introduced by 26.820.60940, possibly affecting the Unix-domain socket used internally by Java's Windows WEPoll selector.
I searched the existing issue tracker. Issue #24726 contains the same Java exception in an IntelliJ-launching scenario, but no existing issue describes this Java/Gradle regression in version 26.820.60940.
Potentially related same-release Windows execution regression: #40817.
Host PowerShell control test
Running the identical JShell reproducer in an ordinary PowerShell window outside Codex succeeds:
@(
'import java.nio.channels.Selector;'
'Selector.open();'
'/exit'
) | jshell --execution local
Output:
$2 ==> sun.nio.ch.WEPollSelectorImpl@2a4fb17b
Inside Codex 26.820.60940, the same command fails with "Unable to establish loopback connection", even after approving elevated/out-of-sandbox execution. This isolates the regression to the Codex Windows command-runner environment rather than the installed JDK or Windows host.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the JShell Selector.open() reproducer and compare its behavior inside Codex with the ordinary PowerShell control test. Investigate the Windows command-runner or sandbox environment introduced in Codex App 26.820.60940, then verify that Selector.open() succeeds and .\gradlew.bat compileJava can connect to its daemon.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, powershell, rust
- Domain
- operating-systems, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100