Skip to content

Windows: pass the checks and connect Claude Code and Codex - #17

Open
anessbelbati wants to merge 20 commits into
Openpod:mainfrom
anessbelbati:fix/windows-support
Open

anessbelbati wants to merge 20 commits into
Openpod:mainfrom
anessbelbati:fix/windows-support

Conversation

@anessbelbati

Copy link
Copy Markdown

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.mjs never end (today, 2e9b99e cloned fresh: https://github.com/anessbelbati/impractical-video/actions/runs/38233055465; the same on Oct 7 and Oct 9).

Behind it:

  • The agents aren't found or started. lib/agent-connect.ts runs both CLIs through /usr/bin/env, lib/agent-binaries.ts looks for files named exactly claude or codex, and an npm install on Windows is a .cmd launcher that Node won't start without a shell.
  • The context hook doesn't reach the model. Codex runs hook commands in PowerShell, Claude Code in Git Bash (or PowerShell without Git), and the sh-quoted command exits with code 1 under PowerShell.
  • Saving or deleting a project can fail with EPERM while another process reads the file.
  • CRLF checkouts break workflow, skill and lint fixture files.
  • npm run setup writes a data root that doesn't read back as the same path, and npm run doctor doesn't see .cmd launchers.

With this branch npm run check, npm run setup and npm run build pass 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 with xdg-open (main calls open, 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-windows CI 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/38231941605

Any remaining limitations or migration steps?

  • Nobody has opened the desktop window on Windows by hand. I used the browser version once on a Windows 11 laptop, and it worked apart from the black-image fault in Fix black preview for pictures an agent places on the Editor timeline #14.
  • The browser suite isn't in the Windows job: its first test outran the 120 s limit in 4 of 7 runs on GitHub's Windows runners.
  • Claude Code older than 2.1.139 skips the hook as written on Windows (measured with 2.1.138).
  • The two "Open … in Terminal" buttons stay macOS only, as on main.
  • Two tests in tests/agent-binaries.test.ts are skipped on Windows; they rely on the POSIX execute bit.
  • A project an earlier build opened on Windows keeps its hook files: delete .claude/settings.json and .codex/hooks.json and open it again.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant