Repository navigation
Fix #1921: CI Health Check cron no longer sends a false 'CI failing' alert on Windows - #1929
Merged
Merged
Conversation
…ition requires exitCode == 0 The jq expression was single-quoted, which cmd.exe (Tower's exec shell on Windows) does not treat as quoting, so its | became a pipe and the command failed. The condition ignored exitCode, so the error text was reported as the failing workflows. Double-quote with \" (parses the same in cmd.exe and sh) and gate on exitCode == 0. Same fix in the skeleton example; cron docs note both.
… shell and never alert on a failed run
…n docs, platform-independent single-quote guard in the test
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.
Summary
On native Windows the
CI Health Checkcron task alerted "currently failing on main: 'map' is not recognized…" every 30 minutes while CI was green. This fixes the command's quoting so it parses under cmd.exe as well as a POSIX shell, and makes the condition require a clean run so a broken check never reads as a CI failure.Fixes #1921
Root Cause
child_process.exec, which iscmd.exe /d /s /con Windows. cmd.exe does not treat single quotes as quotes, so the|inside--jq '…'piped into a program namedmap. The command exited 255, andrunCommandreturned its stderr as the output.output != ''. Conditions are evaluated on failed runs too (by design:exitCodeis data), so the error text was delivered as the list of failing workflows. This half affects every platform: gh missing, unauthenticated or offline all read as "CI failing".Reproduced on this machine by running the task's command through
exec: exit 255, stderr'map' is not recognized as an internal or external command.Fix
.af-cron/ci-health.yaml: the jq expression is double-quoted, with\"for its inner strings. cmd.exe keeps the|quoted and gh (Go's argv parser) reads\"as a literal quote. A POSIX shell does the same inside double quotes. I checked the output is identical under cmd.exe and bash. I chose this over a helper script so the task stays a one-liner adopters can copy. The condition is nowexitCode == 0 && output != ''. I also removed a stale "checks every minute (for testing)" comment.codev-skeleton/.af-cron/ci-health.yaml.examplehad both faults (output != '0'alerted on any error text) and gets the same fix:exitCode == 0 && output != '0'.SKILL.md×4:.claude/.codex, ours and skeleton;agent-farm.md×2) get one paragraph. It says commands run through cmd.exe on Windows, so use double quotes, and that output-inspecting conditions should also requireexitCode == 0.shipped-skill-hashes.tsis regenerated, because the afx skill content changed.team-update.yamlwas already correct: no quoting, and it already gates onexitCode == 0.Test Plan
packages/codev/src/agent-farm/__tests__/cron-shipped-tasks.test.ts. It loads both shipped task files throughloadWorkspaceTasksand runs each command through the real platform shell (exec), withghswapped for a stub that echoes the--jqargument. It asserts the expression arrives intact and that each condition is false for a failed run (exit 255 / 127 with error text) and true for a real failure. Without the fix all 4 cases fail on Windows, the first with the exact'map' is not recognizederror. With the fix they pass.packages/codevsuite passes on native Windows (porch check, run alone; Tower PID unchanged before/after)Review feedback (CMAP)
gemini skipped (agy not installed on this machine), codex APPROVE, claude APPROVE. Applied from the claude review:
"as a quote toggle, so text between an escaped\"…\"pair is unquoted to it. The cron paragraph now says to keep| & < > ^out of inner strings and use a script for anything that needs them.Deferred, not in this PR:
tower-cron.tsruns commands with rawchild_process.exec(cmd.exe on Windows). Every other shell-string call site goes throughcommandLaunch(), which uses Git Bash on Windows (Spec 1658). So an adopter's own POSIX-quoted cron command still fails on Windows; with theexitCode == 0guidance it now fails as a WARN in the log, not a false alert. Routing cron throughcommandLaunchneeds an exit-code-returning variant ofexecShellString, which is a cross-platform API change. Follow-up: #1930.