Repository navigation
Windows: pass the checks and connect Claude Code and Codex - #17
Open
anessbelbati wants to merge 20 commits into
Open
anessbelbati wants to merge 20 commits into
anessbelbati wants to merge 20 commits into
Conversation
Setup wrote the same JSON to .claude/settings.json and .codex/hooks.json,
including enableAllProjectMcpServers and enabledMcpjsonServers. Codex accepts
only "description" and "hooks" at the top of a hooks file, and with any other
key it loads no hooks from the file at all:
failed to parse hooks config .../.codex/hooks.json: unknown field
`enableAllProjectMcpServers`, expected `description` or `hooks` at
line 2 column 30
So the context hook never ran under Codex, and every prompt went out without
the Video FS context. Measured with Codex 0.160.1 against a stand-in model
server, on macOS and on Linux: 0 hooks loaded from the file as written and
no context in the model request; with the two keys gone, 1 hook loaded, it
ran, and the context was in the request.
The two keys now go into Claude's file only. Setup also removes them from a
.codex/hooks.json that is the desktop's own earlier output, under the same
ownership test enableProjectMcpServers already uses, so an existing project
recovers the next time it is opened. A file the user wrote is left alone.
On Windows no single spelling of a command line runs under both agents.
Codex hands a hook command to PowerShell: PowerShell 7, or Windows
PowerShell when 7 is not installed. Claude Code hands it to Git Bash, or to
PowerShell when Git is not installed. The sh-quoted command the desktop
writes on macOS and Linux fails under PowerShell ("hook exited with code
1"), and a command written for PowerShell is a syntax error under Git Bash,
which blocks the prompt.
Codex now gets the command written for PowerShell, with the call operator
in front of the quoted program. Claude Code gets the program and its
arguments as a list (2.1.139 and later), which it starts directly, with no
shell, so one file works with and without Git Bash. An earlier Claude Code
release skips a hook written that way and sends the prompt without the
context.
The onboarding status check reads a hook that lists its arguments. The
Codex compatibility test runs the installed command through the shell Codex
uses on each platform instead of starting Electron itself.
Measured on windows-latest with Codex 0.160.1 and Claude Code 2.1.292
against stand-in model servers: the hook ran and its context was in the
model request under Codex with PowerShell 7 and with Windows PowerShell
5.1, and under Claude Code with Git Bash present and with Git hidden.
What is written on macOS and Linux does not change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this fix, and what changes for the user?
On Windows the checks fail and neither agent can be connected. On a Windows runner main fails 10 of its 459 unit tests, and in the desktop tests 10 fail and the 6 in
agent-context-hook.test.mjsnever end (today, 2e9b99e cloned fresh: https://github.com/anessbelbati/impractical-video/actions/runs/38233055465; the same on Oct 7 and Oct 9).Behind it:
lib/agent-connect.tsruns both CLIs through/usr/bin/env,lib/agent-binaries.tslooks for files named exactlyclaudeorcodex, and an npm install on Windows is a.cmdlauncher that Node won't start without a shell.EPERMwhile another process reads the file.npm run setupwrites a data root that doesn't read back as the same path, andnpm run doctordoesn't see.cmdlaunchers.With this branch
npm run check,npm run setupandnpm run buildpass on Windows, and both agents get the Video FS context and tools. macOS and Linux write what they wrote before, except that Linux opens the sign-in page withxdg-open(main callsopen, which only macOS has).It's 19 commits with one concern each, so it reads commit by commit. The first is the Codex hooks fix from #15 and drops out once that's merged. Happy to split it up if you'd prefer.
How was it tested?
On Oct 9, merged with 8c38964: 462 unit tests pass on Windows (2 skipped), Linux and macOS, and 53 desktop tests on all three. On a Windows runner the real Codex (with PowerShell 7, and with Windows PowerShell 5.1 only) and Claude Code (with and without Git Bash) all ran the hook with its context in the model request and offered the video-fs tools. Run: https://github.com/anessbelbati/impractical-video/actions/runs/37915846873
The branch adds a
verify-windowsCI job (check, setup, build). Today, merged with 2e9b99e, CI passes on both jobs; on Windows 471 unit tests pass (2 skipped) and 53 of 53 desktop tests: https://github.com/anessbelbati/impractical-video/actions/runs/38231941605Any remaining limitations or migration steps?
tests/agent-binaries.test.tsare skipped on Windows; they rely on the POSIX execute bit..claude/settings.jsonand.codex/hooks.jsonand open it again.