Skip to content

Fix test-quarantine activation crash from oversized part1_data env var - #67338

Merged
wtgodbe merged 1 commit into
dotnet:mainfrom
wtgodbe:wtgodbe/fix-quarantine-env-size
Jun 21, 2026
Merged

wtgodbe merged 1 commit into
dotnet:mainfrom
wtgodbe:wtgodbe/fix-quarantine-env-size

Conversation

@wtgodbe

@wtgodbe wtgodbe commented Jun 21, 2026

Copy link
Copy Markdown
Member

Problem

The daily test-quarantine workflow's activation job has been failing (e.g. run 27902364302) at the Create prompt with built-in context step with:

An error occurred trying to start process '/usr/bin/bash' with working directory '...'. Argument list too long

Root cause

The pre_activation step assembles ~225 KB of CI failure data (part1_data) and exposes it as a single job output. gh-aw turns the prompt's ${{ needs.pre_activation.outputs.part1_data }} reference into a single environment variable declared on the three prompt-building steps. Linux caps one env-var string at MAX_ARG_STRLEN (32 * PAGE_SIZE = 131072 bytes) during execve — so a >128 KiB value makes the step's bash fail to start, even though the step never actually uses the variable.

This was latent until #67322 fixed token scrubbing. Before that, GitHub's secret detector was skipping the entire part1_data output (Skip output 'part1_data' since it may contain secret), so the env var resolved empty and never approached the limit. With scrubbing fixed, the data now flows at full size and trips MAX_ARG_STRLEN.

Fix

Split part1_data into 16 fixed, byte-bounded chunks (≤ 80000 bytes each, well under 131072), one per pre_activation output (part1_data_0..15). The prompt concatenates the 16 placeholders adjacently so gh-aw's exact-string (split().join()) substitution reconstructs the JSON verbatim. Key properties:

  • No single env var exceeds the per-string limit, and empty slots cost nothing, so total environment size is unchanged (~225 KB, same as before — total ARG_MAX was never the issue).
  • Chunks split on UTF-8 character boundaries; a loud FATAL guards overflow rather than emitting truncated JSON (unreachable in practice — json.dumps emits ASCII, so 16×80 KB comfortably covers the existing SAFE_OUTPUT cap).
  • Keeps Scrub leaked tokens from test-quarantine Part 1 output #67322's scrubbing intact.

Only .github/workflows/test-quarantine.md was hand-edited; test-quarantine.lock.yml was regenerated with gh aw v0.79.8.

Validation

  • gh aw compile → 0 errors / 0 warnings.
  • Chunk split/reassembly verified to round-trip exactly (ASCII and multibyte).
  • gh-aw substitution confirmed to use exact-string split().join() (no greedy-regex / prefix collisions between part1_data_1 and part1_data_10).
  • Reviewed by two additional models; no blocking issues.

The daily test-quarantine workflow's activation job was failing with
"An error occurred trying to start process '/usr/bin/bash' ... Argument
list too long" (E2BIG). The pre_activation step computes ~225 KB of CI
failure data (part1_data) and gh-aw passes it to the prompt-building
steps as a single environment variable. Linux caps one env-var string at
MAX_ARG_STRLEN (32 * 4 KiB page = 131072 bytes) during execve, so merely
declaring that variable on a step makes the step die before it runs.

This was latent until dotnet#67322 fixed token scrubbing: previously GitHub's
secret detector skipped the whole output, so the env var resolved empty
and never hit the limit; with scrubbing fixed the data now flows at full
size and trips MAX_ARG_STRLEN.

Split part1_data into 16 fixed, byte-bounded chunks (<=80000 bytes each,
well under the limit), one per job output (part1_data_0..15), and
concatenate the placeholders adjacently in the prompt so gh-aw's
exact-string substitution reconstructs the JSON verbatim. Empty slots
cost nothing, so total environment size is unchanged. Chunks split on
UTF-8 character boundaries; a loud FATAL guards the (unreachable in
practice, since json.dumps emits ASCII) case of overflow rather than
silently truncating.

Recompiled the lockfile with gh aw v0.79.8.

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings June 21, 2026 11:48
@wtgodbe
wtgodbe requested a review from a team as a code owner June 21, 2026 11:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a recurring failure in the daily test-quarantine workflow where the activation job crashed with Argument list too long because a single large part1_data job output was being materialized as an oversized environment variable during prompt-building.

Changes:

  • Split the part1_data JSON payload into 16 byte-bounded outputs (part1_data_0..15) and reassemble them in the prompt via adjacent placeholders.
  • Update the pre_activation job outputs to expose the chunked values instead of a single part1_data.
  • Regenerate test-quarantine.lock.yml with gh aw compile (v0.79.8), reflecting the chunked env vars and other generated updates.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.github/workflows/test-quarantine.md Implements chunking in the Part 1 aggregation script and updates the prompt to concatenate part1_data_0..15.
.github/workflows/test-quarantine.lock.yml Regenerated compiled workflow to carry the new chunked outputs through prompt-building steps (and updates gh-aw metadata/tooling).

@wtgodbe
wtgodbe merged commit 4ecc19f into dotnet:main Jun 21, 2026
12 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview6 milestone Jun 23, 2026
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.

2 participants