Codex PR integration fails in WSL with gh: Expected VAR_SIGN, actual: COLON
What version of the Codex App are you using (From “About Codex” dialog)?
26.707.31428
What subscription do you have?
Free
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
When using the ChatGPT Desktop app (latest version) with the agent execution location set to WSL, the Pull Request integration consistently fails with the following error:
gh: Expected VAR_SIGN, actual: COLON (":") at [2, 9]
The error occurs only when Codex attempts to access Pull Request information. Other GitHub operations work normally.
Feedback ID:
no-active-thread-019f4f19-15c6-7051-bcde-62fb78cfee7c
<img width="778" height="586" alt="Image" src="https://github.com/user-attachments/assets/fb33bd25-8793-45de-8084-a34cacb56414" />
What steps can reproduce the bug?
Environment:
- Windows 11
- ChatGPT Desktop (latest version)
- Agent execution location: WSL
- WSL2 Ubuntu
- Repository located inside WSL
- GitHub.com
- GitHub CLI 2.96.0 (
/usr/bin/gh) - Windows does not have
ghinstalled
Steps:
- Configure the agent execution location to WSL.
- Open a Git repository located inside WSL.
- Use the Pull Request integration (or ask Codex to access PR information).
- The operation immediately fails with:
gh: Expected VAR_SIGN, actual: COLON (":") at [2, 9]
Verification performed:
The same WSL environment works correctly with GitHub CLI.
gh version
returns
gh version 2.96.0
Authentication is valid:
gh auth status
Repository operations succeed:
gh repo view
GraphQL also works correctly, including variable definitions:
gh api graphql -f query='query { viewer { login } }'
and
gh api graphql \
-f query='query($login:String!){ user(login:$login){ login } }' \
-F login=<username>
Both commands execute successfully.
Changing the agent execution location to Windows produces a different error (gh not found), confirming that the WSL configuration is actually using the WSL installation of gh.
What is the expected behavior?
The Pull Request integration should successfully retrieve Pull Request information using the WSL installation of GitHub CLI, just as manual gh api graphql commands do.
No GraphQL parsing error should occur.
Additional information
The problem appears to be specific to the PR integration.
Since:
ghis functioning correctly,- authentication is valid,
- GraphQL queries (including variable definitions) execute successfully when run manually,
- repository operations succeed,
the issue appears to be within the Desktop application's PR integration rather than GitHub CLI or the GitHub API.
The error message:
Expected VAR_SIGN, actual: COLON
suggests that the GraphQL query passed to gh api graphql is malformed before execution (for example, a variable declaration such as $owner may be lost before reaching gh). This is only a hypothesis based on the parser error—the exact internal command executed by the application is not visible to the user.
16 Comments
Same problem. Feedback ID:
no-active-thread-019f5c77-1208-7c20-ac00-430264da0fd4Same
<img width="922" height="608" alt="Image" src="https://github.com/user-attachments/assets/21ebf451-5b0f-414f-a70d-d24c8e59a5c0" />
Independent reproduction on the Windows Codex app:
26.707.9981.0gh 2.46.0I inspected the installed app bundle. The
gh-pr-searchimplementation contains a syntactically valid multiline GraphQL declaration beginning with:It passes that query to
gh api graphqlas an argument. The reported location is significant: if the three$...variable names are removed during shell expansion, line 2 begins as:The first colon is then exactly at line 2, column 9, matching the error. Desktop logs also show the request source as
pull_requests_page/gh-pr-searchand the processes being spawned inside WSL.This adds evidence that the WSL process bridge is not preserving literal
$characters in the multiline GraphQL argument. No repository contents or credentials were included in this report.Same problem here
I'm facing the same issue and wanted to provide additional independent reproduction with current versions:
Environment
26.715.4045.06.6.87.2-microsoft-standard-WSL224.04.4 LTSgh 2.96.0 (2026-07-02)Observed behavior
The app-wide Pull Requests tab fails with:
Control checks
Authentication succeeds with
gh auth status. I also ran the following manually in the same WSL environment:GitHub authentication, global PR search, repository-scoped PR listing, and GraphQL variables therefore work when invoked directly. This also reproduces on
gh 2.96.0, so updating the CLI does not resolve the app integration failure.The exact parser position remains consistent with the app’s multiline query losing its variable names before it reaches GitHub—for example,
query($searchQuery: String!, ...)becomingquery(: String!, ...).It may help to capture the arguments/query immediately before the WSL spawn and again at the
ghprocess boundary, and to pass the query without an interpolating shell—or via standard input—so literal$characters are preserved.Same issue here
O mesmo acontece.
Same issue here
Same issue here
Same issue here
same issue here
same issue here
Reproduced on the Windows Codex Desktop app with WSL2.
Both environments are authenticated and working independently:
ghresolves toC:\Program Files\GitHub CLI\gh.exe.gh api user --jq .loginreturnssalty919.gh auth statusis valid and manual GraphQL requests succeed.Despite that, Codex's Pull Request integration still fails with:
gh: Expected VAR_SIGN, actual: COLON (":") at [2, 9]This is not an authentication or user-setup problem. I was repeatedly directed through OAuth, keyring, and Windows/WSL setup even though authentication was already valid, and the integration remained broken.
For a paid OpenAI service, this is unacceptable. The current experience feels amateurish and the troubleshooting flow wastes the user's time by treating a product defect as an authentication problem. Please fix the Windows/WSL Pull Request integration, clearly acknowledge the product bug, and provide a concrete workaround or status update instead of sending users through repeated re-authentication.
@salty919 Who was directing you through repeated re-authentication? What troubleshooting flow?
Everybody here who took the time to analyse the problem further already came to conclusion its a relatively simple parsing bug that leads to this syntax error. Something the error itself already hints at, of course.
Same issue here.
I reproduced this against Codex Desktop
26.803.5235.0on Windows 11 + WSL2 (Ubuntu-26.04) and isolated the exact argument-boundary failure.The installed Desktop bundle builds WSL process arguments in this shape:
The PR search query in the same bundle starts with:
I replayed the exact boundary with Windows Node
child_process.spawnSync, rather than invokingghfrom an interactive WSL shell:wsl.exe ... -- ..., a direct Python argv probe receivesquery(: String!)from an input argument ofquery($searchQuery: String!).bash -lccommand does not prevent the loss at this outer WSL boundary.--to--exec, Python receives the literal$searchQueryunchanged.gh api graphqlreplay using the app's multiline query fails withExpected VAR_SIGN, actual: COLON (\":\") at [2, 9]under--, and succeeds with valid JSON under--exec.So this is not a
ghauthentication, GitHub API, repository, or GraphQL construction problem. The GraphQL argument is mutated while Codex Desktop forwards the command throughwsl.exe.The minimal fix for this failure is:
in the Windows-to-WSL argument builder. Both direct command execution and the existing nested
/usr/bin/bash -lc <command>form preserve the GraphQL variables with--exec.The same WSL argument builder also defaults a missing cwd to
.; that is the separateGit is unavailablefailure tracked in #35119. Fixing both--execforwarding and the invalid relative--cd .fallback would address the two regressions at their shared boundary.