-
Notifications
You must be signed in to change notification settings - Fork 308
Description
🏥 CI Failure Investigation - Run #21812475080
Summary
The js job fails immediately after the new actions/setup/js/handle_noop_message.cjs script was introduced because the Vitest suite is now hitting the real loadAgentOutput helper without any GH_AW_AGENT_OUTPUT env var or stubbed data, so it short-circuits before posting the expected no-op comment.
Failure Details
- Run: 21812475080
- Commit:
84109fa0e5fa2a6c2d4dff00b276ab80e2f345b7 - Trigger: push
Root Cause Analysis
handle_noop_message.cjs now requires load_agent_output.cjs inside main and immediately reads GH_AW_AGENT_OUTPUT to assert that only noop outputs were produced. In the test run, the environment variable is unset and the mock is never exercised, so the real helper logs "No GH_AW_AGENT_OUTPUT environment variable found" and returns { success: false }, which makes the rest of the test path (asserting core.info calls and GitHub REST calls) unreachable.
Failed Jobs and Errors
js–cd actions/setup/js && npm testactions/setup/js/handle_noop_message.test.cjsthrew multipleAssertionErrors andTypeErrors (see lines 109, 154, 214, 247, 274, 298, 323) because the expectedcore.infomessages/GitHub calls against the agent runs issue never ran.- Key log excerpt:
No GH_AW_AGENT_OUTPUT environment variable foundfollowed byNo agent output found, skipping, proving the real loader ran and aborted before the assertions.
Investigation Findings
- The new script performs environment-dependent loading before any mocks or stubs are exercised, so Vitest now hits the real loader when
GH_AW_AGENT_OUTPUTis absent. - Every failing assertion in
handle_noop_message.test.cjsis downstream of that early return, which is why we also see emptyvi.fn()call counts andTypeError: Cannot read properties of undefined (reading '0')at the GitHub comment assertions. - Running
cd actions/setup/js && npm test -- handle_noop_message.test.cjswithout settingGH_AW_AGENT_OUTPUTreproduces the failure locally (the loader logs the same missing environment message and exits early).
Recommended Actions
- Update the test setup so that
GH_AW_AGENT_OUTPUTpoints to a temporary file (or the loader is mocked) before importinghandle_noop_message.cjs, ensuringloadAgentOutputreturns a noop-only items array. - If direct mocking is preferred, allow
handle_noop_messageto accept an injectable output loader or test-specific override so the real file reader is never executed in unit tests.
Prevention Strategies
Document and enforce that any new JS workflow helpers that read GH_AW_AGENT_OUTPUT must have a deterministic way to supply that file during tests (either via fixture files or injected mocks) before requiring the module.
AI Team Self-Improvement
When adding JS helpers that consume GH_AW_AGENT_OUTPUT, always stub loadAgentOutput or supply a known JSON file before importing the helper; otherwise, Vitest will fall through to the real loader and fail with "No GH_AW_AGENT_OUTPUT environment variable found" and a cascade of assertion exceptions.
Historical Context
We checked the existing [CI Failure Doctor] issues with the cookie label and they are all closed (#14550, #14392, etc.). None mention handle_noop_message or this new JS path, so this is a fresh investigation.
AI generated by CI Failure Doctor
To add this workflow in your repository, run
gh aw add githubnext/agentics/workflows/ci-doctor.md@ea350161ad5dcc9624cf510f134c6a9e39a6f94d. See usage guide.
- expires on Feb 10, 2026, 4:45 AM UTC