codex-fleet: Windows support via bundled PowerShell replacements for caffeinate and sips - #3
Open
morp1e wants to merge 1 commit into
Open
codex-fleet: Windows support via bundled PowerShell replacements for caffeinate and sips#3morp1e wants to merge 1 commit into
morp1e wants to merge 1 commit into
Conversation
The skill's bash body already runs on Windows through Git Bash — /tmp, ~, find -mmin, 2>/dev/null and $CODEX_HOME all resolve there. Two macOS binaries do not exist, and both sit on load-bearing paths: - `caffeinate -i` guards every fleet spawn. Without it a lid-close silently kills mid-flight lanes, which is exactly the failure the skill warns about. - `sips` is the documented downscale step after generating above the gpt-image-2 minimum size. Adds two dependency-free PowerShell replacements under scripts/ and documents them in a new "Platform notes" section. - Invoke-KeepAwake.ps1 — holds ES_CONTINUOUS | ES_SYSTEM_REQUIRED via SetThreadExecutionState for its own lifetime. Run once in the background before spawning lanes rather than wrapping each spawn: the flag is process-scoped, so a wrapper releases it the moment its command exits. Changes no persistent power setting; the block lifts when the process ends. - Resize-Image.ps1 — System.Drawing scale (sips -z) and centre-crop then scale (sips -c). Never writes to the source file. Both use only the .NET base library. No ImageMagick, no install step. This change is additive. Every macOS instruction is unchanged, the spawn recipe still leads with `caffeinate -i`, and both `sips` references keep the macOS command with the Windows option appended. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
"This broke on my setup" report, with the fix attached.
I run
codex-fleeton Windows 11 as the delegation layer for an Obsidian-based agent vault. The bash body works as written through Git Bash —/tmp,~,find -mmin,2>/dev/nulland$CODEX_HOMEall resolve. Two macOS binaries don't exist there, and both sit on load-bearing paths:caffeinate -iguards every fleet spawn. Without it a lid-close silently kills mid-flight lanes — precisely the failure the skill warns about ("~5KB of output, zero edits"). On Windows there was no guard at all.sipsis the documented downscale step after generating above thegpt-image-2minimum size. No equivalent ships with Windows, and ImageMagick isn't a safe assumption.What this adds
Two dependency-free PowerShell scripts under
skills/codex-fleet/scripts/, plus a## Platform notessection documenting the mapping.caffeinate -iscripts/Invoke-KeepAwake.ps1sips -z/sips -cscripts/Resize-Image.ps1Both use only the .NET base library —
SetThreadExecutionStateandSystem.Drawing. No install step, no ImageMagick, no persistent system setting changed.One design note worth flagging:
Invoke-KeepAwake.ps1is a background sentinel, not a wrapper. The execution-state flag is process-scoped, so acaffeinate-style wrapper would release the block the moment its wrapped command exits — useless for a fleet. It's started once before spawning lanes and holds the block for its own lifetime.This is additive — macOS is untouched
caffeinate -i.sipsreferences keep the macOS command and append the Windows option in parentheses.+211 / -3; the 3 are the twosipslines and one README line, each replaced in place with a superset.SKILL.mdfrontmatter (name,description) is byte-identical.Verification
Run on Windows 11 26H1, PowerShell 7, Git Bash.
Limit I want to be straight about: I could not confirm the block through
powercfg /requests— that needs an elevated prompt and I didn't want to run the fleet elevated. The evidence I do have is thatSetThreadExecutionStatereturns the previous state mask on success and0on failure; the script hard-exits on0and did not, so the call was accepted. If you want thepowercfgconfirmation before merging, I'm happy to run it elevated and post the output.Linux is deliberately out of scope here — I didn't test it, so I didn't claim it.
Happy to adjust naming, placement, or drop the README hunk if you'd rather keep requirements terse.