Skip to content

The Claude Code and Codex plugins work on Windows and on macOS symlinked checkouts, checked by a real session per platform in CI - #313

Merged
zlareb1 merged 19 commits into
mainfrom
ci/plugin-platforms
Nov 7, 2026
Merged

zlareb1 merged 19 commits into
mainfrom
ci/plugin-platforms

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in a release)

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

The Claude Code and Codex plugins now work on Windows (x86_64 and arm64, with or without Git Bash) and on macOS checkouts reached through a symlink; a CI workflow runs the plugin suite and a real Claude Code and Codex session on Linux, Alpine, macOS and Windows.

Why

The plugin suite ran on Linux only, and no test ever started a real agent with the plugin installed. Run on every platform, it found these:

Platform What failed Cause Fix
Codex, Windows MCP tools got no token Codex runs http_headers_helper with cmd.exe /C, which cannot run the POSIX command the command starts with node -e, which cmd.exe and sh both run; sh falls back to the launcher
Claude Code, Windows MCP tools got no token Claude Code runs a headersHelper with cmd.exe on Windows, with or without Git Bash (measured in CI) sh "<launcher>" … || node -e "…": sh runs the launcher, cmd.exe runs node
Claude Code, Windows without Git Bash every hook failed ('sh' is not recognized), a failing PreToolUse can block the tool call Claude Code runs hooks with PowerShell there each hooks.json command reads as both an sh script (it execs the launcher on line 2) and a PowerShell script (line 1 sets $x and opens a block comment that line 3 closes; then the node on PATH, unchecked for version, or one loom: line, and exit 0)
macOS, Windows code shunt, blast radius, file context, test gate and relDir treated files in the checkout as outside it a payload path and git's toplevel compared as strings: /tmp vs /private/tmp, RUNNER~1 vs the long name, C:/ vs C:\ realPath / pathUnder compare both as the file system names them; the shunt cache is keyed the same way
Windows a running session's state was swept as stale touchPrivateFile set mtime through a read-only handle, which Windows refuses open it read-write, and refuse a hard-linked file as the read and write paths do
Windows the working-memory note listed every file by its absolute path a string prefix check with / pathUnder
Windows the test gate missed a venv, and a command naming a path as C:/… or /c/… bin/python only; one spelling only Scripts\python.exe; all three spellings
Windows a cd C:/Users/RUNNER~1/… stopped the Bash read parser any ~ ended it; only /… counted as absolute ~ only at the word start, drive paths and Git Bash's /c/ form are absolute; double-quoted backslashes kept as sh keeps them
Windows a console window per child process when the host has none no windowsHide set on every spawn
WSL 2 the grep shim's early-closing-reader test got grep: write error: Connection reset by peer a child's pipe stdio is a socket pair, where a reader that closed with data unread can show the writer ECONNRESET instead of EPIPE the shim ends quietly on ECONNRESET as on EPIPE; the | head test reads a real FIFO
macOS Intel one 80 KB eyJ-eyJ-… tool output took 203 ms of CPU to redact JWT_RE retried its 512-character header scan from every eyJ in a long run redactJwts scans each run once and replaces exactly what JWT_RE matches (fuzz-tested against it)
symlinked checkouts the test gate missed a command naming a file through the session's symlinked path only git's real-path spelling was matched the cwd's spelling of the root is matched too
grep shim an operand reached through a symlink or an 8.3 name got no annotation; Windows sent src\a.c the same string comparison with git's toplevel the shim resolves both sides and sends / paths
Windows (main, found by this matrix) the temp-home import check failed on a CRLF checkout it split lines on \n split on \r?\n
Windows clones sh scripts broken by CRLF Git for Windows converts to CRLF by default and a marketplace install is a clone .gitattributes keeps *.sh, bin/loom-node, the grep shim and skills LF; the shipped scripts also change by one comment line, so a clone that already holds CRLF copies gets LF on its next pull

The rest were test assumptions that do not hold off Linux (HOME/TMPDIR without USERPROFILE/TEMP/SystemRoot, mode-bit asserts on NTFS, / literals, /usr/bin/mktemp, ESM imports of D:\ paths) and four timing tests that measured the runner under load: the redaction check now compares equal bytes at 10 KB and 80 KB in CPU time (linearity), run until both sides span many ticks of Windows' coarse CPU clock, and holds one first 80 KB run to 200 ms; the shunt accounting holds one run to 50 ms (each single cold run takes the lesser of wall and process CPU time, since process CPU also counts V8's compiler threads); the hanging-server contract sets the shunt's own lookup bound to its 1000 ms floor, and its payloads without a cwd run in the temp directory rather than the suite's own large checkout; the Stop-gate and edit-hook hanging-server tests time from the hook's request to its exit (request bound plus exit grace, under 1.5 s) and are run again only when a run spent git's 1.5 s timeout without asking (a loaded runner), with a 7 s backstop on the whole run (about twice the slowest seen, macOS Intel under load; a wall-clock bound on the part before the request would measure the runner, which is what failed there); the SessionEnd budget test's fake begin answers in 200 ms instead of 350 ms, inside its 400 ms cap.

Scope and risk

Hooks run in the user's session. The PowerShell branch of a hook command exits 0 always, so a missing Node cannot block a tool call; every hook script already exits 0. On macOS and Linux each hook still execs bin/loom-node as before; the new first line only sets $1. The Claude Code header helper still tries the launcher first, so LOOM_NODE keeps its precedence; a LOOM_NODE that is not Node 18+ fails the hooks as before, and the helper then tries the node on PATH. In pass-through mode (no token) the grep shim hands its stdout to native grep, which reports a socket reader's early close itself, as it does without the shim. The project name is taken from the toplevel as git prints it, so no project changes namespace. Out of scope, noted for a follow-up: Claude Code runs a plugin's headersHelper from the plugin root, so the X-Loom-Code-Scope the helper derives from its working directory does not name the project's checkout: #337. Known and left: the loom-status skill runs its checks with sh, so on Windows without Git Bash it cannot run them; changing a shipped skill needs a paid claude plugin eval run, so the claude-code page gives that case's command instead (node <plugin root>/bin/loom-client-status.mjs). The one line this PR adds to the skill's ensure-node.sh is a comment that forces an LF rewrite; it changes no prompt text, so no eval run is needed for it. Under cmd.exe with Git's sh on PATH, the Claude Code helper's sh half fails on the unexpanded $CLAUDE_PLUGIN_ROOT and may leave one line on stderr before node -e answers; the token still arrives (the Windows e2e asserts it).

Compatibility, rollout and rollback

  • Wire: none.
  • Operator steps: none. Users update the plugin (1.2.15).
  • Rollback: revert; the shunt cache re-keys itself (it is a cache).

Tests

.github/workflows/plugin-platforms.yml (on changes under integrations/) runs the plugin and grep-shim suites, then tests/e2e/agent-session.mjs for each agent: claude plugin install / codex plugin add from the checkout into a scratch home, then one headless turn (claude -p, codex exec) against a local fake that answers the model API and Loom, so no provider is called. The work directory is a git checkout in the platform's temp directory (/private/var on macOS, an 8.3 path on Windows), so the hooks resolve a checkout root there, and the e2e asserts they looked up its remote (example/e2e); the no-Git-Bash step has no git, so it runs outside a checkout, and its PowerShell tool matches no PreToolUse hook (the unit tests run the PowerShell form itself). For both agents it asserts the MCP header helper sent the token and each event's own Loom call arrived with it (SessionStart: the startup context.pack; UserPromptSubmit: run.begin; PostToolUse: observe.record; Stop: conversation.append for Codex, cost.record_turns for Claude Code, whose conversation hook also runs at SessionEnd). For Claude Code, which reports its hook results, it also asserts every hook that ran exited 0 with nothing on stderr, that SessionStart's primer reached it, and the turn's shell tool (--expect-tool: Bash, or PowerShell in the no-Git-Bash step, which proves that step took the PowerShell path). With --node-off-path it asserts the hooks ran the Node it placed only under nvm.

Matrix: ubuntu-latest, ubuntu-24.04-arm, Alpine (musl, BusyBox sh), WSL 2 (Ubuntu 24.04, Node 18), macos-latest (arm64), macos-15-intel, windows-latest, windows-11-arm; on the Ubuntu and macOS runners also with node off the agent's PATH (GUI launch), on Windows also without Git Bash. Run at the final head: https://github.com/ClickHouse/loom/actions/runs/42383647107. Locally: Debian dash and Alpine containers on arm64.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated (an agent wrote most of the diff): Claude Code. Every platform claim is from a CI job or container run on that platform.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • Plugin suite, grep shim suite and the Python tests that read the plugin files pass.
  • The Codex plugin copies are regenerated (agent_plugin_sync.py).
  • Both plugin manifests are at 1.2.15, which no other open PR uses.
  • Docs under docs/ describe the platforms and the Windows Node rule.
  • Commits are signed off.

🤖 Generated with Claude Code

@zlareb1 zlareb1 changed the title The plugins' suite and a real agent session run on every OS and architecture in CI The Claude Code and Codex plugins work on Windows and on macOS symlinked checkouts, checked by a real session per platform in CI Nov 6, 2026
@zlareb1
zlareb1 force-pushed the ci/plugin-platforms branch 4 times, most recently from 9c0c29c to 0c8206c Compare November 7, 2026 14:11
zlareb1 and others added 17 commits November 7, 2026 14:24
…ked checkouts, checked by a real session per platform in CI

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… ..name test; the helper's LOOM_NODE fallback is tested

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…e line shows; PowerShell calls are captured as command runs

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…gain; the Windows pipe test names the exit code it covers

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…d; the contract runs payloads without a cwd in the sandbox

The malformed-payload contract cases have no cwd, so SessionStart worked in
the suite's own checkout, whose git calls took a loaded Windows arm64 runner
past the 8 s bound. They now run in the sandbox home.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…a Windows flusher cannot hold open for removal

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… git's timeout

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…'s launcher fallback after a PATH node that cannot run it is tested

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…pattern; the test gate reads PowerShell commands

- JWT_RE is built from the header and payload limits redactJwts checks, and
  the equality test uses the exported pattern.
- sessionScope reads the paths a PowerShell command names, as for Bash.
- gitBashPath sits above parseBashBulkSegments' doc comment; the e2e says
  what an exit 0 means under PowerShell.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… page's helper override equal to the shipped one

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ath, as it does a cd target

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… case-insensitively

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… the columns reflowed

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
@zlareb1
zlareb1 force-pushed the ci/plugin-platforms branch from 16f5d99 to 475fb07 Compare November 7, 2026 14:30
zlareb1 and others added 2 commits November 7, 2026 14:38
…launcher: no node on PATH, one older than 18, or no installed copy

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…U time, since process CPU counts V8's compiler threads

A WSL run measured 50.3 ms of process CPU in a run whose wall time was
33.6 ms. The main thread's time is at most both clocks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
@zlareb1
zlareb1 marked this pull request as ready for review November 7, 2026 15:21
@zlareb1
zlareb1 merged commit 28a61f7 into main Nov 7, 2026
40 checks passed
@zlareb1
zlareb1 deleted the ci/plugin-platforms branch November 7, 2026 15:21
@zlareb1 zlareb1 mentioned this pull request Nov 12, 2026
3 tasks done
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