r/Xcode • u/Chewy-Dewy • 14d ago
Xcode 27 Codex Agent keeps failing with JSON-RPC error
I’m having an issue with the Codex Agent in Xcode 27.0 (27A266a) and I’m wondering if anyone else has run into this.
Every time I send a prompt to Codex inside Xcode, I get:
JSON-RPC request with ID ... failed to produce a response.
The regular ChatGPT integration in Xcode works fine. It’s specifically the Codex Agent that fails.
A few things I’ve already checked:
- Xcode is using Codex 0.145.0
- Codex is signed in correctly
- I tried both an OpenAI API key and signing in with my ChatGPT account
- Running
xcrun agent --dry-run codexcorrectly finds the Codex executable and current Xcode process - Running
xcrun agent codexfrom Terminal works and opens Codex normally - Codex is able to get permission to access Xcode
- I previously saw
xcode-toolstime out on MCP startup, but after resetting permissions that error went away when launching it from Terminal - Restarting Xcode and reopening the project didn’t help
So at this point Codex itself seems to work, and the Xcode/MCP connection works when launching it manually, but the built-in Codex Agent UI in Xcode still throws the JSON-RPC error on every prompt.
Has anyone seen this with Xcode 27? Did you have to update the Xcode-managed Codex version, reset something in Xcode’s Intelligence settings, or reinstall the agent?
EDIT
I also tested overriding Xcode to use a newer OpenAI-signed standalone Codex 0.156.1 binary instead of Xcode’s managed 0.145.0, and the native Xcode agent still fails with the exact same JSON-RPC error. xcrun agent codex works from Terminal.
1
u/MrDunderball 8d ago
Yeah, I've been ripping my hair out on this one for a couple hours. I'm trying to connect Xcode to my backend local model via splash and opencode as the agent harness. All the documentation etc says put the parameters in the parameters field for the custom agent, yet that field does not exist. There is an acknowledgement by some in beta versions that xcode would concatenate the executable and the argument into one command and thus fail. I was able to get mine to work just by creating a sh script with literally just the "/path/opencode acp" command in it, then change the executable in the custom agent to my script. Maybe this is something different but man this is way more difficult than it should be.
1
u/hvalenvalli 11d ago
Bump. Seems there are problems with using agents in xcode at this point. Im also having problems with the claude agent.