Skip to content

[aw-failures] [aw-fix] Module-load SyntaxError in parse_mcp_gateway_log.cjs — PR #43170 added await inside non-async writeStep [Content truncated due to length] #43200

Description

@github-actions

Fix PR #43170 now — it hard-reds every agentic workflow at module load.

Recommendation: Revert or correct the await added to parse_mcp_gateway_log.cjs in PR #43170; it sits inside a non-async function and throws SyntaxError before any workflow logic runs. This is the single dominant P0 across the last 6h.

Executive summary

PR #43170 (feat(eslint): add require-await-core-summary-write rule, copilot-swe-agent, OPEN/blocked, not merged) added await coreObj.summary.write(); at actions/setup/js/parse_mcp_gateway_log.cjs:236 — a call site inside the non-async helper writeStepSummaryWithTokenUsage(coreObj) (declared at line 204). Top-level-style await in a non-async function is a hard SyntaxError at require() time, so the module fails to load. Every workflow's "Parse MCP Gateway logs for step summary" step and the conclusion job's "Handle agent failure" step require this module, so both crash — across both claude and copilot engines. Main branch is unaffected (0 compiled lock files carry the bad await); the blast radius is confined to PR #43170's merge ref.

Failure clusters

Cluster Sev Signature Workflows (run IDs) Tracking
A P0 SyntaxError: await is only valid in async functions @ parse_mcp_gateway_log.cjs:236 (non-async writeStepSummaryWithTokenUsage) Design Decision Gate (§28661680853), Test Quality Sentinel (§28661680942), Impeccable Skills Reviewer (§28661680859), PR Code Quality Reviewer (§28661680929) NONE → this issue
B P1 EACCES: permission denied, mkdir '/tmp/gh-aw/sandbox/firewall/logs' Smoke CI (§28661781846) Already tracked by #42398
Evidence — Cluster A crash trace (representative run 28661680853)
/home/runner/work/_temp/gh-aw/actions/parse_mcp_gateway_log.cjs:236
  await coreObj.summary.write();
  ^^^^^
SyntaxError: await is only valid in async functions and the top level bodies of modules
    at wrapSafe (node:internal/modules/cjs/loader:1787:18)
    at Module._compile ...
    at Object.<anonymous> (/home/runner/work/_temp/gh-aw/actions/handle_agent_failure.cjs:18:61)
  • Same trace reproduced in all 4 runs above, in both the agent job (Parse MCP Gateway logs) and the conclusion job (Handle agent failure, which requires the module at line 18).
  • Committed main source: writeStepSummaryWithTokenUsage (line 204) is not async; line 236 is coreObj.summary.write(); without await. async function main() is a separate function (line 814). PR feat(eslint): add require-await-core-summary-write rule #43170 added the await to the non-async helper.
  • Irony: PR feat(eslint): add require-await-core-summary-write rule #43170's own description states its ESLint autofix is "only offered when inside an async function (applying it outside would produce a syntax error)." The manual "existing violations fixed" edit bypassed that guard and did exactly that.

Existing-issue correlation

Fix roadmap

Sub-issues created

  • Concrete fix task linked below.
Unclustered failed run IDs (payload lacked detailed logs)

28661680861, 28661669474, 28658894614, 28655406842, 28655368469, 28652123698, 28649777787, 28649473366 — timing overlaps PR #43170's run batch; likely same Cluster A signature but not individually verified in this pass.

References:

Generated by 🔍 [aw] Failure Investigator (6h) · 155.9 AIC · ⌖ 40.9 AIC · ⊞ 5.2K ·

  • expires on Jul 10, 2026, 5:31 AM UTC-08:00

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions